|
@@ -101,119 +101,149 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
101
|
101
|
$scope.gridOptions.getRowIdentity = function (row) {
|
102
|
102
|
return row.id;
|
103
|
103
|
};
|
|
104
|
+ //处理图标与文字
|
|
105
|
+ $scope.transfertip = function (item) {
|
|
106
|
+ var tip = "";
|
|
107
|
+ if (item.operationLog) {
|
|
108
|
+ tip = item.operationLog.userName;
|
|
109
|
+ }
|
|
110
|
+ return tip;
|
|
111
|
+ }
|
|
112
|
+ $scope.transferColor = function (item) {
|
|
113
|
+ var color = "";
|
|
114
|
+ if (item.operationLog) {
|
|
115
|
+ if (item.operationLog.opValue == 1) {
|
|
116
|
+ color = "dash dash-lock redfont";
|
|
117
|
+ } else {
|
|
118
|
+ color = "dash dash-unlock greenfont";
|
|
119
|
+ }
|
|
120
|
+ } else {
|
|
121
|
+ color = "dash dash-unlock greenfont";
|
|
122
|
+ }
|
|
123
|
+ return color;
|
|
124
|
+ }
|
104
|
125
|
//表格列表显示
|
105
|
126
|
if ($scope.repairMain.valueconfig == 1) {//报修主体为报修人
|
106
|
|
- $scope.gridOptions.columnDefs = [{
|
107
|
|
- name: 'item',
|
108
|
|
- displayName: '序号',
|
109
|
|
- width:50,
|
110
|
|
- cellTemplate: '<div>' +
|
111
|
|
- '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
|
112
|
|
- '</div>'
|
113
|
|
- },{
|
114
|
|
- name: 'bxcode',
|
115
|
|
- displayName: '报修单号',
|
116
|
|
- width:150,
|
117
|
|
- cellTemplate: '<div>' +
|
118
|
|
- '<div class="ui-grid-cell-contents">{{row.entity.bxcode}}</div>' +
|
119
|
|
- '</div>'
|
120
|
|
- }, {
|
121
|
|
- name: 'incidentDescription',
|
122
|
|
- displayName: '事件描述',
|
123
|
|
- width:150,
|
124
|
|
- cellTemplate: '<div>' +
|
125
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.incidentDescription}}</div>' +
|
126
|
|
- '</div>'
|
127
|
|
- },
|
128
|
|
- // {
|
129
|
|
- // name: 'incidentDescription1',
|
130
|
|
- // displayName: '报修科室',
|
131
|
|
- // width: '12%',
|
132
|
|
- // cellTemplate: '<div>' +
|
133
|
|
- // '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.incidentDescription1}}</div>' +
|
134
|
|
- // '</div>'
|
135
|
|
- // },
|
136
|
|
- {
|
137
|
|
- name: 'address',
|
138
|
|
- displayName: '故障地点',
|
139
|
|
- width:150,
|
140
|
|
- cellTemplate: '<div>' +
|
141
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.place.place||""}} {{row.entity.address}}</div>' +
|
142
|
|
- '</div>'
|
143
|
|
- }, {
|
144
|
|
- name: 'contacts',
|
145
|
|
- displayName: '联系人',
|
146
|
|
- width:150,
|
147
|
|
- cellTemplate: '<div>' +
|
148
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contacts}}</div>' +
|
149
|
|
- '</div>'
|
150
|
|
- },{
|
151
|
|
- name: 'requester.account',
|
152
|
|
- displayName: '学工号',
|
153
|
|
- width:150,
|
154
|
|
- cellTemplate: '<div>' +
|
155
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.requester.account}}</div>' +
|
156
|
|
- '</div>'
|
157
|
|
- }, {
|
158
|
|
- name: 'contactsInformation',
|
159
|
|
- displayName: '联系电话',
|
160
|
|
- width:150,
|
161
|
|
- cellTemplate: '<div>' +
|
162
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contactsInformation}}</div>' +
|
163
|
|
- '</div>'
|
164
|
|
- },{
|
165
|
|
- name: 'incident.acceptUser.name',
|
166
|
|
- displayName: '受理人',
|
167
|
|
- width:150,
|
168
|
|
- cellTemplate: '<div>' +
|
169
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" ng-if="row.entity.incident&&row.entity.incident.acceptUser">{{row.entity.incident.acceptUser.name||""}}</div>' +
|
170
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" ng-if="row.entity.rejectUser">{{row.entity.rejectUser.name||""}}</div>' +
|
171
|
|
- '</div>'
|
172
|
|
- },
|
173
|
|
- // {
|
174
|
|
- // name: 'requester.name',
|
175
|
|
- // displayName: '报修人',
|
176
|
|
- // width: '10%',
|
177
|
|
- // cellTemplate: '<div>' +
|
178
|
|
- // '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.requester.name}}</div>' +
|
179
|
|
- // '</div>'
|
180
|
|
- // },
|
181
|
|
- {
|
182
|
|
- name: 'serviceState.name',
|
183
|
|
- displayName: '状态',
|
184
|
|
- width:150,
|
185
|
|
- cellTemplate: '<div>' +
|
186
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.serviceState.name}}</div>' +
|
187
|
|
- '</div>'
|
188
|
|
- }, {
|
189
|
|
- name: 'createTime',
|
190
|
|
- displayName: '报修时间',
|
191
|
|
- width:150,
|
192
|
|
- cellTemplate: '<div>' +
|
193
|
|
- '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center">{{grid.appScope.transferTime(row.entity.createTime)}}</div>' +
|
194
|
|
- '</div>'
|
|
127
|
+ $scope.gridOptions.columnDefs = [
|
|
128
|
+ {
|
|
129
|
+ name: 'id',
|
|
130
|
+ displayName: '',
|
|
131
|
+ width: 35,
|
|
132
|
+ cellTemplate: '<div>' +
|
|
133
|
+ '<div class="ui-grid-cell-contents" tooltip={{grid.appScope.transfertip(row.entity)}} tooltip-placement="right"><i style="font-size: 18px !important;" class="{{grid.appScope.transferColor(row.entity)}}"></i></div></div>' +
|
|
134
|
+ '</div>'
|
|
135
|
+ },
|
|
136
|
+ {
|
|
137
|
+ name: 'item',
|
|
138
|
+ displayName: '序号',
|
|
139
|
+ width: 50,
|
|
140
|
+ cellTemplate: '<div>' +
|
|
141
|
+ '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
|
|
142
|
+ '</div>'
|
|
143
|
+ }, {
|
|
144
|
+ name: 'bxcode',
|
|
145
|
+ displayName: '报修单号',
|
|
146
|
+ width: 150,
|
|
147
|
+ cellTemplate: '<div>' +
|
|
148
|
+ '<div class="ui-grid-cell-contents">{{row.entity.bxcode}}</div>' +
|
|
149
|
+ '</div>'
|
|
150
|
+ }, {
|
|
151
|
+ name: 'incidentDescription',
|
|
152
|
+ displayName: '事件描述',
|
|
153
|
+ width: 150,
|
|
154
|
+ cellTemplate: '<div>' +
|
|
155
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.incidentDescription}}</div>' +
|
|
156
|
+ '</div>'
|
|
157
|
+ },
|
|
158
|
+ // {
|
|
159
|
+ // name: 'incidentDescription1',
|
|
160
|
+ // displayName: '报修科室',
|
|
161
|
+ // width: '12%',
|
|
162
|
+ // cellTemplate: '<div>' +
|
|
163
|
+ // '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.incidentDescription1}}</div>' +
|
|
164
|
+ // '</div>'
|
195
|
165
|
// },
|
|
166
|
+ {
|
|
167
|
+ name: 'address',
|
|
168
|
+ displayName: '故障地点',
|
|
169
|
+ width: 150,
|
|
170
|
+ cellTemplate: '<div>' +
|
|
171
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.place.place||""}} {{row.entity.address}}</div>' +
|
|
172
|
+ '</div>'
|
|
173
|
+ }, {
|
|
174
|
+ name: 'contacts',
|
|
175
|
+ displayName: '联系人',
|
|
176
|
+ width: 150,
|
|
177
|
+ cellTemplate: '<div>' +
|
|
178
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contacts}}</div>' +
|
|
179
|
+ '</div>'
|
|
180
|
+ }, {
|
|
181
|
+ name: 'requester.account',
|
|
182
|
+ displayName: '学工号',
|
|
183
|
+ width: 150,
|
|
184
|
+ cellTemplate: '<div>' +
|
|
185
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.requester.account}}</div>' +
|
|
186
|
+ '</div>'
|
|
187
|
+ }, {
|
|
188
|
+ name: 'contactsInformation',
|
|
189
|
+ displayName: '联系电话',
|
|
190
|
+ width: 150,
|
|
191
|
+ cellTemplate: '<div>' +
|
|
192
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contactsInformation}}</div>' +
|
|
193
|
+ '</div>'
|
|
194
|
+ }, {
|
|
195
|
+ name: 'incident.acceptUser.name',
|
|
196
|
+ displayName: '受理人',
|
|
197
|
+ width: 150,
|
|
198
|
+ cellTemplate: '<div>' +
|
|
199
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" ng-if="row.entity.incident&&row.entity.incident.acceptUser">{{row.entity.incident.acceptUser.name||""}}</div>' +
|
|
200
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" ng-if="row.entity.rejectUser">{{row.entity.rejectUser.name||""}}</div>' +
|
|
201
|
+ '</div>'
|
|
202
|
+ },
|
196
|
203
|
// {
|
197
|
|
- // name: '生成事件',
|
198
|
|
- // width: 80,
|
199
|
|
- // cellTemplate: '<div class="links cl-effect-1">' +
|
200
|
|
- // '<a ng-click="grid.appScope.selectRowFunction(row.entity)" tooltip="新建事件" tooltip-placement="left"><i class="fa fa-pencil-square-o"></i></a>' +
|
|
204
|
+ // name: 'requester.name',
|
|
205
|
+ // displayName: '报修人',
|
|
206
|
+ // width: '10%',
|
|
207
|
+ // cellTemplate: '<div>' +
|
|
208
|
+ // '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.requester.name}}</div>' +
|
201
|
209
|
// '</div>'
|
202
|
|
- },
|
203
|
|
- {
|
204
|
|
- name: '操作',
|
205
|
|
- width:200,
|
206
|
|
- cellTemplate: '<wechatoperator item="row.entity" colobject="col">',
|
207
|
|
- enableFiltering: false
|
208
|
|
- }
|
|
210
|
+ // },
|
|
211
|
+ {
|
|
212
|
+ name: 'serviceState.name',
|
|
213
|
+ displayName: '状态',
|
|
214
|
+ width: 150,
|
|
215
|
+ cellTemplate: '<div>' +
|
|
216
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.serviceState.name}}</div>' +
|
|
217
|
+ '</div>'
|
|
218
|
+ }, {
|
|
219
|
+ name: 'createTime',
|
|
220
|
+ displayName: '报修时间',
|
|
221
|
+ width: 150,
|
|
222
|
+ cellTemplate: '<div>' +
|
|
223
|
+ '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center">{{grid.appScope.transferTime(row.entity.createTime)}}</div>' +
|
|
224
|
+ '</div>'
|
|
225
|
+ // },
|
|
226
|
+ // {
|
|
227
|
+ // name: '生成事件',
|
|
228
|
+ // width: 80,
|
|
229
|
+ // cellTemplate: '<div class="links cl-effect-1">' +
|
|
230
|
+ // '<a ng-click="grid.appScope.selectRowFunction(row.entity)" tooltip="新建事件" tooltip-placement="left"><i class="fa fa-pencil-square-o"></i></a>' +
|
|
231
|
+ // '</div>'
|
|
232
|
+ },
|
|
233
|
+ {
|
|
234
|
+ name: '操作',
|
|
235
|
+ width: 200,
|
|
236
|
+ cellTemplate: '<wechatoperator item="row.entity" colobject="col">',
|
|
237
|
+ enableFiltering: false
|
|
238
|
+ }
|
209
|
239
|
];
|
210
|
240
|
// 是否展示资产
|
211
|
|
- if($scope.wxIncidentWithCmdb == 1){
|
212
|
|
- let index = $scope.gridOptions.columnDefs.findIndex(v=>v.name == 'address');
|
213
|
|
- $scope.gridOptions.columnDefs.splice(index,0,{
|
|
241
|
+ if ($scope.wxIncidentWithCmdb == 1) {
|
|
242
|
+ let index = $scope.gridOptions.columnDefs.findIndex(v => v.name == 'address');
|
|
243
|
+ $scope.gridOptions.columnDefs.splice(index, 0, {
|
214
|
244
|
name: 'assetId',
|
215
|
245
|
displayName: '资产',
|
216
|
|
- width:150
|
|
246
|
+ width: 150
|
217
|
247
|
})
|
218
|
248
|
}
|
219
|
249
|
} else if ($scope.repairMain.valueconfig == 2) {//报修主体为科室
|
|
@@ -224,17 +254,17 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
224
|
254
|
cellTemplate: '<div>' +
|
225
|
255
|
'<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
|
226
|
256
|
'</div>'
|
227
|
|
- },{
|
|
257
|
+ }, {
|
228
|
258
|
name: 'bxcode',
|
229
|
259
|
displayName: '报修单号',
|
230
|
|
- width:150,
|
|
260
|
+ width: 150,
|
231
|
261
|
cellTemplate: '<div>' +
|
232
|
262
|
'<div class="ui-grid-cell-contents">{{row.entity.bxcode}}</div>' +
|
233
|
263
|
'</div>'
|
234
|
264
|
}, {
|
235
|
265
|
name: 'incidentDescription',
|
236
|
266
|
displayName: '事件描述',
|
237
|
|
- width:150,
|
|
267
|
+ width: 150,
|
238
|
268
|
cellTemplate: '<div>' +
|
239
|
269
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.incidentDescription}}</div>' +
|
240
|
270
|
'</div>'
|
|
@@ -250,28 +280,28 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
250
|
280
|
{
|
251
|
281
|
name: 'address',
|
252
|
282
|
displayName: '故障地点',
|
253
|
|
- width:150,
|
|
283
|
+ width: 150,
|
254
|
284
|
cellTemplate: '<div>' +
|
255
|
285
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.place.place||""}} {{row.entity.address}}</div>' +
|
256
|
286
|
'</div>'
|
257
|
287
|
}, {
|
258
|
288
|
name: 'departmentDTO.dept',
|
259
|
289
|
displayName: '报修科室',
|
260
|
|
- width:150,
|
|
290
|
+ width: 150,
|
261
|
291
|
cellTemplate: '<div>' +
|
262
|
292
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.departmentDTO.dept}}</div>' +
|
263
|
293
|
'</div>'
|
264
|
294
|
}, {
|
265
|
295
|
name: 'contacts',
|
266
|
296
|
displayName: '联系人',
|
267
|
|
- width:150,
|
|
297
|
+ width: 150,
|
268
|
298
|
cellTemplate: '<div>' +
|
269
|
299
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contacts}}</div>' +
|
270
|
300
|
'</div>'
|
271
|
301
|
}, {
|
272
|
302
|
name: 'contactsInformation',
|
273
|
303
|
displayName: '联系电话',
|
274
|
|
- width:150,
|
|
304
|
+ width: 150,
|
275
|
305
|
cellTemplate: '<div>' +
|
276
|
306
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.contactsInformation}}</div>' +
|
277
|
307
|
'</div>'
|
|
@@ -287,14 +317,14 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
287
|
317
|
{
|
288
|
318
|
name: 'serviceState.name',
|
289
|
319
|
displayName: '状态',
|
290
|
|
- width:150,
|
|
320
|
+ width: 150,
|
291
|
321
|
cellTemplate: '<div>' +
|
292
|
322
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.serviceState.name}}</div>' +
|
293
|
323
|
'</div>'
|
294
|
324
|
}, {
|
295
|
325
|
name: 'createTime',
|
296
|
326
|
displayName: '报修时间',
|
297
|
|
- width:150,
|
|
327
|
+ width: 150,
|
298
|
328
|
cellTemplate: '<div>' +
|
299
|
329
|
'<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center">{{grid.appScope.transferTime(row.entity.createTime)}}</div>' +
|
300
|
330
|
'</div>'
|
|
@@ -308,7 +338,7 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
308
|
338
|
},
|
309
|
339
|
{
|
310
|
340
|
name: '操作',
|
311
|
|
- width:200,
|
|
341
|
+ width: 200,
|
312
|
342
|
cellTemplate: '<wechatoperator item="row.entity" colobject="col">',
|
313
|
343
|
enableFiltering: false
|
314
|
344
|
}
|
|
@@ -747,17 +777,17 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
747
|
777
|
$scope.timer = $interval(function () {
|
748
|
778
|
$scope.refreshData2('expand-right', $scope.fileData);
|
749
|
779
|
}, $rootScope.refreshTime);
|
750
|
|
-
|
|
780
|
+
|
751
|
781
|
console.log($state.params);
|
752
|
|
- if($state.params.tab){
|
753
|
|
- if($state.params.tab == '-1'){
|
|
782
|
+ if ($state.params.tab) {
|
|
783
|
+ if ($state.params.tab == '-1') {
|
754
|
784
|
$scope.searchstate = '';
|
755
|
785
|
$scope.fileData.wxincident = {};
|
756
|
|
- }else{
|
|
786
|
+ } else {
|
757
|
787
|
$scope.searchstate = $state.params.tab;
|
758
|
788
|
$scope.fileData.wxincident.serviceState.id = $scope.searchstate;
|
759
|
789
|
}
|
760
|
|
- }else{
|
|
790
|
+ } else {
|
761
|
791
|
//默认未受理
|
762
|
792
|
$scope.searchstate = 1650;
|
763
|
793
|
if (sessionStorage.getItem('jry_data')) {
|
|
@@ -771,11 +801,40 @@ app.controller('chartCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$
|
771
|
801
|
});
|
772
|
802
|
$scope.refreshData('expand-right', $scope.fileData);
|
773
|
803
|
}]);
|
774
|
|
-app.controller('Wechatoperator', ['$rootScope', '$http', '$scope', '$modal', function ($rootScope, $http, $scope, $modal) {
|
|
804
|
+app.controller('Wechatoperator', ['$rootScope', '$http', '$scope', '$modal', 'api_user_data', function ($rootScope, $http, $scope, $modal, api_user_data) {
|
775
|
805
|
$scope.handle = false;
|
776
|
806
|
$scope.see = false;
|
777
|
807
|
$scope.toHandle = false;
|
778
|
808
|
var loginUser = $rootScope.user;
|
|
809
|
+ // 是否是服务台经理
|
|
810
|
+ $scope.isFuwutaijingli = loginUser.role.filter(v => v.rolecode == 'call center admin').length > 0;
|
|
811
|
+ // 是否显示解除锁定
|
|
812
|
+ $scope.isUnLock = false;
|
|
813
|
+ console.log($scope.item)
|
|
814
|
+ if ($scope.item.operationLog) {
|
|
815
|
+ $scope.isUnLock = ($scope.item.operationLog.userId == loginUser.id) && ($scope.item.operationLog.opValue == 1);
|
|
816
|
+ } else {
|
|
817
|
+ $scope.isUnLock = false;
|
|
818
|
+ }
|
|
819
|
+ // 是否显示处理--锁定相关的操作
|
|
820
|
+ $scope.isChuli = false;
|
|
821
|
+ if ($scope.isFuwutaijingli) {
|
|
822
|
+ //如果有服务台经理角色
|
|
823
|
+ $scope.isChuli = true;
|
|
824
|
+ } else {
|
|
825
|
+ //如果没有服务台经理角色
|
|
826
|
+ if ($scope.item.operationLog) {
|
|
827
|
+ if ($scope.item.operationLog.opValue == 1) {
|
|
828
|
+ //如果锁定
|
|
829
|
+ $scope.isChuli = $scope.item.operationLog.userId == loginUser.id;
|
|
830
|
+ } else {
|
|
831
|
+ //如果没锁定
|
|
832
|
+ $scope.isChuli = true;
|
|
833
|
+ }
|
|
834
|
+ } else {
|
|
835
|
+ $scope.isChuli = true;
|
|
836
|
+ }
|
|
837
|
+ }
|
779
|
838
|
$scope.chuli = false;
|
780
|
839
|
for (var i = 0; i < loginUser.menu.length; i++) {
|
781
|
840
|
if (loginUser.menu[i].link == "weixinbaozhang_chuli") {
|
|
@@ -808,9 +867,186 @@ app.controller('Wechatoperator', ['$rootScope', '$http', '$scope', '$modal', fun
|
808
|
867
|
}
|
809
|
868
|
//处理
|
810
|
869
|
$scope.handleFn = function () {
|
811
|
|
- $scope.colobject.grid.appScope.toHandleFunction($scope.item);
|
|
870
|
+ console.log($scope.item)
|
|
871
|
+ // $scope.colobject.grid.appScope.toHandleFunction($scope.item);
|
|
872
|
+ //是否包含服务台经理角色
|
|
873
|
+ var isFuwutaijingli = loginUser.role.filter(v => v.rolecode == 'call center admin').length > 0;
|
|
874
|
+ if (!isFuwutaijingli) {
|
|
875
|
+ if ($scope.item.operationLog) {
|
|
876
|
+ //有锁定操作记录的
|
|
877
|
+ var p1 = {
|
|
878
|
+ idx: 0,
|
|
879
|
+ sum: 1000,
|
|
880
|
+ operationLog: {
|
|
881
|
+ id: $scope.item.operationLog.id,
|
|
882
|
+ extra1: $scope.item.id,
|
|
883
|
+ opType: 'wxincidentLock'
|
|
884
|
+ }
|
|
885
|
+ };
|
|
886
|
+ api_user_data.fetchDataList('operationLog', p1).then(function (result) {
|
|
887
|
+ if (result.status == 200) {
|
|
888
|
+ var opValue = result.list[0].opValue;//查询锁定状态
|
|
889
|
+ var userName = result.list[0].userName;//查询锁定人
|
|
890
|
+ var userId = result.list[0].userId;//查询锁定人ID
|
|
891
|
+ if (opValue == 1&&userId!=loginUser.id) {
|
|
892
|
+ //如果锁定了,并不是锁定人操作
|
|
893
|
+ $modal.open({
|
|
894
|
+ templateUrl: 'assets/views/delete.html',
|
|
895
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert) {
|
|
896
|
+ $scope.title = '提示';
|
|
897
|
+ $scope.connect = '该报修已被【' + userName + '】锁定!';
|
|
898
|
+ $scope.yesFlag = true;
|
|
899
|
+ //选择“取消”或“确定”
|
|
900
|
+ $scope.cancel = function () {
|
|
901
|
+ $modalInstance.dismiss('cancel');
|
|
902
|
+ scope.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$parent.refreshData('expand-right', $scope.fileData);
|
|
903
|
+ };
|
|
904
|
+ },
|
|
905
|
+ size: 'sm',
|
|
906
|
+ resolve: {
|
|
907
|
+ scope: function () {
|
|
908
|
+ return $scope;
|
|
909
|
+ }
|
|
910
|
+ }
|
|
911
|
+ });
|
|
912
|
+ } else if(opValue == 1&&userId==loginUser.id){
|
|
913
|
+ //如果锁定了,并是锁定人操作
|
|
914
|
+ $scope.colobject.grid.appScope.toHandleFunction($scope.item);
|
|
915
|
+ }else{
|
|
916
|
+ //如果没有锁定
|
|
917
|
+ $scope.operateUnLock($scope.item.operationLog.id)
|
|
918
|
+ }
|
|
919
|
+ }
|
|
920
|
+ })
|
|
921
|
+ } else {
|
|
922
|
+ //没有锁定记录的
|
|
923
|
+ $scope.operateUnLock();
|
|
924
|
+ }
|
|
925
|
+
|
|
926
|
+ } else {
|
|
927
|
+ $scope.colobject.grid.appScope.toHandleFunction($scope.item);
|
|
928
|
+ }
|
812
|
929
|
// $scope.doEdit($scope.item.id);
|
813
|
930
|
}
|
|
931
|
+ //是否锁定,id是日志ID,有是修改,没有是新增
|
|
932
|
+ $scope.operateUnLock = function (id) {
|
|
933
|
+ $modal.open({
|
|
934
|
+ templateUrl: 'assets/views/delete.html',
|
|
935
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert) {
|
|
936
|
+ $scope.title = '提示';
|
|
937
|
+ $scope.connect = '是否锁定?锁定后其他人(服务台经理除外)无法操作此报修!';
|
|
938
|
+ $scope.noFlag = true;
|
|
939
|
+ //选择“是”
|
|
940
|
+ $scope.yes = function () {
|
|
941
|
+ if (scope.item) {
|
|
942
|
+ var postData = {
|
|
943
|
+ operationLog: {
|
|
944
|
+ extra1: scope.item.id,
|
|
945
|
+ userId: loginUser.id,
|
|
946
|
+ userName: loginUser.name,
|
|
947
|
+ opType: 'wxincidentLock',
|
|
948
|
+ opValue: '1'
|
|
949
|
+ }
|
|
950
|
+ };
|
|
951
|
+ if(id){
|
|
952
|
+ postData.operationLog.id = id;
|
|
953
|
+ }
|
|
954
|
+ api_user_data.addData('operationLog', postData).then(function (response) {
|
|
955
|
+ if (response.data) {
|
|
956
|
+ $modalInstance.dismiss('cancel');
|
|
957
|
+ SweetAlert.swal({
|
|
958
|
+ title: "锁定成功!",
|
|
959
|
+ type: "success",
|
|
960
|
+ confirmButtonColor: "#007AFF"
|
|
961
|
+ }, function () {
|
|
962
|
+ scope.colobject.grid.appScope.toHandleFunction(scope.item);
|
|
963
|
+ });
|
|
964
|
+ } else {
|
|
965
|
+ SweetAlert.swal({
|
|
966
|
+ title: "操作异常!",
|
|
967
|
+ text: "系统异常,请稍后重试,或者联系管理员!",
|
|
968
|
+ type: "error"
|
|
969
|
+ });
|
|
970
|
+ }
|
|
971
|
+ })
|
|
972
|
+ }
|
|
973
|
+ };
|
|
974
|
+ //选择“取消”
|
|
975
|
+ $scope.cancel = function () {
|
|
976
|
+ $modalInstance.dismiss('cancel');
|
|
977
|
+ };
|
|
978
|
+ //选择“否”
|
|
979
|
+ $scope.no = function () {
|
|
980
|
+ $modalInstance.dismiss('cancel');
|
|
981
|
+ scope.colobject.grid.appScope.toHandleFunction(scope.item);
|
|
982
|
+ };
|
|
983
|
+ },
|
|
984
|
+ size: 'sm',
|
|
985
|
+ resolve: {
|
|
986
|
+ scope: function () {
|
|
987
|
+ return $scope;
|
|
988
|
+ }
|
|
989
|
+ }
|
|
990
|
+ });
|
|
991
|
+ }
|
|
992
|
+ //解锁
|
|
993
|
+ $scope.unLock = function(){
|
|
994
|
+ $modal.open({
|
|
995
|
+ templateUrl: 'assets/views/delete.html',
|
|
996
|
+ controller: function ($scope, scope, $modalInstance, api_user_data, SweetAlert) {
|
|
997
|
+ $scope.title = '提示';
|
|
998
|
+ $scope.connect = '是否解锁?';
|
|
999
|
+ $scope.noFlag = true;
|
|
1000
|
+ //选择“是”
|
|
1001
|
+ $scope.yes = function () {
|
|
1002
|
+ if (scope.item) {
|
|
1003
|
+ var postData = {
|
|
1004
|
+ operationLog: {
|
|
1005
|
+ id:scope.item.operationLog.id,
|
|
1006
|
+ extra1: scope.item.id,
|
|
1007
|
+ userId: loginUser.id,
|
|
1008
|
+ userName: loginUser.name,
|
|
1009
|
+ opType: 'wxincidentLock',
|
|
1010
|
+ opValue: '0'
|
|
1011
|
+ }
|
|
1012
|
+ };
|
|
1013
|
+ api_user_data.addData('operationLog', postData).then(function (response) {
|
|
1014
|
+ if (response.data) {
|
|
1015
|
+ $modalInstance.dismiss('cancel');
|
|
1016
|
+ SweetAlert.swal({
|
|
1017
|
+ title: "解锁成功!",
|
|
1018
|
+ type: "success",
|
|
1019
|
+ confirmButtonColor: "#007AFF"
|
|
1020
|
+ }, function () {
|
|
1021
|
+ scope.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$parent.refreshData('expand-right', $scope.fileData);
|
|
1022
|
+ });
|
|
1023
|
+ } else {
|
|
1024
|
+ SweetAlert.swal({
|
|
1025
|
+ title: "操作异常!",
|
|
1026
|
+ text: "系统异常,请稍后重试,或者联系管理员!",
|
|
1027
|
+ type: "error"
|
|
1028
|
+ });
|
|
1029
|
+ }
|
|
1030
|
+ })
|
|
1031
|
+ }
|
|
1032
|
+ };
|
|
1033
|
+ //选择“取消”
|
|
1034
|
+ $scope.cancel = function () {
|
|
1035
|
+ $modalInstance.dismiss('cancel');
|
|
1036
|
+ };
|
|
1037
|
+ //选择“否”
|
|
1038
|
+ $scope.no = function () {
|
|
1039
|
+ $modalInstance.dismiss('cancel');
|
|
1040
|
+ };
|
|
1041
|
+ },
|
|
1042
|
+ size: 'sm',
|
|
1043
|
+ resolve: {
|
|
1044
|
+ scope: function () {
|
|
1045
|
+ return $scope;
|
|
1046
|
+ }
|
|
1047
|
+ }
|
|
1048
|
+ });
|
|
1049
|
+ }
|
814
|
1050
|
//查看事件
|
815
|
1051
|
$scope.seeIncident = function () {
|
816
|
1052
|
$scope.colobject.grid.appScope.seeIncidentFunction($scope.item);
|
|
@@ -828,7 +1064,8 @@ app.directive('wechatoperator', function () {
|
828
|
1064
|
template: '<div class="links cl-effect-1 ui-grid-cell-contents pull-left" >' +
|
829
|
1065
|
// '<a ng-click="edit()" ng-show="{{handle}}" tooltip="生成事件" tooltip-placement="left">生成事件</a>' +
|
830
|
1066
|
// '<a ng-click="edit()" class="bianjifont">生成事件</a>' +
|
831
|
|
- '<a ng-click="handleFn()" ng-show="{{handle&&chuli}}" class="bianjifont">处理</a>' +
|
|
1067
|
+ '<a ng-click="handleFn()" ng-show="{{(handle&&chuli)&&isChuli}}" class="bianjifont">处理</a>' +
|
|
1068
|
+ '<a ng-click="unLock()" ng-show="{{isUnLock}}" class="bianjifont">解除锁定</a>' +
|
832
|
1069
|
'<a ng-click="look()" ng-show="{{see}}" class="bianjifont">查看</a>' +
|
833
|
1070
|
// '<a ng-click="look()" ng-show="{{toHandle}}" class="bianjifont">查看详情</a>' +
|
834
|
1071
|
'<a ng-click="seeIncident()" ng-show="{{toHandle}}" class="bianjifont">查看事件</a>' +
|