Explorar el Código

巡检修改-暂存

seimin hace 2 años
padre
commit
4d3075b986

+ 51 - 13
assets/js/controllers/customform/customformCtrl.js

@@ -11136,6 +11136,11 @@ appFormly.config(function config(formlyConfigProvider) {
11136 11136
             //     return !$scope.search || $select.selected[to.labelProp || 'name'] == $scope.search;
11137 11137
             // }
11138 11138
             console.log($scope, "风浪");
11139
+
11140
+            if($scope.to.onlyKey === 'inspection.dictionary'){
11141
+              //巡检列表-新增-巡检类型baba
11142
+              $scope.model.id = 1714;//默认按组
11143
+            }
11139 11144
             //工作组添加全部选项
11140 11145
             // if($scope.options.templateOptions.label == '工作组'){
11141 11146
             //     $scope.options.templateOptions.options.unshift({id:0,groupName:'全部'});
@@ -11271,7 +11276,10 @@ appFormly.config(function config(formlyConfigProvider) {
11271 11276
           "$stateParams",
11272 11277
           function ($scope, $rootScope, api_bpm_domain, $stateParams) {
11273 11278
             $scope.model[$scope.options.key] = '0';//默认全部
11274
-            var arr = $scope.model.inspection.batchNos.map(v=>({value:v,name:v}));
11279
+            var arr = [];
11280
+            if($scope.model.inspection.batchNos){
11281
+              arr = $scope.model.inspection.batchNos.map(v=>({value:v,name:v}));
11282
+            }
11275 11283
             arr.unshift({value:'0',name:'全部'});
11276 11284
             $scope.options.templateOptions.options = arr;
11277 11285
             console.log($scope)
@@ -12479,14 +12487,24 @@ appFormly.config(function config(formlyConfigProvider) {
12479 12487
     defaultOptions: function (options) {
12480 12488
       return {
12481 12489
         templateOptions: {
12482
-          refresh: function () { },
12490
+          refresh: function () {},
12483 12491
           refreshDelay: 0,
12484 12492
         },
12485 12493
       };
12486 12494
     },
12487 12495
     controller: [
12488 12496
       "$scope",
12489
-      function ($scope) {
12497
+      "api_wechatfile",
12498
+      function ($scope,api_wechatfile) {
12499
+        // 新增巡检计划-巡检方式baba
12500
+        if($scope.to.onlyKey === 'onlineType'){
12501
+          api_wechatfile.getDictionary($scope.to.modelreasondata).then(function (result) {
12502
+            $scope.to.options = result;
12503
+            if(!$scope.model[$scope.options.key]){
12504
+              $scope.model[$scope.options.key] = result[0]?result[0].id:null;
12505
+            }
12506
+          });
12507
+        }
12490 12508
         // 巡检生成事件,默认派单
12491 12509
         if ($scope.model.isInspection) {
12492 12510
           $scope.model[$scope.options.key] = true;
@@ -13015,6 +13033,21 @@ appFormly.config(function config(formlyConfigProvider) {
13015 13033
           enableFiltering: false,
13016 13034
         },
13017 13035
         {
13036
+          name: "sign",
13037
+          displayName: "单号",
13038
+          width: 140,
13039
+          enableFiltering: false,
13040
+        },
13041
+        {
13042
+          name: "inspectionType.type",
13043
+          displayName: "巡检分类",
13044
+          width: 200,
13045
+          enableFiltering: false,
13046
+          cellTemplate: '<div>' +
13047
+                '<div class="ui-grid-cell-contents">{{row.entity.online?"线上巡检-":(row.entity.online===false?"线下巡检-":"")}}{{row.entity.inspectionType.type}}</div>' +
13048
+                '</div>'
13049
+        },
13050
+        {
13018 13051
           name: "stateName",
13019 13052
           displayName: "状态",
13020 13053
           width: 80,
@@ -13022,9 +13055,13 @@ appFormly.config(function config(formlyConfigProvider) {
13022 13055
         },
13023 13056
         {
13024 13057
           name: "processUser.name",
13025
-          displayName: "处理人",
13026
-          width: 80,
13058
+          displayName: "处理人/组",
13059
+          width: 120,
13027 13060
           enableFiltering: false,
13061
+          cellTemplate: '<div>' +
13062
+                '<div class="ui-grid-cell-contents" ng-if="row.entity.processUser">{{row.entity.processUser.name}}</div>' +
13063
+                '<div class="ui-grid-cell-contents" ng-if="row.entity.group">{{row.entity.group.groupName}}</div>' +
13064
+                '</div>'
13028 13065
         },
13029 13066
         {
13030 13067
           name: "startDate",
@@ -13033,17 +13070,18 @@ appFormly.config(function config(formlyConfigProvider) {
13033 13070
           enableFiltering: false,
13034 13071
         },
13035 13072
         {
13036
-          name: "overdueTime",
13037
-          displayName: "逾期时间",
13038
-          width: 160,
13039
-          enableFiltering: false,
13040
-        },
13041
-        {
13042
-          name: "batchNo",
13043
-          displayName: "批次号",
13073
+          name: "endTime",
13074
+          displayName: "结束时间",
13044 13075
           width: 160,
13045 13076
           enableFiltering: false,
13046 13077
         },
13078
+        
13079
+        // {
13080
+        //   name: "batchNo",
13081
+        //   displayName: "批次号",
13082
+        //   width: 160,
13083
+        //   enableFiltering: false,
13084
+        // },
13047 13085
       ];
13048 13086
 
13049 13087
       var defaultFilterData = {

+ 15 - 7
assets/js/controllers/inspect/inspectForm.js

@@ -76,7 +76,8 @@ sysFormly.controller('SystemformCtrl', ['$rootScope', '$scope', '$parse', '$filt
76 76
                 filedata = { "idx": 0, "sum": 100 }
77 77
                 if (field.templateOptions.ApiService) {
78 78
                     process = UserRestangular.all("");
79
-                    filedata = { 'user': { 'roledata': { 'rolecode': 'inspectman' } }, "idx": 0, "sum": 1000 }
79
+                    // filedata = { 'user': { 'roledata': { 'rolecode': 'inspectman' } }, "idx": 0, "sum": 1000 }
80
+                    // filedata = { 'user': { 'roledata': { 'rolecode': 'inspectman' } }, "idx": 0, "sum": 1000 }
80 81
                 }
81 82
                 if (field.templateOptions.Apicommon) {
82 83
                     process = WechatRestangular.all("");
@@ -84,6 +85,7 @@ sysFormly.controller('SystemformCtrl', ['$rootScope', '$scope', '$parse', '$filt
84 85
                 var datakey = { "idx": 0, "sum": 1000 };
85 86
                 if (field.templateOptions.modelreasondata) {
86 87
                     datakey = field.templateOptions.modelreasondata
88
+                    filedata = field.templateOptions.modelreasondata
87 89
                 }
88 90
 
89 91
 
@@ -420,9 +422,12 @@ sysFormly.controller('SystemformCtrl', ['$rootScope', '$scope', '$parse', '$filt
420 422
                             case "start":
421 423
                                 if(vm.model.inspection){
422 424
                                     if(vm.model.inspection.executeUser.id){
423
-                                        delete vm.model.inspection.scheduleClass
424
-                                    }else if(vm.model.inspection.scheduleClass.id){
425
-                                        delete vm.model.inspection.executeUser
425
+                                        delete vm.model.inspection.group;
426
+                                    }else if(vm.model.inspection.group){
427
+                                        delete vm.model.inspection.executeUser;
428
+                                    }else{
429
+                                        delete vm.model.inspection.group
430
+                                        delete vm.model.inspection.executeUser;
426 431
                                     }
427 432
                                 }
428 433
                                 if (vm.model.inspection.id) {
@@ -606,9 +611,12 @@ sysFormly.controller('SystemformCtrl', ['$rootScope', '$scope', '$parse', '$filt
606 611
                             console.log(vm);
607 612
                             if(vm.model.inspection){
608 613
                                 if(vm.model.inspection.executeUser.id){
609
-                                    delete vm.model.inspection.scheduleClass
610
-                                }else if(vm.model.inspection.scheduleClass.id){
611
-                                    delete vm.model.inspection.executeUser
614
+                                    delete vm.model.inspection.group;
615
+                                }else if(vm.model.inspection.group){
616
+                                    delete vm.model.inspection.executeUser;
617
+                                }else{
618
+                                    delete vm.model.inspection.group;
619
+                                    delete vm.model.inspection.executeUser;
612 620
                                 }
613 621
                             }
614 622
                             if (vm.model.inspection.id) {

+ 43 - 24
assets/js/controllers/inspect/inspectListCtrl.js

@@ -147,33 +147,37 @@ app.controller("inspectListCtrl", [
147 147
           '<div class="ui-grid-cell-contents" tooltip={{grid.appScope.transfertip(row.entity.ruleColour)}} tooltip-placement="right"><i style="font-size: 18px !important;" class="{{grid.appScope.transferColor(row.entity.ruleColour)}}"></i></div></div>',
148 148
       },
149 149
       {
150
-        name: "sign",
151
-        displayName: "单号",
152
-        width: "12%",
153
-        minWidth: 120,
154
-        enableFiltering: false,
155
-      },
156
-      {
157
-        name: "inspectionType.type",
158
-        displayName: "巡检分类",
150
+        name: "inspection.title",
151
+        displayName: "计划主题",
159 152
         width: "12%",
160 153
         minWidth: 120,
161 154
         enableFiltering: false,
162 155
       },
163 156
       {
164
-        name: "inspection.title",
165
-        displayName: "计划主题",
157
+        name: "sign",
158
+        displayName: "单号",
166 159
         width: "12%",
167 160
         minWidth: 120,
168 161
         enableFiltering: false,
169 162
       },
170 163
       {
171
-        name: "inspection.createUser.name",
172
-        displayName: "创建人",
173
-        width: "8%",
174
-        minWidth: 80,
164
+        name: "online",
165
+        displayName: "巡检分类",
166
+        width: "23%",
167
+        minWidth: 200,
175 168
         enableFiltering: false,
169
+        cellTemplate:
170
+          "<div>" +
171
+          '<div class="ui-grid-cell-contents">{{row.entity.online?"线上巡检-":(row.entity.online===false?"线下巡检-":"")}}{{row.entity.inspectionType.type}}</div>' +
172
+          "</div>",
176 173
       },
174
+      // {
175
+      //   name: "inspection.createUser.name",
176
+      //   displayName: "创建人",
177
+      //   width: "8%",
178
+      //   minWidth: 80,
179
+      //   enableFiltering: false,
180
+      // },
177 181
       {
178 182
         name: "stateName",
179 183
         displayName: "状态",
@@ -183,10 +187,14 @@ app.controller("inspectListCtrl", [
183 187
       },
184 188
       {
185 189
         name: "processUser.name",
186
-        displayName: "处理人",
190
+        displayName: "处理人/组",
187 191
         width: "8%",
188 192
         minWidth: 80,
189 193
         enableFiltering: false,
194
+        cellTemplate: '<div>' +
195
+                '<div class="ui-grid-cell-contents" ng-if="row.entity.processUser">{{row.entity.processUser.name}}</div>' +
196
+                '<div class="ui-grid-cell-contents" ng-if="row.entity.group">{{row.entity.group.groupName}}</div>' +
197
+                '</div>'
190 198
       },
191 199
       {
192 200
         name: "startDate",
@@ -196,18 +204,18 @@ app.controller("inspectListCtrl", [
196 204
         enableFiltering: false,
197 205
         cellTemplate:
198 206
           "<div>" +
199
-          '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.startDate)}}</div>' +
207
+          '<div class="ui-grid-cell-contents">{{row.entity.startDate?grid.appScope.transferTime(row.entity.startDate):""}}</div>' +
200 208
           "</div>",
201 209
       },
202 210
       {
203
-        name: "overdueTime",
204
-        displayName: "逾期时间",
211
+        name: "endTime",
212
+        displayName: "结束时间",
205 213
         width: "15%",
206 214
         width: 160,
207 215
         enableFiltering: false,
208 216
         cellTemplate:
209 217
           "<div>" +
210
-          '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.overdueTime)}}</div>' +
218
+          '<div class="ui-grid-cell-contents">{{row.entity.endTime?grid.appScope.transferTime(row.entity.endTime):""}}</div>' +
211 219
           "</div>",
212 220
       },
213 221
       {
@@ -233,10 +241,21 @@ app.controller("inspectListCtrl", [
233 241
       return moment(time).format("YYYY-MM-DD HH:mm");
234 242
     };
235 243
     $scope.showChuli = function (data) {
236
-      if (data.processUser.id == loginUser.id && data.stateName == "执行中") {
237
-        return true;
238
-      } else {
239
-        return false;
244
+      if(data.inspection.dictionary.value == 1){
245
+        // 按巡检人员
246
+        if (data.processUser.id == loginUser.id && data.stateName == "执行中") {
247
+          return true;
248
+        } else {
249
+          return false;
250
+        }
251
+      }else if(data.inspection.dictionary.value == 3){
252
+        // 按工作组
253
+        var hasGroup = loginUser.group.some(v=>v.id == data.group.id);
254
+        if (hasGroup && data.stateName == "执行中") {
255
+          return true;
256
+        } else {
257
+          return false;
258
+        }
240 259
       }
241 260
     };
242 261
     $scope.selectRowFunction = function (data) {

+ 58 - 33
assets/js/controllers/inspect/inspectPlanCtrl.js

@@ -100,52 +100,61 @@ app.controller('inspectPlanCtrl', ["$rootScope", "$scope", "$state", "$timeout",
100 100
             width: '10%',
101 101
             enableFiltering: true
102 102
         },
103
-        // {
104
-        //     name: 'inspectionType.type',
105
-        //     displayName: '巡检类型',
106
-        //     width: '109',
107
-        //     enableFiltering: false
108
-        // },
103
+        
109 104
         {
110
-            name: 'status.name',
111
-            displayName: '状态',
112
-            width: '6%',
105
+            name: 'planStrategy.name',
106
+            displayName: '执行策略',
107
+            width: '10%',
113 108
             enableFiltering: false
114 109
         },
115
-
116 110
         {
117
-            name: 'executeUser.name',
118
-            displayName: '执行人',
119
-            width: '11%',
111
+            name: 'planStartTime',
112
+            displayName: '计划开始时间',
113
+            width: '140',
120 114
             enableFiltering: false,
121
-            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.executeUser.name || "当前值班人" }}</div>'
115
+            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.planStartTime.length>16?grid.appScope.transferTime(row.entity.planStartTime):row.entity.planStartTime}}</div>'
122 116
         },
123 117
         {
124
-            name: 'planStrategy.name',
125
-            displayName: '执行策略',
126
-            width: '10%',
118
+            name: 'planEndTime',
119
+            displayName: '计划结束时间',
120
+            width: '140',
121
+            enableFiltering: false,
122
+            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.planEndTime.length>16?grid.appScope.transferTime(row.entity.planEndTime):row.entity.planEndTime}}</div>'
123
+        },
124
+        {
125
+            name: 'dictionary.name',
126
+            displayName: '巡检类型',
127
+            width: '109',
127 128
             enableFiltering: false
128 129
         },
129 130
         {
130
-            name: 'excutionDate',
131
-            displayName: '执行时间',
132
-            width: '140',
131
+            name: 'executeUser.name',
132
+            displayName: '执行人/组',
133
+            width: '11%',
133 134
             enableFiltering: false,
134
-            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.excutionDate.length>16?grid.appScope.transferTime(row.entity.excutionDate):row.entity.excutionDate}}</div>'
135
+            cellTemplate: '<div class="ui-grid-cell-contents"><span ng-if="row.entity.dictionary.value == 1&&row.entity.executeUser">{{row.entity.executeUser.name }}</span><span ng-if="row.entity.dictionary.value == 3&&row.entity.group">{{row.entity.group.groupName }}</span><span ng-if="row.entity.dictionary.value == 4">无</span></div>'
135 136
         },
136 137
         {
137
-            name: 'executionTime',
138
-            displayName: '执行时长',
139
-            width: '10%',
140
-            enableFiltering: false,
141
-            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.executionTime + "分钟"}}</div>'
138
+            name: 'status.name',
139
+            displayName: '状态',
140
+            width: '6%',
141
+            enableFiltering: false
142 142
         },
143
+        // {
144
+        //     name: 'executionTime',
145
+        //     displayName: '执行时长',
146
+        //     width: '10%',
147
+        //     enableFiltering: false,
148
+        //     cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.executionTime + "分钟"}}</div>'
149
+        // },
143 150
         {
144 151
             name: 'executionTime1',
145 152
             displayName: '当前批次进度',
146 153
             width: '12%',
147 154
             enableFiltering: false,
148
-            cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.completed + "/" + (row.entity.doing + row.entity.completed)}}</div>'
155
+            cellTemplate: `<div class="ui-grid-cell-contents" title="{{row.entity.percent}}%">
156
+            <progressbar value="row.entity.percent" type="success">{{row.entity.percent}}%</progressbar>
157
+            </div>`
149 158
         },
150 159
         {
151 160
             name: 'batchNoDesc',
@@ -153,12 +162,12 @@ app.controller('inspectPlanCtrl', ["$rootScope", "$scope", "$state", "$timeout",
153 162
             width: '15%',
154 163
             enableFiltering: false
155 164
         },
156
-        {
157
-            name: 'createUser.name',
158
-            displayName: '创建人',
159
-            width: '8%',
160
-            enableFiltering: false
161
-        },
165
+        // {
166
+        //     name: 'createUser.name',
167
+        //     displayName: '创建人',
168
+        //     width: '8%',
169
+        //     enableFiltering: false
170
+        // },
162 171
         // { name: 'createTime', displayName: '创建时间', width: '12%', enableFiltering: false },
163 172
         {
164 173
             minWidth: '230',
@@ -598,7 +607,15 @@ app.controller('inspectPlanCtrl', ["$rootScope", "$scope", "$state", "$timeout",
598 607
                 $scope.myData = myData.list;
599 608
                 for (var i = 0; i < $scope.myData.length; i++) {
600 609
                     $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
610
+                    if($scope.myData[i].doing + $scope.myData[i].completed != 0){
611
+                        $scope.myData[i].percent = ($scope.myData[i].completed*100/($scope.myData[i].doing + $scope.myData[i].completed)).toFixed(1);
612
+                    }else if($scope.myData[i].completed == 0){
613
+                        $scope.myData[i].percent = '0.0';
614
+                    }else{
615
+                        $scope.myData[i].percent = '0.0';
616
+                    }
601 617
                 }
618
+                console.log($scope.myData)
602 619
                 for (var i = 0; i < $scope.myData.length; i++) {
603 620
                     if ($scope.myData[i].status == "正常") {
604 621
                         $scope.myData[i].style = "fa fa-play";
@@ -635,7 +652,15 @@ app.controller('inspectPlanCtrl', ["$rootScope", "$scope", "$state", "$timeout",
635 652
                 $scope.myData = myData.list;
636 653
                 for (var i = 0; i < $scope.myData.length; i++) {
637 654
                     $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
655
+                    if($scope.myData[i].doing + $scope.myData[i].completed != 0){
656
+                        $scope.myData[i].percent = ($scope.myData[i].completed*100/($scope.myData[i].doing + $scope.myData[i].completed)).toFixed(1);
657
+                    }else if($scope.myData[i].completed == 0){
658
+                        $scope.myData[i].percent = '0.0';
659
+                    }else{
660
+                        $scope.myData[i].percent = '0.0';
661
+                    }
638 662
                 }
663
+                console.log($scope.myData)
639 664
                 for (var i = 0; i < $scope.myData.length; i++) {
640 665
                     if ($scope.myData[i].status == "正常") {
641 666
                         $scope.myData[i].style = "fa fa-play";

+ 104 - 17
assets/js/controllers/system/processdesign/incidentplan/incidentSetUpCtrl.js

@@ -16,6 +16,7 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
16 16
    }
17 17
     $scope.listData=[
18 18
         {"name":"事件分类"},
19
+        {"name":"巡检范围"},
19 20
         {"name":"事件紧急度"},
20 21
         {"name":"事件影响度"},
21 22
         {"name":"事件优先级"},
@@ -115,7 +116,7 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
115 116
             $scope.subdata.hasPlace=false
116 117
         }
117 118
         
118
-        convertchildToTree(branch);
119
+        convertchildToTree(branch,'事件分类');
119 120
         console.log(branch)
120 121
         if(branch.managerUser){
121 122
             $scope.subdata.managerUser = branch.managerUser
@@ -156,6 +157,67 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
156 157
         }        
157 158
 
158 159
     };
160
+    // $scope.thisParent1={};//当前点击节点的父节点
161
+    // $scope.userOrGroupType1={};//当前节点运维组/运维人员
162
+    $scope.dataSave1 = [];//储存$scope.tree_data
163
+    $scope.my_tree_1handler = function(branch) {
164
+        console.log($scope.dataSave1)
165
+        if($scope.dataSave1.length === 0){
166
+            $scope.dataSave1 = angular.copy($scope.tree_1data);
167
+        }
168
+        console.log(branch)
169
+        if(branch.parent){
170
+            $scope.tree_1data = $scope.filterTree($scope.dataSave1,branch.id);
171
+            console.log($scope.tree_1data,'过滤后');
172
+        }
173
+
174
+        $scope.changecate = true;
175
+        $scope.addcate = false;
176
+        filterData.treeIds = branch.id;
177
+        $scope.selectedTreeNode = branch;
178
+        $scope.output = branch;
179
+        $scope.thisParent=branch.parent||null;
180
+        if($scope.thisParent){
181
+             $scope.thisParent.label=$scope.thisParent.type;
182
+             $scope.thisParent.isExpanded=true;
183
+             $scope.thisParent.selected=true;
184
+             $scope.subdata['parent']=$scope.thisParent
185
+        };
186
+        convertchildToTree(branch,'巡检范围');//2022年5月27日,暂存,明明
187
+        console.log(branch)
188
+        if(branch.managerUser){
189
+            $scope.subdata.managerUser = branch.managerUser
190
+        }
191
+        if(branch.userOrGroupType){
192
+            $scope.userOrGroupType['type']=branch.userOrGroupType;
193
+            $scope.userGroupChecked['groupCheck']=branch.group||{};
194
+            $scope.userGroupChecked['userCheck']=branch.handleUser||{};
195
+        }else{
196
+            $scope.userOrGroupType['type']=0;
197
+            $scope.userGroupChecked={}
198
+        }
199
+        $scope.subdata.category=branch.label;
200
+        var eqflag = false;
201
+        angular.forEach($scope.outdata, function(item) {
202
+            if (item.id == $scope.output.id) eqflag = true;
203
+        });
204
+        if (eqflag) {
205
+
206
+        } else {
207
+            $scope.outdata.push({
208
+                'name': $scope.output.label,
209
+                'id': $scope.output.id
210
+            });
211
+            var postData = {
212
+                typeList: []
213
+            };
214
+            if ($scope.outdata.length > 0) {
215
+                angular.forEach($scope.outdata, function(data) {
216
+                    postData.typeList.push({ id: data.id });
217
+                })
218
+            }
219
+        }        
220
+    };
159 221
    
160 222
     $scope.addType = function(element) {
161 223
             $scope.tree_data = $scope.dataSave.length?angular.copy($scope.dataSave):$scope.tree_data;
@@ -229,14 +291,21 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
229 291
         }
230 292
         /* -----end remove incidet category----- */
231 293
 
232
-    function convertchildToTree(datum) {
294
+    function convertchildToTree(datum,type) {
233 295
         $scope.subdata = {};
234
-        if (datum.parent) {
235
-            $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasPlace': datum.hasPlace, 'hasSimple': datum.hasSimple, 'priority': datum.priority, 'complexity': datum.complexity,  'parent': datum.parent }
236
-        } else {
237
-            $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasSimple': datum.hasSimple, 'hasPlace': datum.hasPlace, 'priority': datum.priority, 'complexity': datum.complexity }
296
+        if(type === '事件分类'){
297
+            if (datum.parent) {
298
+                $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasPlace': datum.hasPlace, 'hasSimple': datum.hasSimple, 'priority': datum.priority, 'complexity': datum.complexity,  'parent': datum.parent }
299
+            } else {
300
+                $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasSimple': datum.hasSimple, 'hasPlace': datum.hasPlace, 'priority': datum.priority, 'complexity': datum.complexity }
301
+            }
302
+        }else if(type === '巡检范围'){
303
+            if (datum.parent) {
304
+                $scope.subdata = { 'id': datum.id, 'type': datum.label, 'parent': datum.parent }
305
+            } else {
306
+                $scope.subdata = { 'id': datum.id, 'type': datum.label }
307
+            }
238 308
         }
239
-
240 309
     }
241 310
 
242 311
 
@@ -297,15 +366,16 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
297 366
 
298 367
 
299 368
 
300
-    $scope.parentdata = {};
369
+    // $scope.parentdata = {};
301 370
     $scope.try_async_load = function() {
302 371
         $scope.my_data = [];
372
+        
303 373
         $scope.doing_async = true;
304 374
         var data = { "idx": 0, "sum": 1000 };
305 375
         api_bpm_data.fetchDataList('incidentcategory', data).then(function(response) {
306 376
             var data = response.list;
307 377
             var objects = [];
308
-            $scope.parentdata = data;
378
+            // $scope.parentdata = data;
309 379
             for (var i = 0; i < data.length; i++) {
310 380
                 var object = {};
311 381
                 object.id = data[i].id;
@@ -337,20 +407,12 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
337 407
                     object.managerUser=data[i].managerUser||{};
338 408
                 }
339 409
                 object.label = data[i].category;
340
-                // object.actions = data[i][3]; //权限部分
341
-                // object.group = "1";
342
-                // object.user = "2";
343 410
                 object.state = {
344 411
                     "opened": true
345 412
                 };
346 413
                 object.typeName = "type";
347
-                // if()
348
-                // if (object.actions.indexOf("2") >= 0) { //知识库类型 具有增加权限--系统管理员
349 414
                 $scope.showAddSolutionType = true;
350
-                // }
351
-                // if (object.actions.indexOf("5") >= 0) { //知识库类型 具有授权权限--系统管理员
352 415
                 $scope.showReviewKnowledgeType = true;
353
-                // }
354 416
                 objects.push(object);
355 417
             }
356 418
             $scope.my_data = convertParentToChildList(objects);
@@ -360,6 +422,30 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
360 422
             }
361 423
         });
362 424
     };
425
+    $scope.try_async_1load = function() {
426
+        $scope.my_1data = [];
427
+        
428
+        $scope.doing_async = true;
429
+        var data = { "idx": 0, "sum": 1000 };
430
+        api_bpm_data.fetchDataList('inspectionType', data).then(function(response) {
431
+            var data = response.list;
432
+            var objects = [];
433
+            for (var i = 0; i < data.length; i++) {
434
+                var object = {};
435
+                object.id = data[i].id;
436
+                if (angular.isDefined(data[i].parent)) {
437
+                    object.parent = data[i].parent;
438
+                }
439
+                object.label = data[i].type;
440
+                objects.push(object);
441
+            }
442
+            $scope.my_1data = convertParentToChildList(objects);
443
+            $scope.tree_1data = angular.copy($scope.my_1data);
444
+            if ($scope.my_1data.length > 0) {
445
+                $scope.doing_async = false;
446
+            }
447
+        });
448
+    };
363 449
     $scope.closethis = function(formdata) {
364 450
         formdata.category = "";
365 451
         formdata.parent.category = "";
@@ -528,6 +614,7 @@ app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "
528 614
     };
529 615
     /* -----end submit incidet category----- */
530 616
     $scope.try_async_load();
617
+    $scope.try_async_1load();
531 618
 
532 619
     // $scope.ldloading={};
533 620
 

+ 1 - 1
assets/views/inspect/inspectPlan.html

@@ -62,7 +62,7 @@
62 62
                             </div>
63 63
                         </div>
64 64
                         <div class="form-group incidentsearch ">
65
-                            <div class=" pull-left" style="padding-top:4px">巡检类型:</div>
65
+                            <div class=" pull-left" style="padding-top:4px">巡检范围:</div>
66 66
                             <div class="pull-right iptSize" style="display:inline">
67 67
                                 <div>
68 68
                                     <multi-select-tree ng-model="inspecttype.type" data-input-model="my_data"

+ 157 - 0
assets/views/system/processdesign/incidentplan/incidentSetUp.html

@@ -471,6 +471,7 @@
471 471
         <div class="col-xs-9">
472 472
             <div class="fonsize">事件设置>{{leftListName}}</div>
473 473
             <div class="rightBox">
474
+                
474 475
                 <!-- 事件分类开始 -->
475 476
                 <div ng-if="leftListName=='事件分类'">
476 477
                     <div class="mainDiv">
@@ -831,6 +832,162 @@
831 832
                     </div>   
832 833
                 </div>
833 834
                 <!-- 事件分类结束 -->
835
+                <!-- 巡检范围开始 -->
836
+                <div ng-if="leftListName=='巡检范围'">
837
+                    <div class="mainDiv">
838
+                        
839
+                        <!-- 谁固定谁在前 -->
840
+                
841
+                        <div class="mainDivLeft">
842
+                            <div class="mainDiv-head">
843
+                                <span>服务目录</span>
844
+                                <div class="mainDiv-head-right">
845
+                                    <div class="btn btn_search" ng-click="addType(output)" ng-show="xinzeng">新增</div>
846
+                                    <div class="btn btn_remove" ng-class="isMousedown?'btn_removeMousedown':''" ng-mousedown="changeRemoveClass()" ng-click="remove(output)" ng-show="shanchu">删除</div>
847
+                                </div>
848
+                            </div>
849
+                            <div class="mainDiv-body fixHeight">
850
+                                <div class="box-tree">
851
+                                    <span ng-if="doing_async">...加载中...</span>
852
+                                    <abn-tree tree-data="my_1data" tree-control="my_tree" on-select="my_tree_1handler(branch)" expand-level="2" icon-leaf="iconfont icon-fenlei" icon-expand="ti-plus" icon-collapse="ti-minus"></abn-tree>
853
+                                </div>
854
+                            </div>
855
+                        </div>
856
+                
857
+                        <div class="mainDivRight" ng-if="changecate">
858
+                            <div class="mainDiv-head">
859
+                                <span>服务目录修改</span>
860
+                            </div>
861
+                            <div class="mainDiv-body">
862
+                                <div class="tab-mainDiv-body-lineDiv-50">
863
+                                    <div class="tab-mainDiv-body-lable">
864
+                                        服务目录名称:
865
+                                    </div>
866
+                                    <div class="tab-mainDiv-body-content">
867
+                                        <input class="form-control" ng-model="subdata.category" placeholder="服务目录名称..." />
868
+                                    </div>
869
+                                </div>
870
+                                <div class="tab-mainDiv-body-lineDiv-50" ng-if="thisParent">
871
+                                    <div class="tab-mainDiv-body-lable">
872
+                                        父类:
873
+                                    </div>
874
+                                    <div class="tab-mainDiv-body-content">
875
+                                        <multi-select-tree ng-model="subdata.parent" data-input-model="tree_data" data-output-model="subdata.parent" theme="bootstrap" multi-select="false" data-default-label="{{thisParent.category}}" data-callback="onFilterCallback(item)" data-select-only-leafs="false" data-trans-label="label"
876
+                                            data-switch-view="false"></multi-select-tree>
877
+                                    </div>
878
+                                </div>
879
+                                <div class="tab-mainDiv-body-lineDiv-50">
880
+                                    <div class="tab-mainDiv-body-lable">线下巡检默认组:</div>
881
+                                    <ui-select class="tab-mainDiv-body-content" ng-model="userGroupChecked.groupCheck"
882
+                                        theme="bootstrap">
883
+                                        <ui-select-match placeholder="">
884
+                                            {{$select.selected.groupName}}
885
+                                        </ui-select-match>
886
+                                        <ui-select-choices repeat="item in groupList | filter: $select.search">
887
+                                            <div ng-bind-html="item.groupName | highlight: $select.search"></div>
888
+                                        </ui-select-choices>
889
+                                    </ui-select>
890
+                                </div>
891
+                                <div class="tab-mainDiv-body-lineDiv-50">
892
+                                    <div class="tab-mainDiv-body-lable">线上巡检默认人:</div>
893
+                                    <ui-select class="tab-mainDiv-body-content" ng-model="userGroupChecked.userCheck"
894
+                                        theme="bootstrap">
895
+                                        <ui-select-match placeholder="">
896
+                                            {{$select.selected.name}}
897
+                                        </ui-select-match>
898
+                                        <ui-select-choices repeat="item in userList | filter: $select.search">
899
+                                            <div ng-bind-html="item.name | highlight: $select.search"></div>
900
+                                        </ui-select-choices>
901
+                                    </ui-select>
902
+                                </div>
903
+                            </div>
904
+                            <div class="tab-mainDiv-foot">
905
+                                <div class="btn btn_search" ng-click="submitchange(subdata)" ng-show="bianji">
906
+                                    确认
907
+                                </div>
908
+                            </div>
909
+                        </div>
910
+                
911
+                        <div class="mainDivRight" ng-if="addcate">
912
+                            <div class="mainDiv-head">
913
+                                <span>服务目录新增</span>
914
+                            </div>
915
+                            <div class="mainDiv-body">
916
+                                <div class="tab-mainDiv-body-lineDiv-50">
917
+                                    <div class="tab-mainDiv-body-lable">
918
+                                        服务目录名称:
919
+                                    </div>
920
+                                    <div class="tab-mainDiv-body-content">
921
+                                        <input class="form-control" ng-model="adddata.category" placeholder="服务目录名称..." />
922
+                                    </div>
923
+                                </div>
924
+                                <div class="tab-mainDiv-body-lineDiv-50">
925
+                                    <div class="tab-mainDiv-body-lable">
926
+                                        是否有父类:
927
+                                    </div>
928
+                                    <div class="tab-mainDiv-body-content">
929
+                                        <switch ng-model="addparent" class="green"></switch>
930
+                                    </div>
931
+                                </div>
932
+                                <div class="tab-mainDiv-body-lineDiv-50" ng-if="addparent">
933
+                                    <div class="tab-mainDiv-body-lable">
934
+                                        父类:
935
+                                    </div>
936
+                                    <div class="tab-mainDiv-body-content">
937
+                                        <multi-select-tree ng-model="adddata.parent" data-input-model="tree_data" data-output-model="adddata.parent" theme="bootstrap" multi-select="false" data-default-label="服务目录" data-callback="onFilterCallback(item)" data-select-only-leafs="false" data-trans-label="label"
938
+                                            data-switch-view="false"></multi-select-tree>
939
+                                    </div>
940
+                                </div>
941
+                                <div class="tab-mainDiv-body-lineDiv-50">
942
+                                    <div class="tab-mainDiv-body-lable">线下巡检默认组:</div>
943
+                                    <ui-select class="tab-mainDiv-body-content" ng-model="userGroupCheckedAdd.groupCheck"
944
+                                        theme="bootstrap">
945
+                                        <ui-select-match placeholder="">
946
+                                            {{$select.selected.groupName}}
947
+                                        </ui-select-match>
948
+                                        <ui-select-choices repeat="item in groupList | filter: $select.search">
949
+                                            <div ng-bind-html="item.groupName | highlight: $select.search"></div>
950
+                                        </ui-select-choices>
951
+                                    </ui-select>
952
+                                </div>
953
+                                <div class="tab-mainDiv-body-lineDiv-50">
954
+                                    <div class="tab-mainDiv-body-lable">线上巡检默认人:</div>
955
+                                    <ui-select class="tab-mainDiv-body-content" ng-model="userGroupCheckedAdd.userCheck"
956
+                                        theme="bootstrap">
957
+                                        <ui-select-match placeholder="">
958
+                                            {{$select.selected.name}}
959
+                                        </ui-select-match>
960
+                                        <ui-select-choices repeat="item in userList | filter: $select.search">
961
+                                            <div ng-bind-html="item.name | highlight: $select.search"></div>
962
+                                        </ui-select-choices>
963
+                                    </ui-select>
964
+                                </div>
965
+                            </div>
966
+                            <div class="tab-mainDiv-foot">
967
+                                <div class="btn btn_search" ng-click="submitadd(adddata,addparent)">
968
+                                    确认
969
+                                </div>
970
+                                <div class="btn btn_clean" ng-click="closethis(addcategory)">
971
+                                    取消
972
+                                </div>
973
+                            </div>
974
+                        </div>
975
+                
976
+                        <div class="mainDivRight" ng-if="addcate==''&&changecate==''">
977
+                            <!-- <div class="mainDivRight"> -->
978
+                            <div class="mainDiv-head">
979
+                                <span>操作提示</span>
980
+                            </div>
981
+                            <div class="mainDiv-body">
982
+                                <div class="mainDiv-body-noList">
983
+                                    <img src="./assets/images/place/icon_quesheng.png" alt="">
984
+                                    <p class="handlefont">请选择服务目录</p>
985
+                                </div>
986
+                            </div>
987
+                        </div>
988
+                    </div>   
989
+                </div>
990
+                <!-- 巡检范围结束 -->
834 991
                 <!-- 事件紧急度开始 -->
835 992
                 <div ng-if="leftListName=='事件紧急度'">
836 993
                     <div class="col-xs-4">