Browse Source

修改事件不改变单号

seimin 11 months ago
parent
commit
dbf6bcc469
1 changed files with 22 additions and 9 deletions
  1. 22 9
      assets/js/controllers/mainCtrl.js

+ 22 - 9
assets/js/controllers/mainCtrl.js

@@ -4010,7 +4010,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4010 4010
             });
4011 4011
           }
4012 4012
           // 建单并派单
4013
-          $scope.buildAndAssign = function(){
4013
+          $scope.buildAndAssign = async function(){
4014 4014
             if(!$scope.categorySelectId){
4015 4015
               SweetAlert.swal({
4016 4016
                   title: "提示",
@@ -4156,8 +4156,12 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4156 4156
             }else if($scope.incidentModel.assign == 2){
4157 4157
               postData.incident.candidateGroups = $scope.incidentModel.group.id;
4158 4158
             }
4159
-            api_bpm_domain.workernumber('sj').then(res1=>{
4159
+            if(!postData.incident.incidentsign){
4160
+              let res1 = await api_bpm_domain.workernumber('sj');
4160 4161
               postData.incident.incidentsign = res1.data;
4162
+            }
4163
+            // api_bpm_domain.workernumber('sj').then(res1=>{
4164
+              // postData.incident.incidentsign = res1.data;
4161 4165
               api_flow.accept("accept", postData).then(function (response) {
4162 4166
                 if ($scope.uploader != null) {
4163 4167
                   // 有图片
@@ -4200,10 +4204,10 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4200 4204
                   }
4201 4205
                 );
4202 4206
               });
4203
-            })
4207
+            // })
4204 4208
           }
4205 4209
           // 暂存
4206
-          $scope.temporaryStorage = function(){
4210
+          $scope.temporaryStorage = async function(){
4207 4211
             $rootScope.isMask = true;
4208 4212
             var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
4209 4213
             var postData = {
@@ -4241,8 +4245,12 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4241 4245
             }else if($scope.incidentModel.assign == 2){
4242 4246
               postData.incident.candidateGroups = $scope.incidentModel ? $scope.incidentModel.group.id : undefined;
4243 4247
             }
4244
-            api_bpm_domain.workernumber('sj').then(res1=>{
4248
+            if(!postData.incident.incidentsign){
4249
+              let res1 = await api_bpm_domain.workernumber('sj');
4245 4250
               postData.incident.incidentsign = res1.data;
4251
+            }
4252
+            // api_bpm_domain.workernumber('sj').then(res1=>{
4253
+              // postData.incident.incidentsign = res1.data;
4246 4254
               api_flow.accept("storage", postData).then(function (response) {
4247 4255
                 if ($scope.uploader != null) {
4248 4256
                   // 有图片
@@ -4285,7 +4293,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4285 4293
                   }
4286 4294
                 );
4287 4295
               });
4288
-            })
4296
+            // })
4289 4297
           }
4290 4298
           // 展开/收起
4291 4299
           $scope.showId = "";
@@ -4637,7 +4645,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4637 4645
                   // -------新建事件,积分机制,直接处理--------
4638 4646
                 };
4639 4647
                 // 直接处理,新建事件
4640
-                function handlerStart(){
4648
+                async function handlerStart(){
4641 4649
                   $rootScope.isMask = true;
4642 4650
                   console.log(scope.incidentModel,$scope.incidentModel);
4643 4651
                   var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
@@ -4710,8 +4718,13 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4710 4718
                   //   // 微信报修转事件
4711 4719
                   //   postData.flow = scope.modelData.flow;
4712 4720
                   // }
4713
-                  api_bpm_domain.workernumber('sj').then(res1=>{
4721
+                  if(!postData.incident.incidentsign){
4722
+                    let res1 = await api_bpm_domain.workernumber('sj');
4714 4723
                     postData.incident.incidentsign = res1.data;
4724
+                  }
4725
+
4726
+                  // api_bpm_domain.workernumber('sj').then(res1=>{
4727
+                  //   postData.incident.incidentsign = res1.data;
4715 4728
                     api_flow.accept("accept", postData).then(function (resData) {
4716 4729
                       if (scope.uploader != null) {
4717 4730
                         // 有图片
@@ -4840,7 +4853,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4840 4853
                         }
4841 4854
                       );
4842 4855
                     });
4843
-                  })
4856
+                  // })
4844 4857
                 }
4845 4858
                 // 取消
4846 4859
                 $scope.cancel = function () {