Parcourir la source

事件新增院区

seimin il y a 2 ans
Parent
commit
2e94e778db

+ 14 - 0
assets/js/controllers/customform/customformCtrl.js

@@ -11070,10 +11070,24 @@ appFormly.config(function config(formlyConfigProvider) {
11070 11070
                 // }
11071 11071
                 scope.$parent.$parent.$parent.model.incident.houseNumber =
11072 11072
                   selectedItem.houseNumber ? selectedItem.houseNumber : "";
11073
+                scope.$parent.$parent.$parent.model.incident.branch.id =
11074
+                  selectedItem.branch ? selectedItem.branch.id : null;
11073 11075
                 scope.$parent.$parent.$parent.model.incident.area.id =
11074 11076
                   selectedItem.place ? selectedItem.place.area.id : null;
11075 11077
                 scope.$parent.$parent.$parent.model.incident.place.id =
11076 11078
                   selectedItem.place ? selectedItem.place.id : null;
11079
+                  if(scope.$parent.$parent.$parent.model.incident.branch.id){
11080
+                    options.templateOptions.APIService.fetchDataList(
11081
+                      'area',
11082
+                      {"area":{"branch":scope.$parent.$parent.$parent.model.incident.branch.id},"idx":0,"sum":1000}
11083
+                    ).then(function (response1) {
11084
+                        for (var i = 0; i < scope.fields.length; i++) {
11085
+                          if(scope.fields[i].templateOptions.onlyKey == 'area_start'){
11086
+                            scope.fields[i].templateOptions.options = response1.status == 200?response1.list:[];
11087
+                          }
11088
+                        }
11089
+                    })
11090
+                  }
11077 11091
                 if(scope.$parent.$parent.$parent.model.incident.area.id){
11078 11092
                   options.templateOptions.APIService.fetchDataList(
11079 11093
                     'place',

+ 17 - 1
assets/js/controllers/customform/customformDetailCtrl.js

@@ -82,8 +82,21 @@ appFormly.controller('CustomformDetailCtrl', ['$scope', 'i18nService', '$rootSco
82 82
                 if (field.templateOptions.modelreasondata) {
83 83
                     datakey = field.templateOptions.modelreasondata
84 84
                 }
85
+                if (field.templateOptions.modelArea) {
86
+                    if(field.model.branch){
87
+                        datakey.area = {branch:field.model.branch}
88
+                    }else{
89
+                        field.templateOptions.options = [];
90
+                        return;
91
+                    }
92
+                }
85 93
                 if (field.templateOptions.modelPlace) {
86
-                    datakey.place = {areaId:field.model.area.id}
94
+                    if(field.model.area && field.model.area.id){
95
+                        datakey.place = {areaId:field.model.area.id}
96
+                    }else{
97
+                        field.templateOptions.options = [];
98
+                        return;
99
+                    }
87 100
                 }
88 101
 
89 102
                 process.customPOST(datakey, field.templateOptions.optionsUrl).then(function(result) {
@@ -508,6 +521,9 @@ appFormly.controller('CustomformDetailCtrl', ['$scope', 'i18nService', '$rootSco
508 521
                     if (responseData) {
509 522
                         var vmForm = Restangular.stripRestangular(responseData);
510 523
                         if (vmForm) {
524
+                            if(vmForm.model.incident && vmForm.model.incident.place){
525
+                                vmForm.model.incident.area = vmForm.model.incident.place.area;
526
+                            }
511 527
                             var modelData = {};
512 528
                             modelData[pdKey] = vmForm.model;
513 529
                             decodeVMForm(vmForm, modelData);

+ 5 - 5
assets/js/controllers/incident/incidentCtrl.js

@@ -236,8 +236,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
236 236
             {
237 237
                 name: 'requester.account',
238 238
                 displayName: '学工号',
239
-                width: '6%',
240
-                minWidth: '90',
239
+                width: '120',
241 240
                 enableSorting: false,
242 241
                 cellTemplate: '<div>' +
243 242
                     '<div class="ui-grid-cell-contents" >{{row.entity.requester.account}}</div>' +
@@ -246,7 +245,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
246 245
             {
247 246
                 name: 'contactsInformation',
248 247
                 displayName: '联系电话',
249
-                width: '105',
248
+                width: '120',
250 249
                 cellTemplate: '<div>' +
251 250
                     '<div class="ui-grid-cell-contents">{{row.entity.contactsInformation}}</div>' +
252 251
                     '</div>'
@@ -254,7 +253,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
254 253
             {
255 254
                 name: 'category',
256 255
                 displayName: '事件分类',
257
-                width: '10%',
256
+                width: '300',
258 257
                 enableSorting: false,
259 258
                 cellTemplate: '<div>' +
260 259
                     '<div class="ui-grid-cell-contents">{{row.entity.category.category}}</div>' +
@@ -262,7 +261,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
262 261
             },
263 262
             {
264 263
                 name: 'houseNumber',
265
-                displayName: '区域地点',
264
+                displayName: '校区区域地点',
266 265
                 width: '14%',
267 266
                 enableFiltering: false,
268 267
                 cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.areaplace(row.entity)}}</div></div>'
@@ -1070,6 +1069,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
1070 1069
         // if (data.area && data.place) {
1071 1070
         //     if (data.houseNumber) {
1072 1071
         var str = '  ';
1072
+        str += '  ' + (data.branch ? data.branch.hosName : '  ');
1073 1073
         str += '  ' + (data.place ? (data.place.area ? data.place.area.area : '  ') : '  ');
1074 1074
         str += '  ' + (data.place ? (data.place.place ? data.place.place : '  ') : '  ');
1075 1075
         str += '  ' + (data.houseNumber ? data.houseNumber : '  ');

+ 13 - 5
assets/js/controllers/system/user/adminrequesterCtrl.js

@@ -81,23 +81,29 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
81 81
         {
82 82
             name: 'dept.dept',
83 83
             displayName: '科室',
84
-            width: '12%',
84
+            width: '10%',
85 85
             enableFiltering: false
86 86
         },
87 87
         {
88 88
             name: 'requesterType.name',
89 89
             displayName: '职务',
90
-            width: '10%',
90
+            width: '8%',
91 91
             enableFiltering: false
92 92
         },
93 93
         {
94 94
             name: 'mphone',
95 95
             displayName: '电话',
96
-            width: '12%',
96
+            width: '8%',
97 97
             minWidth: '125',
98 98
             enableFiltering: false
99 99
         },
100 100
         {
101
+            name: 'branch.hosName',
102
+            displayName: '校区',
103
+            width: '10%',
104
+            enableFiltering: false
105
+        },
106
+        {
101 107
             name: 'place.area.area',
102 108
             displayName: '区域',
103 109
             width: '10%',
@@ -106,7 +112,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
106 112
         {
107 113
             name: 'place.place',
108 114
             displayName: '地点',
109
-            width: '12%',
115
+            width: '10%',
110 116
             enableFiltering: false
111 117
         },
112 118
         {
@@ -312,6 +318,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
312 318
                         "deptName": data.deptName,
313 319
                         "telephone": data.telephone,
314 320
                         "dept": data.dept,
321
+                        "branch": data.branch,
315 322
                         "area": data.place.area,
316 323
                         "place": data.place,
317 324
                         "studentNo": data.studentNo,
@@ -334,8 +341,9 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
334 341
                         "deptName": data.deptName,
335 342
                         "telephone": data.telephone,
336 343
                         "dept": data.dept,
344
+                        "branch": data.branch,
337 345
                         // "area": data.place.area,
338
-                        "place": data.place,
346
+                        // "place": data.place,
339 347
                         "studentNo": data.studentNo,
340 348
                         "houseNumber": data.houseNumber,
341 349
                         "requesterTypeDTO": data.requesterTypeDTO,