123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- angular.module('push')
- .controller('auditContentCtrl', function ($scope, $stateParams, AccountService, UtilService) {
- var msgid = $stateParams.messageid;
- $scope.imagelist = [
- {
- id: 0,
- doctype: 6,// 正面
- title: "",
- photo_name: ""
- }, {
- id: 0,
- doctype: 7,// 反面
- title: "",
- photo_name: ""
- },
- {
- id: 0,
- doctype: 3,// 在职
- title: "",
- photo_name: ""
- }, {
- id: 0,
- doctype: 5,// 营业
- title: "",
- photo_name: ""
- }
- ];
- //获取认证信息 1身份证 2在职 3单位
- var getQualifyInfo = function () {
- $scope.showLoadingToast();
- AccountService.getAuthInfo(msgid).then(function (response) {
- console.log(response);
- if (angular.isDefined(response.info)) {
- $scope.authinfo = response.info;
- // 遍历找出证件类型名称
- angular.forEach(response.idtype, function (val, ind) {
- if (val.itemvalue == response.info.idtype) {
- $scope.authinfo.idtypename = val.itemkey;
- }
- });
- // 单位类型
- angular.forEach(response.orgtype, function (val, ind) {
- if (val.itemvalue == response.info.orgtype) {
- $scope.authinfo.orgtypename = val.itemkey;
- }
- });
- // 职称
- angular.forEach(response.titles, function (val, ind) {
- if (val.itemvalue == response.info.positionaltitles) {
- $scope.authinfo.positionaltitlename = val.itemkey;
- }
- });
- // 遍历找出身份证正反面
- if (angular.isDefined(response.info.imagelist) && response.info.imagelist.length > 0) {
- angular.forEach(response.info.imagelist, function (val, ind) {
- if (val.doctype == 6) {
- $scope.imagelist[0] = val;
- }
- if (val.doctype == 7) {
- $scope.imagelist[1] = val;
- }
- if (val.doctype == 3) {
- $scope.imagelist[2] = val;
- }
- if (val.doctype == 5) {
- $scope.imagelist[3] = val;
- }
- })
- }
- }
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getQualifyInfo();
- // 通过
- $scope.passApplyInfo = function () {
- $scope.showLoadingToast();
- AccountService.authInfo(msgid, 1, "审核通过").then(function () {
- UtilService.showMess("审核通过");
- $scope.authinfo.authenstatus = 2;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- // 拒绝
- $scope.refuseApplyInfo = function () {
- $scope.showLoadingToast();
- AccountService.authInfo(msgid, 2, "审核拒绝").then(function () {
- UtilService.showMess("审核拒绝");
- $scope.authinfo.authenstatus = 3;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- });
|