seimin 11 місяців тому
батько
коміт
afea967535
1 змінених файлів з 42 додано та 7 видалено
  1. 42 7
      assets/js/controllers/mainCtrl.js

+ 42 - 7
assets/js/controllers/mainCtrl.js

@@ -4197,9 +4197,43 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4197 4197
           };
4198 4198
 
4199 4199
           // 处理人/处理组加责任科室搜索
4200
-          $scope.userAndGroupSearch = function(){
4201
-            $scope.jry_userSearch();
4202
-            $scope.jry_groupSearch();
4200
+          $scope.userAndGroupSearch = async function(){
4201
+            // $scope.jry_userSearch();
4202
+            // $scope.jry_groupSearch();
4203
+            var userData = {
4204
+              idx: 0,
4205
+              sum: 1000,
4206
+              user: {
4207
+                duty: $scope.selectedDuty || undefined,
4208
+                roledata: {rolecode: "first-line support"},
4209
+                selectDetails:'1',
4210
+                simple:true,
4211
+                name: key,
4212
+                selectType: "pinyin_qs",
4213
+                engineer: 1,
4214
+              },
4215
+            };
4216
+
4217
+            var groupData = {
4218
+              idx: 0,
4219
+              sum: 1000,
4220
+              group: {
4221
+                duty: $scope.selectedDuty || undefined,
4222
+                selectType: "nouser"
4223
+              },
4224
+            };
4225
+
4226
+            let userResult = await api_user_data.fetchDataList("user", userData);
4227
+            let groupResult = await api_user_data.fetchDataList("group", groupData);
4228
+
4229
+            $scope.jry_userData = userResult.list;
4230
+            if($scope.incidentModel.user){
4231
+              if(!$scope.incidentModel.user.name){
4232
+                $scope.incidentModel.user = userResult.list.find(v=>v.id == $scope.incidentModel.user.id);
4233
+              }
4234
+            }
4235
+
4236
+            $scope.jry_groupData = groupResult.list;
4203 4237
             // if($scope.incidentModel.assign == 0){
4204 4238
             //   $scope.jry_userSearch();
4205 4239
             //   $scope.jry_groupSearch();
@@ -4226,6 +4260,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4226 4260
                 if(result.status == 200){
4227 4261
                   var deptBinduserConfig = result.list?result.list[0]:null;//获取第一条配置
4228 4262
                   if(deptBinduserConfig){
4263
+                    $scope.userAndGroupSearch();
4229 4264
                     // 如果有科室绑定人员的配置
4230 4265
                     if(deptBinduserConfig.userOrGroupType == 1){
4231 4266
                       // 派单给人
@@ -4236,7 +4271,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4236 4271
                       $scope.incidentModel.assign = 2;
4237 4272
                       $scope.incidentModel.group = $scope.jry_groupData.find(v=>v.id == deptBinduserConfig.group);
4238 4273
                     }
4239
-                    $scope.userAndGroupSearch();
4274
+
4240 4275
                   }else{
4241 4276
                     // 没有查询到科室绑定人员的配置,则根据院区,普通科室,责任科室查询
4242 4277
                     var postData = {
@@ -4257,6 +4292,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4257 4292
                         // 获取第一条配置
4258 4293
                         deptBinduserConfig = deptBinduserConfig[0] || null;
4259 4294
                         if(deptBinduserConfig){
4295
+                          $scope.userAndGroupSearch();
4260 4296
                           // 如果有科室绑定人员的配置
4261 4297
                           if(deptBinduserConfig.userOrGroupType == 1){
4262 4298
                             // 派单给人
@@ -4267,7 +4303,6 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4267 4303
                             $scope.incidentModel.assign = 2;
4268 4304
                             $scope.incidentModel.group = $scope.jry_groupData.find(v=>v.id == deptBinduserConfig.group);
4269 4305
                           }
4270
-                          $scope.userAndGroupSearch();
4271 4306
                         }else{
4272 4307
                           if($scope.categorySelect){
4273 4308
                             // 选择了故障现象
@@ -4952,6 +4987,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4952 4987
           function assignCommon(sj){
4953 4988
             console.log(sj);
4954 4989
             if(!sj){return;}
4990
+            $scope.userAndGroupSearch();
4955 4991
             if (sj.branchType == 0) {
4956 4992
               if (sj.userOrGroupType === 1) {
4957 4993
                 //派人
@@ -4998,7 +5034,6 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4998 5034
               }
4999 5035
             }
5000 5036
 
5001
-            $scope.userAndGroupSearch();
5002 5037
           }
5003 5038
 
5004 5039
           // 取消故障描述弹窗
@@ -5135,7 +5170,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
5135 5170
             newVal && $scope.jry_incident(newVal.id);
5136 5171
             console.log(newVal);
5137 5172
 
5138
-            if($scope.modelData && newVal.id == oldVal.id){
5173
+            if($scope.modelData && (newVal.id === oldVal.id || newVal == oldVal)){
5139 5174
 
5140 5175
             }else{
5141 5176
               if(newVal){