|
@@ -49,6 +49,7 @@ app.controller("summaryCtrl", [
|
49
|
49
|
$scope.shanchu = false;
|
50
|
50
|
$scope.shenhe = false;
|
51
|
51
|
$scope.summary_recalculate = false;
|
|
52
|
+ $scope.summary_incident = false;
|
52
|
53
|
for (var i = 0; i < loginUser.menu.length; i++) {
|
53
|
54
|
if (loginUser.menu[i].link == "summary_chakan") {
|
54
|
55
|
$scope.chakan = true;
|
|
@@ -62,6 +63,9 @@ app.controller("summaryCtrl", [
|
62
|
63
|
if (loginUser.menu[i].link == "summary_recalculate") {
|
63
|
64
|
$scope.summary_recalculate = true;
|
64
|
65
|
}
|
|
66
|
+ if (loginUser.menu[i].link == "summary_incident") {
|
|
67
|
+ $scope.summary_incident = true;
|
|
68
|
+ }
|
65
|
69
|
}
|
66
|
70
|
var defaultFilterData = {
|
67
|
71
|
idx: 0,
|
|
@@ -69,15 +73,15 @@ app.controller("summaryCtrl", [
|
69
|
73
|
repairSummary:{}
|
70
|
74
|
};
|
71
|
75
|
|
72
|
|
- var repairSummaryParameter = {
|
73
|
|
- idx: 0,
|
74
|
|
- sum: 10,
|
75
|
|
- operation: "",
|
76
|
|
- status: "",
|
77
|
|
- repairSummary: {},
|
78
|
|
- };
|
|
76
|
+ // var repairSummaryParameter = {
|
|
77
|
+ // idx: 0,
|
|
78
|
+ // sum: 10,
|
|
79
|
+ // operation: "",
|
|
80
|
+ // status: "",
|
|
81
|
+ // repairSummary: {},
|
|
82
|
+ // };
|
79
|
83
|
//本地存储
|
80
|
|
- sessionStorage.repairSummaryParameter = JSON.stringify(repairSummaryParameter);
|
|
84
|
+ // sessionStorage.repairSummaryParameter = JSON.stringify(repairSummaryParameter);
|
81
|
85
|
|
82
|
86
|
$scope.memoryfilterData = {
|
83
|
87
|
idx: 0,
|
|
@@ -88,6 +92,7 @@ app.controller("summaryCtrl", [
|
88
|
92
|
|
89
|
93
|
$scope.gridOptions = {};
|
90
|
94
|
$scope.gridOptions.data = "myData";
|
|
95
|
+ $scope.gridOptions.rowHeight = 54;
|
91
|
96
|
$scope.gridOptions.enableColumnResizing = true;
|
92
|
97
|
$scope.gridOptions.enableFiltering = false;
|
93
|
98
|
$scope.gridOptions.enableGridMenu = true;
|
|
@@ -172,23 +177,30 @@ app.controller("summaryCtrl", [
|
172
|
177
|
width: 50,
|
173
|
178
|
enableFiltering: false,
|
174
|
179
|
},
|
175
|
|
-
|
176
|
180
|
{
|
177
|
181
|
name: "incidentSign",
|
178
|
|
- displayName: "事件单号",
|
|
182
|
+ displayName: "事件单号|报修科室",
|
|
183
|
+ width: "10%",
|
|
184
|
+ enableFiltering: false,
|
|
185
|
+ cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.incidentSign}}<br>{{row.entity.incidentDTO.department ? row.entity.incidentDTO.department.dept : "无"}}</div>'
|
|
186
|
+ },
|
|
187
|
+ {
|
|
188
|
+ name: "incidentSign1",
|
|
189
|
+ displayName: "登记时间|维修人",
|
179
|
190
|
width: "10%",
|
180
|
191
|
enableFiltering: false,
|
|
192
|
+ cellTemplate: '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.incidentDTO.acceptDate)}}<br>{{row.entity.maintainer ? row.entity.maintainer.name : ""}}</div>'
|
181
|
193
|
},
|
182
|
194
|
{
|
183
|
195
|
name: "description",
|
184
|
|
- displayName: "故障描述",
|
|
196
|
+ displayName: "故障描述|区域地点",
|
185
|
197
|
width: "400",
|
186
|
198
|
enableFiltering: false,
|
187
|
|
- // cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.planStartTime.length>16?grid.appScope.transferTime(row.entity.planStartTime):row.entity.planStartTime}}</div>'
|
|
199
|
+ cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.description}}<br>{{row.entity.incidentDTO.area ? row.entity.incidentDTO.area.area : ""}} {{row.entity.incidentDTO.place ? row.entity.incidentDTO.place.place : ""}}</div>'
|
188
|
200
|
},
|
189
|
201
|
{
|
190
|
202
|
name: "maintainer",
|
191
|
|
- displayName: "维修人",
|
|
203
|
+ displayName: "耗材名称",
|
192
|
204
|
width: "10%",
|
193
|
205
|
enableFiltering: false,
|
194
|
206
|
cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.maintainer ? row.entity.maintainer.name : ""}}</div>'
|
|
@@ -200,23 +212,23 @@ app.controller("summaryCtrl", [
|
200
|
212
|
enableFiltering: false,
|
201
|
213
|
cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.totalMaintenancePrice || 0}}元</div>'
|
202
|
214
|
},
|
|
215
|
+ // {
|
|
216
|
+ // name: "createTime",
|
|
217
|
+ // displayName: "生成时间",
|
|
218
|
+ // width: "11%",
|
|
219
|
+ // enableFiltering: false,
|
|
220
|
+ // cellTemplate: '<div class="ui-grid-cell-contents">{{ grid.appScope.transferTime(row.entity.createTime) }}</div>'
|
|
221
|
+ // },
|
|
222
|
+ // {
|
|
223
|
+ // name: "state",
|
|
224
|
+ // displayName: "状态",
|
|
225
|
+ // width: "6%",
|
|
226
|
+ // enableFiltering: false,
|
|
227
|
+ // cellTemplate:
|
|
228
|
+ // '<div class="ui-grid-cell-contents"><span ng-if="row.entity.state == 1">暂存</span><span ng-if="row.entity.state == 2">未审核</span><span ng-if="row.entity.state == 3">审核通过</span></div>',
|
|
229
|
+ // },
|
203
|
230
|
{
|
204
|
|
- name: "createTime",
|
205
|
|
- displayName: "生成时间",
|
206
|
|
- width: "11%",
|
207
|
|
- enableFiltering: false,
|
208
|
|
- cellTemplate: '<div class="ui-grid-cell-contents">{{ grid.appScope.transferTime(row.entity.createTime) }}</div>'
|
209
|
|
- },
|
210
|
|
- {
|
211
|
|
- name: "state",
|
212
|
|
- displayName: "状态",
|
213
|
|
- width: "6%",
|
214
|
|
- enableFiltering: false,
|
215
|
|
- cellTemplate:
|
216
|
|
- '<div class="ui-grid-cell-contents"><span ng-if="row.entity.state == 1">暂存</span><span ng-if="row.entity.state == 2">未审核</span><span ng-if="row.entity.state == 3">审核通过</span></div>',
|
217
|
|
- },
|
218
|
|
- {
|
219
|
|
- minWidth: "230",
|
|
231
|
+ minWidth: "250",
|
220
|
232
|
name: "操作",
|
221
|
233
|
enableFiltering: false,
|
222
|
234
|
cellTemplate:
|
|
@@ -225,6 +237,7 @@ app.controller("summaryCtrl", [
|
225
|
237
|
'<a ng-click="grid.appScope.removeData(row.entity)" ng-if="grid.appScope.shanchu" class="bianjifont">删除</a>' +
|
226
|
238
|
'<a ng-click="grid.appScope.runFunction(row.entity)" ng-if="grid.appScope.shenhe && row.entity.state == 2" class="bianjifont">审核通过</a>' +
|
227
|
239
|
'<a ng-click="grid.appScope.recalculate(row.entity)" ng-if="grid.appScope.summary_recalculate && (row.entity.state == 1 || row.entity.state == 2)" class="bianjifont">重算</a>' +
|
|
240
|
+ '<a ng-click="grid.appScope.toIncident(row.entity)" ng-if="grid.appScope.summary_incident" class="bianjifont">查看事件</a>' +
|
228
|
241
|
"</div>",
|
229
|
242
|
},
|
230
|
243
|
// { name: 'planTime2', displayName: '截止时间', width: 160, enableFiltering: false },
|
|
@@ -241,7 +254,15 @@ app.controller("summaryCtrl", [
|
241
|
254
|
//跳转到查看列表
|
242
|
255
|
$scope.seeFunction = function (data) {
|
243
|
256
|
console.log(data)
|
|
257
|
+ console.log($scope.searchkeys)
|
|
258
|
+ sessionStorage.summaryParameter = JSON.stringify(
|
|
259
|
+ {
|
|
260
|
+ searchkeys: $scope.searchkeys,
|
|
261
|
+ postData: $scope.postData,
|
|
262
|
+ }
|
|
263
|
+ );
|
244
|
264
|
$state.go("app.incident.summaryDetail", {
|
|
265
|
+ type: 'incident.summary',
|
245
|
266
|
incidentId: data.incidentId || '',
|
246
|
267
|
categoryId: data.incidentCategoryId || '',
|
247
|
268
|
dutyId: data.incidentDutyId || '',
|
|
@@ -361,6 +382,13 @@ app.controller("summaryCtrl", [
|
361
|
382
|
});
|
362
|
383
|
};
|
363
|
384
|
|
|
385
|
+ // 查看事件
|
|
386
|
+ $scope.toIncident = function(data){
|
|
387
|
+ $state.go('app.incident.incidentDetail', {
|
|
388
|
+ id: data.incidentId,
|
|
389
|
+ });
|
|
390
|
+ }
|
|
391
|
+
|
364
|
392
|
//行删除
|
365
|
393
|
$scope.removeData = function (item) {
|
366
|
394
|
console.log($scope.selected.items);
|
|
@@ -453,16 +481,16 @@ app.controller("summaryCtrl", [
|
453
|
481
|
gridApi.pagination.on.paginationChanged(
|
454
|
482
|
$scope,
|
455
|
483
|
function (newPage, pageSize) {
|
456
|
|
- var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
|
484
|
+ // var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
457
|
485
|
var filtersData = {};
|
458
|
486
|
filtersData.idx = newPage - 1;
|
459
|
487
|
filtersData.sum = pageSize;
|
460
|
488
|
$scope.pageNum = $scope.gridApi.pagination.getPage() - 1;
|
461
|
489
|
// console.log(pp);
|
462
|
|
- filterData.idx = $scope.pageNum;
|
|
490
|
+ // filterData.idx = $scope.pageNum;
|
463
|
491
|
$scope.fileData.idx = newPage - 1;
|
464
|
492
|
$scope.fileData.sum = pageSize;
|
465
|
|
- sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
|
|
493
|
+ // sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
|
466
|
494
|
$scope.refreshData("expand-right", $scope.fileData);
|
467
|
495
|
}
|
468
|
496
|
);
|
|
@@ -529,7 +557,8 @@ app.controller("summaryCtrl", [
|
529
|
557
|
gridApi.core.on.filterChanged($scope, function () {
|
530
|
558
|
var grid = this.grid;
|
531
|
559
|
|
532
|
|
- var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
|
560
|
+ // var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
|
561
|
+ var filterData = {};
|
533
|
562
|
|
534
|
563
|
angular.forEach(grid.columns, function (item) {
|
535
|
564
|
if (item.enableFiltering) {
|
|
@@ -545,7 +574,7 @@ app.controller("summaryCtrl", [
|
545
|
574
|
}
|
546
|
575
|
});
|
547
|
576
|
|
548
|
|
- sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
|
|
577
|
+ // sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
|
549
|
578
|
$scope.refreshData("expand-right", filterData);
|
550
|
579
|
});
|
551
|
580
|
};
|
|
@@ -557,6 +586,7 @@ app.controller("summaryCtrl", [
|
557
|
586
|
}
|
558
|
587
|
|
559
|
588
|
//数据刷新
|
|
589
|
+ $scope.postData = {};
|
560
|
590
|
$scope.refreshData = function (style, filterData) {
|
561
|
591
|
$scope.ldloading[style.replace("-", "_")] = true;
|
562
|
592
|
|
|
@@ -578,6 +608,7 @@ app.controller("summaryCtrl", [
|
578
|
608
|
state: $scope.searchkeys.state ? $scope.searchkeys.state.id : undefined,
|
579
|
609
|
maintainer: $scope.searchkeys.maintainer || undefined,
|
580
|
610
|
})
|
|
611
|
+ $scope.postData = filterData;
|
581
|
612
|
api_bpm_data.fetchDataList("repairSummary", filterData).then(
|
582
|
613
|
function (data) {
|
583
|
614
|
var myData = Restangular.stripRestangular(data);
|
|
@@ -644,6 +675,7 @@ app.controller("summaryCtrl", [
|
644
|
675
|
state: $scope.searchkeys.state ? $scope.searchkeys.state.id : undefined,
|
645
|
676
|
maintainer: $scope.searchkeys.maintainer || undefined,
|
646
|
677
|
})
|
|
678
|
+ $scope.postData = filterData;
|
647
|
679
|
api_bpm_data.fetchDataList("repairSummary", filterData).then(
|
648
|
680
|
function (data) {
|
649
|
681
|
var myData = Restangular.stripRestangular(data);
|
|
@@ -702,7 +734,7 @@ app.controller("summaryCtrl", [
|
702
|
734
|
};
|
703
|
735
|
|
704
|
736
|
$scope.refresh = function () {
|
705
|
|
- var jry_filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
|
737
|
+ // var jry_filterData = JSON.parse(sessionStorage.repairSummaryParameter);
|
706
|
738
|
var intervalData = {};
|
707
|
739
|
intervalData.idx = jry_filterData.idx;
|
708
|
740
|
intervalData.sum = jry_filterData.sum;
|
|
@@ -710,6 +742,19 @@ app.controller("summaryCtrl", [
|
710
|
742
|
$scope.refreshData("expand-right", intervalData);
|
711
|
743
|
};
|
712
|
744
|
|
|
745
|
+ // init
|
|
746
|
+ $scope.init = function(){
|
|
747
|
+ var summaryParameter = sessionStorage.summaryParameter && JSON.parse(sessionStorage.summaryParameter);
|
|
748
|
+ if(summaryParameter){
|
|
749
|
+ $scope.searchkeys = summaryParameter.searchkeys;
|
|
750
|
+ $scope.postData = summaryParameter.postData;
|
|
751
|
+ if($scope.postData.idx){
|
|
752
|
+ $scope.gridOptions.paginationCurrentPage = $scope.postData.idx + 1;
|
|
753
|
+ }
|
|
754
|
+ }
|
|
755
|
+ }
|
|
756
|
+ $scope.init();
|
|
757
|
+
|
713
|
758
|
$scope.refreshData("expand-right", $scope.fileData);
|
714
|
759
|
$scope.timer = $interval(function () {
|
715
|
760
|
$scope.refreshData2("expand-right", $scope.fileData);
|