|
@@ -0,0 +1,250 @@
|
|
1
|
+"use strict";
|
|
2
|
+app.controller("servicePerformanceCtrl", [
|
|
3
|
+ "$scope",
|
|
4
|
+ "$rootScope",
|
|
5
|
+ "$state",
|
|
6
|
+ "$timeout",
|
|
7
|
+ "$interval",
|
|
8
|
+ "$http",
|
|
9
|
+ "$cookieStore",
|
|
10
|
+ "moment",
|
|
11
|
+ "SweetAlert",
|
|
12
|
+ "Restangular",
|
|
13
|
+ "api_report",
|
|
14
|
+ "api_statistic",
|
|
15
|
+ "api_bpm_data",
|
|
16
|
+ "api_user_data",
|
|
17
|
+ "$modal",
|
|
18
|
+ function (
|
|
19
|
+ $scope,
|
|
20
|
+ $rootScope,
|
|
21
|
+ $state,
|
|
22
|
+ $timeout,
|
|
23
|
+ $interval,
|
|
24
|
+ $http,
|
|
25
|
+ $cookieStore,
|
|
26
|
+ moment,
|
|
27
|
+ SweetAlert,
|
|
28
|
+ Restangular,
|
|
29
|
+ api_report,
|
|
30
|
+ api_statistic,
|
|
31
|
+ api_bpm_data,
|
|
32
|
+ api_user_data,
|
|
33
|
+ $modal
|
|
34
|
+ ) {
|
|
35
|
+ $scope.parameters = {};
|
|
36
|
+ $scope.category = {};
|
|
37
|
+ $scope.reportName = "计费";
|
|
38
|
+ $scope.allheight = 100;
|
|
39
|
+ $scope.isMaskground = false;
|
|
40
|
+ $scope.open = function ($event) {
|
|
41
|
+ $event.preventDefault();
|
|
42
|
+ $event.stopPropagation();
|
|
43
|
+
|
|
44
|
+ $scope.opened = !$scope.opened;
|
|
45
|
+ };
|
|
46
|
+ $scope.endOpen = function ($event) {
|
|
47
|
+ $event.preventDefault();
|
|
48
|
+ $event.stopPropagation();
|
|
49
|
+ $scope.startOpened = false;
|
|
50
|
+ $scope.endOpened = !$scope.endOpened;
|
|
51
|
+ };
|
|
52
|
+ $scope.startOpen = function ($event) {
|
|
53
|
+ $event.preventDefault();
|
|
54
|
+ $event.stopPropagation();
|
|
55
|
+ $scope.endOpened = false;
|
|
56
|
+ $scope.startOpened = !$scope.startOpened;
|
|
57
|
+ };
|
|
58
|
+ $scope.starttimes = moment(
|
|
59
|
+ new Date(moment().startOf("month")).setMonth(new Date().getMonth() - 1)
|
|
60
|
+ ).format("YYYY-MM-DD HH:mm:ss");
|
|
61
|
+ $scope.endtimes = moment(
|
|
62
|
+ new Date(moment().startOf("month")).setMonth(new Date().getMonth()) - 1
|
|
63
|
+ ).format("YYYY-MM-DD HH:mm:ss");
|
|
64
|
+ $scope.parameters.paramDateFrom = $scope.starttimes;
|
|
65
|
+ $scope.parameters.paramDateTo = $scope.endtimes;
|
|
66
|
+ $scope.reshdata = function() {
|
|
67
|
+ api_bpm_data
|
|
68
|
+ .serviceCount({
|
|
69
|
+ type: 'serviceCountList',
|
|
70
|
+ startTime: $scope.starttimes,
|
|
71
|
+ finishTime: $scope.endtimes,
|
|
72
|
+ })
|
|
73
|
+ .then(function (response) {
|
|
74
|
+ if (response) {
|
|
75
|
+ if ((response.status = 200)) {
|
|
76
|
+ $scope.isMaskground = false;
|
|
77
|
+ $scope.charginrow = response.data;
|
|
78
|
+ var totalScore = $scope.charginrow.reduce((pre,cur)=>{
|
|
79
|
+ return pre + cur.score;
|
|
80
|
+ },0)
|
|
81
|
+ angular.forEach($scope.charginrow, function(item) {
|
|
82
|
+ if(totalScore){
|
|
83
|
+ item.percent = (item.score * 100 / totalScore).toFixed(2) + '%';
|
|
84
|
+ }else{
|
|
85
|
+ item.percent = '0%';
|
|
86
|
+ }
|
|
87
|
+ })
|
|
88
|
+ if (response.list && response.list.length == 0) {
|
|
89
|
+ $scope.shows = true;
|
|
90
|
+ $scope.empty = "数据为空!";
|
|
91
|
+ }
|
|
92
|
+ }
|
|
93
|
+ }
|
|
94
|
+ });
|
|
95
|
+ }
|
|
96
|
+ $scope.reshdata();
|
|
97
|
+ $scope.reset = function () {
|
|
98
|
+ $scope.parameters = {};
|
|
99
|
+ $scope.starttimes = moment(
|
|
100
|
+ new Date(moment().startOf("month")).setMonth(new Date().getMonth() - 1)
|
|
101
|
+ ).format("YYYY-MM-DD HH:mm:ss");
|
|
102
|
+ $scope.endtimes = moment(
|
|
103
|
+ new Date(moment().startOf("month")).setMonth(new Date().getMonth()) - 1
|
|
104
|
+ ).format("YYYY-MM-DD HH:mm:ss");
|
|
105
|
+ $scope.parameters.paramDateFrom = $scope.starttimes;
|
|
106
|
+ $scope.parameters.paramDateTo = $scope.endtimes;
|
|
107
|
+ $scope.mdxquerym();
|
|
108
|
+ };
|
|
109
|
+ $scope.mdxquerym = function () {
|
|
110
|
+ $scope.starttimes = moment($scope.parameters.paramDateFrom).format(
|
|
111
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
112
|
+ );
|
|
113
|
+ $scope.endtimes = moment($scope.parameters.paramDateTo).format(
|
|
114
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
115
|
+ );
|
|
116
|
+ $scope.isMaskground = true;
|
|
117
|
+ $scope.shows = false;
|
|
118
|
+ $scope.reshdata();
|
|
119
|
+ };
|
|
120
|
+
|
|
121
|
+ // 弹窗1
|
|
122
|
+ $scope.servicePerformanceDetail = function(data){
|
|
123
|
+ if(!data.incidentId){
|
|
124
|
+ return;
|
|
125
|
+ }
|
|
126
|
+ $modal.open({
|
|
127
|
+ resolve: {
|
|
128
|
+ scope: function () {
|
|
129
|
+ return $scope;
|
|
130
|
+ },
|
|
131
|
+ },
|
|
132
|
+ size: "lg",
|
|
133
|
+ templateUrl: 'assets/views/customform/tpl/servicePerformanceDetail1.html',
|
|
134
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
|
|
135
|
+ $scope.title = "提示";
|
|
136
|
+ $scope.reshdata = function() {
|
|
137
|
+ $scope.isMaskground = true;
|
|
138
|
+ api_bpm_data
|
|
139
|
+ .serviceCount({
|
|
140
|
+ type: 'serviceDaysList',
|
|
141
|
+ userId: data.userId,
|
|
142
|
+ startTime: scope.starttimes,
|
|
143
|
+ finishTime: scope.endtimes,
|
|
144
|
+ })
|
|
145
|
+ .then(function (response) {
|
|
146
|
+ if (response) {
|
|
147
|
+ if ((response.status = 200)) {
|
|
148
|
+ $scope.isMaskground = false;
|
|
149
|
+ $scope.charginrow = response.data;
|
|
150
|
+ if (response.list && response.list.length == 0) {
|
|
151
|
+ $scope.shows = true;
|
|
152
|
+ $scope.empty = "数据为空!";
|
|
153
|
+ }
|
|
154
|
+ }
|
|
155
|
+ }
|
|
156
|
+ });
|
|
157
|
+ }
|
|
158
|
+ $scope.reshdata();
|
|
159
|
+ $scope.cancel = function () {
|
|
160
|
+ $modalInstance.dismiss('cancel');
|
|
161
|
+ };
|
|
162
|
+ // 弹窗2
|
|
163
|
+ $scope.servicePerformanceDetail = function(data){
|
|
164
|
+ $scope.cancel();
|
|
165
|
+ $modal.open({
|
|
166
|
+ resolve: {
|
|
167
|
+ scope: function () {
|
|
168
|
+ return scope;
|
|
169
|
+ },
|
|
170
|
+ },
|
|
171
|
+ size: "lg",
|
|
172
|
+ templateUrl: 'assets/views/customform/tpl/servicePerformanceDetail2.html',
|
|
173
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
|
|
174
|
+ $scope.title = "提示";
|
|
175
|
+ $scope.reshdata = function() {
|
|
176
|
+ $scope.isMaskground = true;
|
|
177
|
+ api_bpm_data
|
|
178
|
+ .serviceCount({
|
|
179
|
+ type: 'serviceIncidentList',
|
|
180
|
+ userId: data.userId,
|
|
181
|
+ startTime: data.acceptdate,
|
|
182
|
+ finishTime: data.acceptdate,
|
|
183
|
+ })
|
|
184
|
+ .then(function (response) {
|
|
185
|
+ if (response) {
|
|
186
|
+ if ((response.status = 200)) {
|
|
187
|
+ $scope.isMaskground = false;
|
|
188
|
+ $scope.charginrow = response.data;
|
|
189
|
+ if (response.list && response.list.length == 0) {
|
|
190
|
+ $scope.shows = true;
|
|
191
|
+ $scope.empty = "数据为空!";
|
|
192
|
+ }
|
|
193
|
+ }
|
|
194
|
+ }
|
|
195
|
+ });
|
|
196
|
+ }
|
|
197
|
+ $scope.reshdata();
|
|
198
|
+ $scope.cancel = function () {
|
|
199
|
+ $modalInstance.dismiss('cancel');
|
|
200
|
+ };
|
|
201
|
+ // 弹窗3
|
|
202
|
+ $scope.servicePerformanceDetail = function(data){
|
|
203
|
+ $scope.cancel();
|
|
204
|
+ $modal.open({
|
|
205
|
+ resolve: {
|
|
206
|
+ scope: function () {
|
|
207
|
+ return scope;
|
|
208
|
+ },
|
|
209
|
+ },
|
|
210
|
+ size: "lg",
|
|
211
|
+ templateUrl: 'assets/views/customform/tpl/servicePerformanceDetail3.html',
|
|
212
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
|
|
213
|
+ $scope.title = data.category + "-" + data.score;
|
|
214
|
+ $scope.reshdata = function() {
|
|
215
|
+ $scope.isMaskground = true;
|
|
216
|
+ api_bpm_data
|
|
217
|
+ .serviceCount({
|
|
218
|
+ type: 'serviceDetailsList',
|
|
219
|
+ incidentId: data.incidentId,
|
|
220
|
+ startTime: moment(data.acceptdate).format('YYYY-MM-DD'),
|
|
221
|
+ finishTime: moment(data.acceptdate).format('YYYY-MM-DD'),
|
|
222
|
+ })
|
|
223
|
+ .then(function (response) {
|
|
224
|
+ if (response) {
|
|
225
|
+ if ((response.status = 200)) {
|
|
226
|
+ $scope.isMaskground = false;
|
|
227
|
+ $scope.charginrow = response.data;
|
|
228
|
+ if (response.list && response.list.length == 0) {
|
|
229
|
+ $scope.shows = true;
|
|
230
|
+ $scope.empty = "数据为空!";
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+ }
|
|
234
|
+ });
|
|
235
|
+ }
|
|
236
|
+ $scope.reshdata();
|
|
237
|
+ $scope.cancel = function () {
|
|
238
|
+ $modalInstance.dismiss('cancel');
|
|
239
|
+ };
|
|
240
|
+ },
|
|
241
|
+ });
|
|
242
|
+ }
|
|
243
|
+ },
|
|
244
|
+ });
|
|
245
|
+ }
|
|
246
|
+ },
|
|
247
|
+ });
|
|
248
|
+ }
|
|
249
|
+ },
|
|
250
|
+]);
|