Kaynağa Gözat

修改事件不改变单号

seimin 1 yıl önce
ebeveyn
işleme
dbf6bcc469
1 değiştirilmiş dosya ile 22 ekleme ve 9 silme
  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
             if(!$scope.categorySelectId){
4014
             if(!$scope.categorySelectId){
4015
               SweetAlert.swal({
4015
               SweetAlert.swal({
4016
                   title: "提示",
4016
                   title: "提示",
@@ -4156,8 +4156,12 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4156
             }else if($scope.incidentModel.assign == 2){
4156
             }else if($scope.incidentModel.assign == 2){
4157
               postData.incident.candidateGroups = $scope.incidentModel.group.id;
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
               postData.incident.incidentsign = res1.data;
4161
               postData.incident.incidentsign = res1.data;
4162
+            }
4163
+            // api_bpm_domain.workernumber('sj').then(res1=>{
4164
+              // postData.incident.incidentsign = res1.data;
4161
               api_flow.accept("accept", postData).then(function (response) {
4165
               api_flow.accept("accept", postData).then(function (response) {
4162
                 if ($scope.uploader != null) {
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
             $rootScope.isMask = true;
4211
             $rootScope.isMask = true;
4208
             var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
4212
             var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
4209
             var postData = {
4213
             var postData = {
@@ -4241,8 +4245,12 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4241
             }else if($scope.incidentModel.assign == 2){
4245
             }else if($scope.incidentModel.assign == 2){
4242
               postData.incident.candidateGroups = $scope.incidentModel ? $scope.incidentModel.group.id : undefined;
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
               postData.incident.incidentsign = res1.data;
4250
               postData.incident.incidentsign = res1.data;
4251
+            }
4252
+            // api_bpm_domain.workernumber('sj').then(res1=>{
4253
+              // postData.incident.incidentsign = res1.data;
4246
               api_flow.accept("storage", postData).then(function (response) {
4254
               api_flow.accept("storage", postData).then(function (response) {
4247
                 if ($scope.uploader != null) {
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
           $scope.showId = "";
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
                   $rootScope.isMask = true;
4649
                   $rootScope.isMask = true;
4642
                   console.log(scope.incidentModel,$scope.incidentModel);
4650
                   console.log(scope.incidentModel,$scope.incidentModel);
4643
                   var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
4651
                   var repair_main = JSON.parse(sessionStorage.getItem('repair_main'));
@@ -4710,8 +4718,13 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4710
                   //   // 微信报修转事件
4718
                   //   // 微信报修转事件
4711
                   //   postData.flow = scope.modelData.flow;
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
                     postData.incident.incidentsign = res1.data;
4723
                     postData.incident.incidentsign = res1.data;
4724
+                  }
4725
+
4726
+                  // api_bpm_domain.workernumber('sj').then(res1=>{
4727
+                  //   postData.incident.incidentsign = res1.data;
4715
                     api_flow.accept("accept", postData).then(function (resData) {
4728
                     api_flow.accept("accept", postData).then(function (resData) {
4716
                       if (scope.uploader != null) {
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
                 $scope.cancel = function () {
4859
                 $scope.cancel = function () {