auditContentCtrl.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. angular.module('push')
  2. .controller('auditContentCtrl', function ($scope, $stateParams, AccountService, UtilService) {
  3. var msgid = $stateParams.messageid;
  4. $scope.imagelist = [
  5. {
  6. id: 0,
  7. doctype: 6,// 正面
  8. title: "",
  9. photo_name: ""
  10. }, {
  11. id: 0,
  12. doctype: 7,// 反面
  13. title: "",
  14. photo_name: ""
  15. },
  16. {
  17. id: 0,
  18. doctype: 3,// 在职
  19. title: "",
  20. photo_name: ""
  21. }, {
  22. id: 0,
  23. doctype: 5,// 营业
  24. title: "",
  25. photo_name: ""
  26. }
  27. ];
  28. //获取认证信息 1身份证 2在职 3单位
  29. var getQualifyInfo = function () {
  30. $scope.showLoadingToast();
  31. AccountService.getAuthInfo(msgid).then(function (response) {
  32. console.log(response);
  33. if (angular.isDefined(response.info)) {
  34. $scope.authinfo = response.info;
  35. // 遍历找出证件类型名称
  36. angular.forEach(response.idtype, function (val, ind) {
  37. if (val.itemvalue == response.info.idtype) {
  38. $scope.authinfo.idtypename = val.itemkey;
  39. }
  40. });
  41. // 单位类型
  42. angular.forEach(response.orgtype, function (val, ind) {
  43. if (val.itemvalue == response.info.orgtype) {
  44. $scope.authinfo.orgtypename = val.itemkey;
  45. }
  46. });
  47. // 职称
  48. angular.forEach(response.titles, function (val, ind) {
  49. if (val.itemvalue == response.info.positionaltitles) {
  50. $scope.authinfo.positionaltitlename = val.itemkey;
  51. }
  52. });
  53. // 遍历找出身份证正反面
  54. if (angular.isDefined(response.info.imagelist) && response.info.imagelist.length > 0) {
  55. angular.forEach(response.info.imagelist, function (val, ind) {
  56. if (val.doctype == 6) {
  57. $scope.imagelist[0] = val;
  58. }
  59. if (val.doctype == 7) {
  60. $scope.imagelist[1] = val;
  61. }
  62. if (val.doctype == 3) {
  63. $scope.imagelist[2] = val;
  64. }
  65. if (val.doctype == 5) {
  66. $scope.imagelist[3] = val;
  67. }
  68. })
  69. }
  70. }
  71. $scope.hideLoadingToast();
  72. }, function () {
  73. $scope.hideLoadingToast();
  74. })
  75. };
  76. getQualifyInfo();
  77. // 通过
  78. $scope.passApplyInfo = function () {
  79. $scope.showLoadingToast();
  80. AccountService.authInfo(msgid, 1, "审核通过").then(function () {
  81. UtilService.showMess("审核通过");
  82. $scope.authinfo.authenstatus = 2;
  83. $scope.hideLoadingToast();
  84. }, function () {
  85. $scope.hideLoadingToast();
  86. })
  87. };
  88. // 拒绝
  89. $scope.refuseApplyInfo = function () {
  90. $scope.showLoadingToast();
  91. AccountService.authInfo(msgid, 2, "审核拒绝").then(function () {
  92. UtilService.showMess("审核拒绝");
  93. $scope.authinfo.authenstatus = 3;
  94. $scope.hideLoadingToast();
  95. }, function () {
  96. $scope.hideLoadingToast();
  97. })
  98. };
  99. });