浏览代码

新建事件选择处理人,可以通过工作组筛选

seimin 3 年之前
父节点
当前提交
8e197f90f6
共有 1 个文件被更改,包括 30 次插入4 次删除
  1. 30 4
      assets/js/controllers/customform/customformCtrl.js

+ 30 - 4
assets/js/controllers/customform/customformCtrl.js

@@ -9064,6 +9064,9 @@ appFormly.config(
9064 9064
                 return {
9065 9065
                     templateOptions: {
9066 9066
                         // refresh: function() {},
9067
+                        getScope:function(){
9068
+                            return scope;
9069
+                        },
9067 9070
                         refreshDelay: 0,
9068 9071
                         linkage: function (modelName, data, model, modelKey, key, timekey) { //POST
9069 9072
                             console.log(model,'model')
@@ -9256,7 +9259,24 @@ appFormly.config(
9256 9259
                                             }
9257 9260
                                         })
9258 9261
                                 }
9259
-
9262
+                                //新建事件,选择派单,选择工作组查找处理人baba
9263
+                                if(key == 'handlerUser'){
9264
+                                    model.fields.forEach(function(v){
9265
+                                        if(v.templateOptions.pkey == 'incident.handlerUser'){
9266
+                                            v.templateOptions.options = list;
9267
+                                            if(model.model.incident.handlerUser){
9268
+                                                if(model.model.incident.handlerUser.id){
9269
+                                                    var flag = list.some(function(v){
9270
+                                                        return v.id == model.model.incident.handlerUser.id;
9271
+                                                    })
9272
+                                                    if(flag){
9273
+                                                        v.model.id = model.model.incident.handlerUser.id;
9274
+                                                    }
9275
+                                                }
9276
+                                            }
9277
+                                        }
9278
+                                    })
9279
+                                }
9260 9280
                             });
9261 9281
                         },
9262 9282
                         validators: {
@@ -9279,7 +9299,12 @@ appFormly.config(
9279 9299
                         // $scope.myFilter = function(item) {
9280 9300
                         //     return !$scope.search || $select.selected[to.labelProp || 'name'] == $scope.search;
9281 9301
                         // }
9282
-                        // console.log($scope,'风浪')
9302
+                        console.log($scope,'风浪')
9303
+                        //工作组添加全部选项
9304
+                        // if($scope.options.templateOptions.label == '工作组'){
9305
+                        //     $scope.options.templateOptions.options.unshift({id:0,groupName:'全部'});
9306
+                        //     $scope.model._group = 0;
9307
+                        // }
9283 9308
                         if ($scope.options.templateOptions.pkey && $scope.options.templateOptions.pkey == "incident.place") {
9284 9309
                             if ($scope.$parent && $scope.$parent.$parent.$parent.model && $scope.$parent.$parent.$parent.model.incident.area && $scope.$parent.$parent.$parent.model.incident.area.id) {
9285 9310
                                 $scope.options.templateOptions.linkage("place", {
@@ -9295,8 +9320,9 @@ appFormly.config(
9295 9320
                         $scope.myFilter = $scope;
9296 9321
                         // console.log($scope.options.templateOptions)
9297 9322
                         console.log($scope,77777)
9298
-                        //处理人根据事件分类自动带入
9323
+                        //处理人根据事件分类自动带入baba
9299 9324
                         if($scope.options.templateOptions.pkey == "incident.handlerUser"){
9325
+                            console.log($scope.options.templateOptions.pkey)
9300 9326
                             if($scope.$parent.$parent.$parent.model.incident.handlerUser){
9301 9327
                                 if($scope.$parent.$parent.$parent.model.incident.handlerUser.id){
9302 9328
                                     $scope.options.model.id = $scope.$parent.$parent.$parent.model.incident.handlerUser.id;
@@ -17197,7 +17223,7 @@ appFormly.controller('CustomformCtrl', ['$rootScope', '$scope', '$parse', '$inje
17197 17223
                     }
17198 17224
                 }
17199 17225
                 // console.log(incidentDescription)
17200
-                var bxr = JSON.parse(localStorage.getItem("login_requester"));//bababa
17226
+                var bxr = JSON.parse(localStorage.getItem("login_requester"));
17201 17227
                 var formdata = {
17202 17228
                     'model': {
17203 17229
                         // 'isInspection': true,