Browse Source

事件新增院区

seimin 2 years ago
parent
commit
2e94e778db

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

@@ -11070,10 +11070,24 @@ appFormly.config(function config(formlyConfigProvider) {
11070
                 // }
11070
                 // }
11071
                 scope.$parent.$parent.$parent.model.incident.houseNumber =
11071
                 scope.$parent.$parent.$parent.model.incident.houseNumber =
11072
                   selectedItem.houseNumber ? selectedItem.houseNumber : "";
11072
                   selectedItem.houseNumber ? selectedItem.houseNumber : "";
11073
+                scope.$parent.$parent.$parent.model.incident.branch.id =
11074
+                  selectedItem.branch ? selectedItem.branch.id : null;
11073
                 scope.$parent.$parent.$parent.model.incident.area.id =
11075
                 scope.$parent.$parent.$parent.model.incident.area.id =
11074
                   selectedItem.place ? selectedItem.place.area.id : null;
11076
                   selectedItem.place ? selectedItem.place.area.id : null;
11075
                 scope.$parent.$parent.$parent.model.incident.place.id =
11077
                 scope.$parent.$parent.$parent.model.incident.place.id =
11076
                   selectedItem.place ? selectedItem.place.id : null;
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
                 if(scope.$parent.$parent.$parent.model.incident.area.id){
11091
                 if(scope.$parent.$parent.$parent.model.incident.area.id){
11078
                   options.templateOptions.APIService.fetchDataList(
11092
                   options.templateOptions.APIService.fetchDataList(
11079
                     'place',
11093
                     'place',

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

@@ -82,8 +82,21 @@ appFormly.controller('CustomformDetailCtrl', ['$scope', 'i18nService', '$rootSco
82
                 if (field.templateOptions.modelreasondata) {
82
                 if (field.templateOptions.modelreasondata) {
83
                     datakey = field.templateOptions.modelreasondata
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
                 if (field.templateOptions.modelPlace) {
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
                 process.customPOST(datakey, field.templateOptions.optionsUrl).then(function(result) {
102
                 process.customPOST(datakey, field.templateOptions.optionsUrl).then(function(result) {
@@ -508,6 +521,9 @@ appFormly.controller('CustomformDetailCtrl', ['$scope', 'i18nService', '$rootSco
508
                     if (responseData) {
521
                     if (responseData) {
509
                         var vmForm = Restangular.stripRestangular(responseData);
522
                         var vmForm = Restangular.stripRestangular(responseData);
510
                         if (vmForm) {
523
                         if (vmForm) {
524
+                            if(vmForm.model.incident && vmForm.model.incident.place){
525
+                                vmForm.model.incident.area = vmForm.model.incident.place.area;
526
+                            }
511
                             var modelData = {};
527
                             var modelData = {};
512
                             modelData[pdKey] = vmForm.model;
528
                             modelData[pdKey] = vmForm.model;
513
                             decodeVMForm(vmForm, modelData);
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
                 name: 'requester.account',
237
                 name: 'requester.account',
238
                 displayName: '学工号',
238
                 displayName: '学工号',
239
-                width: '6%',
240
-                minWidth: '90',
239
+                width: '120',
241
                 enableSorting: false,
240
                 enableSorting: false,
242
                 cellTemplate: '<div>' +
241
                 cellTemplate: '<div>' +
243
                     '<div class="ui-grid-cell-contents" >{{row.entity.requester.account}}</div>' +
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
                 name: 'contactsInformation',
246
                 name: 'contactsInformation',
248
                 displayName: '联系电话',
247
                 displayName: '联系电话',
249
-                width: '105',
248
+                width: '120',
250
                 cellTemplate: '<div>' +
249
                 cellTemplate: '<div>' +
251
                     '<div class="ui-grid-cell-contents">{{row.entity.contactsInformation}}</div>' +
250
                     '<div class="ui-grid-cell-contents">{{row.entity.contactsInformation}}</div>' +
252
                     '</div>'
251
                     '</div>'
@@ -254,7 +253,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
254
             {
253
             {
255
                 name: 'category',
254
                 name: 'category',
256
                 displayName: '事件分类',
255
                 displayName: '事件分类',
257
-                width: '10%',
256
+                width: '300',
258
                 enableSorting: false,
257
                 enableSorting: false,
259
                 cellTemplate: '<div>' +
258
                 cellTemplate: '<div>' +
260
                     '<div class="ui-grid-cell-contents">{{row.entity.category.category}}</div>' +
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
                 name: 'houseNumber',
263
                 name: 'houseNumber',
265
-                displayName: '区域地点',
264
+                displayName: '校区区域地点',
266
                 width: '14%',
265
                 width: '14%',
267
                 enableFiltering: false,
266
                 enableFiltering: false,
268
                 cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.areaplace(row.entity)}}</div></div>'
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
         // if (data.area && data.place) {
1069
         // if (data.area && data.place) {
1071
         //     if (data.houseNumber) {
1070
         //     if (data.houseNumber) {
1072
         var str = '  ';
1071
         var str = '  ';
1072
+        str += '  ' + (data.branch ? data.branch.hosName : '  ');
1073
         str += '  ' + (data.place ? (data.place.area ? data.place.area.area : '  ') : '  ');
1073
         str += '  ' + (data.place ? (data.place.area ? data.place.area.area : '  ') : '  ');
1074
         str += '  ' + (data.place ? (data.place.place ? data.place.place : '  ') : '  ');
1074
         str += '  ' + (data.place ? (data.place.place ? data.place.place : '  ') : '  ');
1075
         str += '  ' + (data.houseNumber ? data.houseNumber : '  ');
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
             name: 'dept.dept',
82
             name: 'dept.dept',
83
             displayName: '科室',
83
             displayName: '科室',
84
-            width: '12%',
84
+            width: '10%',
85
             enableFiltering: false
85
             enableFiltering: false
86
         },
86
         },
87
         {
87
         {
88
             name: 'requesterType.name',
88
             name: 'requesterType.name',
89
             displayName: '职务',
89
             displayName: '职务',
90
-            width: '10%',
90
+            width: '8%',
91
             enableFiltering: false
91
             enableFiltering: false
92
         },
92
         },
93
         {
93
         {
94
             name: 'mphone',
94
             name: 'mphone',
95
             displayName: '电话',
95
             displayName: '电话',
96
-            width: '12%',
96
+            width: '8%',
97
             minWidth: '125',
97
             minWidth: '125',
98
             enableFiltering: false
98
             enableFiltering: false
99
         },
99
         },
100
         {
100
         {
101
+            name: 'branch.hosName',
102
+            displayName: '校区',
103
+            width: '10%',
104
+            enableFiltering: false
105
+        },
106
+        {
101
             name: 'place.area.area',
107
             name: 'place.area.area',
102
             displayName: '区域',
108
             displayName: '区域',
103
             width: '10%',
109
             width: '10%',
@@ -106,7 +112,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
106
         {
112
         {
107
             name: 'place.place',
113
             name: 'place.place',
108
             displayName: '地点',
114
             displayName: '地点',
109
-            width: '12%',
115
+            width: '10%',
110
             enableFiltering: false
116
             enableFiltering: false
111
         },
117
         },
112
         {
118
         {
@@ -312,6 +318,7 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
312
                         "deptName": data.deptName,
318
                         "deptName": data.deptName,
313
                         "telephone": data.telephone,
319
                         "telephone": data.telephone,
314
                         "dept": data.dept,
320
                         "dept": data.dept,
321
+                        "branch": data.branch,
315
                         "area": data.place.area,
322
                         "area": data.place.area,
316
                         "place": data.place,
323
                         "place": data.place,
317
                         "studentNo": data.studentNo,
324
                         "studentNo": data.studentNo,
@@ -334,8 +341,9 @@ app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$sta
334
                         "deptName": data.deptName,
341
                         "deptName": data.deptName,
335
                         "telephone": data.telephone,
342
                         "telephone": data.telephone,
336
                         "dept": data.dept,
343
                         "dept": data.dept,
344
+                        "branch": data.branch,
337
                         // "area": data.place.area,
345
                         // "area": data.place.area,
338
-                        "place": data.place,
346
+                        // "place": data.place,
339
                         "studentNo": data.studentNo,
347
                         "studentNo": data.studentNo,
340
                         "houseNumber": data.houseNumber,
348
                         "houseNumber": data.houseNumber,
341
                         "requesterTypeDTO": data.requesterTypeDTO,
349
                         "requesterTypeDTO": data.requesterTypeDTO,