Browse Source

分院区修复

seimin 2 years ago
parent
commit
b9b954ed6d
1 changed files with 23 additions and 20 deletions
  1. 23 20
      assets/js/controllers/customform/customformCtrl.js

+ 23 - 20
assets/js/controllers/customform/customformCtrl.js

@@ -12259,6 +12259,7 @@ appFormly.config(function config(formlyConfigProvider) {
12259
                     })
12259
                     })
12260
                     console.log(item)//11615
12260
                     console.log(item)//11615
12261
                     if (item) {
12261
                     if (item) {
12262
+                      items.$parent.originalModel.incident.branchType = item.branchType;
12262
                       if(item.branchType == 0){
12263
                       if(item.branchType == 0){
12263
                         if (item.userOrGroupType === 1) {
12264
                         if (item.userOrGroupType === 1) {
12264
                           items.$parent.originalModel.start_code = 'assignment';
12265
                           items.$parent.originalModel.start_code = 'assignment';
@@ -12279,30 +12280,32 @@ appFormly.config(function config(formlyConfigProvider) {
12279
                           delete items.$parent.originalModel.incident.handlerUser
12280
                           delete items.$parent.originalModel.incident.handlerUser
12280
                         }
12281
                         }
12281
                       }else if(item.branchType == 1){
12282
                       }else if(item.branchType == 1){
12283
+                        items.$parent.originalModel.incident.branchUserGroups = item.branchUserGroups;
12282
                         // items.$parent.originalModel.incident.area.id
12284
                         // items.$parent.originalModel.incident.area.id
12283
                         options.templateOptions.APIService.fetchData('area',items.$parent.originalModel.incident.area.id).then(res=>{
12285
                         options.templateOptions.APIService.fetchData('area',items.$parent.originalModel.incident.area.id).then(res=>{
12284
                           console.log(res)
12286
                           console.log(res)
12285
                           if(res.status == 200){
12287
                           if(res.status == 200){
12288
+                            items.$parent.originalModel.incident.branchId = res.data.branch;
12286
                             // res.data.branch
12289
                             // res.data.branch
12287
-                              var branchUserGroup=item.branchUserGroups.find(v=>v.branchId==res.data.branch)||{};
12288
-                              if(branchUserGroup.branchUserOrGroupType==1){
12289
-                                items.$parent.originalModel.start_code='assignment';
12290
-                                items.$parent.originalModel.incident.handlerUser={id:branchUserGroup.userId?branchUserGroup.userId:undefined};
12291
-                                items.$parent.originalModel.directClose=true;
12292
-                                items.$parent.originalModel.isHandlerUser=false;
12293
-                                setTimeout(function(){items.$parent.originalModel.isHandlerUser=true;},0)
12294
-                              }else if(branchUserGroup.branchUserOrGroupType===2){
12295
-                                items.$parent.originalModel.start_code='assignment';
12296
-                                items.$parent.originalModel.candidateGroups=branchUserGroup.groupId?branchUserGroup.groupId:undefined;
12297
-                                items.$parent.originalModel.directClose=true;
12298
-                                items.$parent.originalModel.isHandlerUser=false;
12299
-                              }else{
12300
-                                items.$parent.originalModel.start_code='close';
12301
-                                items.$parent.originalModel.directClose=false;
12302
-                                items.$parent.originalModel.isHandlerUser=false;
12303
-                                delete items.$parent.originalModel.candidateGroups;
12304
-                                delete items.$parent.originalModel.incident.handlerUser
12305
-                              }
12290
+                            var branchUserGroup=item.branchUserGroups.find(v=>v.branchId==res.data.branch)||{};
12291
+                            if(branchUserGroup.branchUserOrGroupType==1){
12292
+                              items.$parent.originalModel.start_code='assignment';
12293
+                              items.$parent.originalModel.incident.handlerUser={id:branchUserGroup.userId?branchUserGroup.userId:undefined};
12294
+                              items.$parent.originalModel.directClose=true;
12295
+                              items.$parent.originalModel.isHandlerUser=false;
12296
+                              setTimeout(function(){items.$parent.originalModel.isHandlerUser=true;},0)
12297
+                            }else if(branchUserGroup.branchUserOrGroupType===2){
12298
+                              items.$parent.originalModel.start_code='assignment';
12299
+                              items.$parent.originalModel.candidateGroups=branchUserGroup.groupId?branchUserGroup.groupId:undefined;
12300
+                              items.$parent.originalModel.directClose=true;
12301
+                              items.$parent.originalModel.isHandlerUser=false;
12302
+                            }else{
12303
+                              items.$parent.originalModel.start_code='close';
12304
+                              items.$parent.originalModel.directClose=false;
12305
+                              items.$parent.originalModel.isHandlerUser=false;
12306
+                              delete items.$parent.originalModel.candidateGroups;
12307
+                              delete items.$parent.originalModel.incident.handlerUser
12308
+                            }
12306
                           }
12309
                           }
12307
                         })
12310
                         })
12308
                       }
12311
                       }
@@ -20839,7 +20842,7 @@ appFormly.controller("CustomformCtrl", [
20839
       //     }
20842
       //     }
20840
       // }
20843
       // }
20841
       // 初始化的时候判断是否是简单处理
20844
       // 初始化的时候判断是否是简单处理
20842
-      if(modelWatch.model.incident.category){
20845
+      if(modelWatch.model && modelWatch.model.incident && modelWatch.model.incident.category){
20843
           if (modelWatch.model.incident.category.hasSimple == 1) {
20846
           if (modelWatch.model.incident.category.hasSimple == 1) {
20844
             vm.model.isHasSimple = true;
20847
             vm.model.isHasSimple = true;
20845
           }else{
20848
           }else{