|
@@ -11,7 +11,7 @@
|
11
|
11
|
v-model="title"
|
12
|
12
|
placeholder="搜索"
|
13
|
13
|
@input="searchData()"
|
14
|
|
- >
|
|
14
|
+ />
|
15
|
15
|
</div>
|
16
|
16
|
<button class="selectBtn fr" @click="showPicker">筛选</button>
|
17
|
17
|
</div>
|
|
@@ -30,31 +30,49 @@
|
30
|
30
|
@change="stateChange()"
|
31
|
31
|
></cube-select>-->
|
32
|
32
|
<div class="conentBox">
|
33
|
|
- <div class="conent" v-for="(item,index) in items" @click="toDetail(item)" :key="index">
|
|
33
|
+ <div
|
|
34
|
+ class="conent"
|
|
35
|
+ v-for="(item, index) in items"
|
|
36
|
+ @click="toDetail(item)"
|
|
37
|
+ :key="index"
|
|
38
|
+ >
|
34
|
39
|
<div class="head">
|
35
|
40
|
<p>
|
36
|
41
|
<i class="iconfont icon-zuixinbaoxiu newPapir"></i>
|
37
|
|
- 巡检单号:{{item.sign}}
|
|
42
|
+ 巡检单号:{{ item.sign }}
|
38
|
43
|
<span
|
39
|
|
- :class="{'btn':true, 'zhixingzhong':item.state==0,'yiwancheng':item.state==1}"
|
40
|
|
- >{{item.stateName}}</span>
|
|
44
|
+ :class="{
|
|
45
|
+ btn: true,
|
|
46
|
+ zhixingzhong: item.state == 0,
|
|
47
|
+ yiwancheng: item.state == 1
|
|
48
|
+ }"
|
|
49
|
+ >{{ item.stateName }}</span
|
|
50
|
+ >
|
41
|
51
|
</p>
|
42
|
52
|
</div>
|
43
|
53
|
<div class="center">
|
44
|
54
|
<p>
|
45
|
55
|
<span class="fl">巡检主题:</span>
|
46
|
|
- <span class="grayFont overflowEllipsis2">{{item.inspection.title}}</span>
|
|
56
|
+ <span class="grayFont overflowEllipsis2">{{
|
|
57
|
+ item.inspection.title
|
|
58
|
+ }}</span>
|
47
|
59
|
</p>
|
48
|
60
|
</div>
|
49
|
61
|
<div class="bottom">
|
50
|
62
|
<i
|
51
|
|
- :class="{'iconfont':true ,'icon-yiyuqi':item.overdueType==0 ,'icon-zhengchang':item.overdueType==1,'icon-jijiang':item.overdueType==2,'newPapir':true}"
|
|
63
|
+ :class="{
|
|
64
|
+ iconfont: true,
|
|
65
|
+ 'icon-yiyuqi': item.overdueType == 0,
|
|
66
|
+ 'icon-zhengchang': item.overdueType == 1,
|
|
67
|
+ 'icon-jijiang': item.overdueType == 2,
|
|
68
|
+ newPapir: true
|
|
69
|
+ }"
|
52
|
70
|
></i>
|
53
|
|
- <span>逾期时间:{{item.overdueTime}}</span>
|
|
71
|
+ <span>逾期时间:{{ item.overdueTime }}</span>
|
54
|
72
|
</div>
|
55
|
73
|
</div>
|
56
|
74
|
<div class="wushuju" v-show="wushuju">
|
57
|
|
- <img src="./../../static/images/wushuju.svg" alt>
|
|
75
|
+ <img src="./../../static/images/wushuju.svg" alt />
|
58
|
76
|
<p>暂无巡检</p>
|
59
|
77
|
</div>
|
60
|
78
|
</div>
|
|
@@ -67,9 +85,14 @@
|
67
|
85
|
<div
|
68
|
86
|
v-show="props.beforePullDown"
|
69
|
87
|
class="before-trigger"
|
70
|
|
- :style="{paddingTop: props.bubbleY + 'px'}"
|
|
88
|
+ :style="{ paddingTop: props.bubbleY + 'px' }"
|
71
|
89
|
>
|
72
|
|
- <span :class="{rotate: props.bubbleY > pullDownRefreshThreshold - 40}">↓</span>
|
|
90
|
+ <span
|
|
91
|
+ :class="{
|
|
92
|
+ rotate: props.bubbleY > pullDownRefreshThreshold - 40
|
|
93
|
+ }"
|
|
94
|
+ >↓</span
|
|
95
|
+ >
|
73
|
96
|
</div>
|
74
|
97
|
<div class="after-trigger" v-show="!props.beforePullDown">
|
75
|
98
|
<div v-show="props.isPullingDown" class="loading">
|
|
@@ -85,7 +108,7 @@
|
85
|
108
|
</div>
|
86
|
109
|
</div>
|
87
|
110
|
</div>
|
88
|
|
- <load-ing v-if="!items.length&&!wushuju"></load-ing>
|
|
111
|
+ <load-ing v-if="!items.length && !wushuju"></load-ing>
|
89
|
112
|
</div>
|
90
|
113
|
</template>
|
91
|
114
|
<script>
|
|
@@ -101,6 +124,7 @@ export default {
|
101
|
124
|
return {
|
102
|
125
|
// items: _foods,
|
103
|
126
|
loginUser: JSON.parse(localStorage.getItem("loginUser")),
|
|
127
|
+ menu: JSON.parse(localStorage.getItem("menu")),
|
104
|
128
|
valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
|
105
|
129
|
items: [],
|
106
|
130
|
pullDownRefresh: true,
|
|
@@ -128,12 +152,12 @@ export default {
|
128
|
152
|
value: "done"
|
129
|
153
|
}
|
130
|
154
|
],
|
131
|
|
- stateValue: "all",
|
|
155
|
+ stateValue: "todo",
|
132
|
156
|
sum: 10,
|
133
|
157
|
idx: 0,
|
134
|
158
|
stateClass: "",
|
135
|
159
|
loadShow: true,
|
136
|
|
- searching:false,
|
|
160
|
+ searching: false
|
137
|
161
|
};
|
138
|
162
|
},
|
139
|
163
|
components: {
|
|
@@ -176,10 +200,11 @@ export default {
|
176
|
200
|
toDetail(item) {
|
177
|
201
|
console.log(item);
|
178
|
202
|
// return;2020年4月27日23:44:23
|
179
|
|
- var bxr = JSON.parse(localStorage.getItem("login_requester"));//bababa
|
180
|
|
- item.processUser.name = bxr.name;
|
181
|
|
- item.processUser.phone = bxr.mphone;
|
182
|
|
-
|
|
203
|
+ var bxr = JSON.parse(localStorage.getItem("login_requester")); //bababa
|
|
204
|
+ if(item.processUser){
|
|
205
|
+ item.processUser.name = bxr.name;
|
|
206
|
+ item.processUser.phone = bxr.mphone;
|
|
207
|
+ }
|
183
|
208
|
if (item.state == 1) {
|
184
|
209
|
this.$router.push({
|
185
|
210
|
name: "InspectionDoneDetail",
|
|
@@ -188,16 +213,77 @@ export default {
|
188
|
213
|
}
|
189
|
214
|
});
|
190
|
215
|
} else {
|
191
|
|
- this.$router.push({
|
192
|
|
- name: "InspectionDetail",
|
193
|
|
- params: {
|
194
|
|
- data: item
|
|
216
|
+ let chuli = false;
|
|
217
|
+ let chuliFlag = false;
|
|
218
|
+ // 判断权限
|
|
219
|
+ for (let i = 0; i < this.menu.length; i++) {
|
|
220
|
+ if (this.menu[i].link == "xunjianliebiao_chuli") {
|
|
221
|
+ chuli = true;
|
195
|
222
|
}
|
196
|
|
- });
|
|
223
|
+ }
|
|
224
|
+ //判断状态和对象
|
|
225
|
+ if (item.inspection.dictionary.value == 1) {
|
|
226
|
+ // 按巡检人员
|
|
227
|
+ if (
|
|
228
|
+ item.processUser.id == this.loginUser.id &&
|
|
229
|
+ item.stateName == "执行中"
|
|
230
|
+ ) {
|
|
231
|
+ chuliFlag = true;
|
|
232
|
+ } else {
|
|
233
|
+ chuliFlag = false;
|
|
234
|
+ }
|
|
235
|
+ } else if (item.inspection.dictionary.value == 3) {
|
|
236
|
+ // 按工作组
|
|
237
|
+ var hasGroup = this.loginUser.group.some(v => v.id == item.group.id);
|
|
238
|
+ if (hasGroup && item.stateName == "执行中") {
|
|
239
|
+ chuliFlag = true;
|
|
240
|
+ } else {
|
|
241
|
+ chuliFlag = false;
|
|
242
|
+ }
|
|
243
|
+ } else if (item.inspection.dictionary.value == 4) {
|
|
244
|
+ // 系统默认
|
|
245
|
+ if (item.online) {
|
|
246
|
+ // 线上人
|
|
247
|
+ if (
|
|
248
|
+ item.processUser.id == this.loginUser.id &&
|
|
249
|
+ item.stateName == "执行中"
|
|
250
|
+ ) {
|
|
251
|
+ chuliFlag = true;
|
|
252
|
+ } else {
|
|
253
|
+ chuliFlag = false;
|
|
254
|
+ }
|
|
255
|
+ } else {
|
|
256
|
+ // 线下组
|
|
257
|
+ var hasGroup = this.loginUser.group.some(
|
|
258
|
+ v => v.id == item.group.id
|
|
259
|
+ );
|
|
260
|
+ if (hasGroup && item.stateName == "执行中") {
|
|
261
|
+ chuliFlag = true;
|
|
262
|
+ } else {
|
|
263
|
+ chuliFlag = false;
|
|
264
|
+ }
|
|
265
|
+ }
|
|
266
|
+ }
|
|
267
|
+ if (chuli && chuliFlag) {
|
|
268
|
+ this.$router.push({
|
|
269
|
+ name: "InspectionDetail",
|
|
270
|
+ params: {
|
|
271
|
+ data: item
|
|
272
|
+ }
|
|
273
|
+ });
|
|
274
|
+ } else {
|
|
275
|
+ this.$router.push({
|
|
276
|
+ name: "InspectionDoneDetail",
|
|
277
|
+ params: {
|
|
278
|
+ data: item
|
|
279
|
+ }
|
|
280
|
+ });
|
|
281
|
+ }
|
197
|
282
|
}
|
198
|
283
|
window.localStorage.setItem("insDetailInfo", JSON.stringify(item));
|
199
|
284
|
},
|
200
|
285
|
getParamsState() {
|
|
286
|
+ console.log(this.$route.params.state)
|
201
|
287
|
if (this.$route.params.state) {
|
202
|
288
|
console.log(this.$route.params.state);
|
203
|
289
|
this.stateValue = this.$route.params.state;
|
|
@@ -208,7 +294,7 @@ export default {
|
208
|
294
|
this.picker = this.$createPicker({
|
209
|
295
|
title: "",
|
210
|
296
|
data: [this.stateData],
|
211
|
|
- selectedIndex: this.$route.params.state ? [1] : [0],
|
|
297
|
+ selectedIndex: [1],
|
212
|
298
|
onSelect: this.selectHandle,
|
213
|
299
|
onCancel: this.cancelHandle
|
214
|
300
|
});
|
|
@@ -226,29 +312,44 @@ export default {
|
226
|
312
|
// 搜索
|
227
|
313
|
searchData() {
|
228
|
314
|
this.items = [];
|
229
|
|
- this.searching=true;
|
|
315
|
+ this.searching = true;
|
230
|
316
|
this.getData();
|
231
|
317
|
},
|
232
|
318
|
// 获取列表
|
233
|
319
|
getData() {
|
|
320
|
+ console.log(this.stateValue);
|
234
|
321
|
var that = this;
|
235
|
322
|
// that.items.length=0;
|
|
323
|
+ let postData = {
|
|
324
|
+ assignee: that.loginUser.id,
|
|
325
|
+ idx: that.idx,
|
|
326
|
+ sum: that.sum,
|
|
327
|
+ inspectionProcessActual: {
|
|
328
|
+ // inspection: {
|
|
329
|
+ // title: that.title,
|
|
330
|
+ // executeUser: { id: that.loginUser.id }
|
|
331
|
+ // }
|
|
332
|
+ typeSearch: that.title
|
|
333
|
+ // processUser:{
|
|
334
|
+ // id:that.loginUser.id
|
|
335
|
+ // }
|
|
336
|
+ },
|
|
337
|
+ searchType: that.stateValue
|
|
338
|
+ };
|
|
339
|
+ if (that.stateValue === "todo") {
|
|
340
|
+ // 待处理添加筛选条件
|
|
341
|
+ console.log(postData, "2022年5月30日");
|
|
342
|
+ postData.candidateGroups = that.loginUser.group
|
|
343
|
+ .map(v => v.id)
|
|
344
|
+ .toString();
|
|
345
|
+ } else {
|
|
346
|
+ delete postData.candidateGroups;
|
|
347
|
+ }
|
236
|
348
|
this.$http
|
237
|
|
- .post("service/bpm/InspectionProcessActual/fetchServiceTasks/ALL", {
|
238
|
|
- assignee: that.loginUser.id,
|
239
|
|
- idx: that.idx,
|
240
|
|
- sum: that.sum,
|
241
|
|
- inspectionProcessActual: {
|
242
|
|
- // inspection: {
|
243
|
|
- // title: that.title,
|
244
|
|
- // executeUser: { id: that.loginUser.id }
|
245
|
|
- // }
|
246
|
|
- processUser:{
|
247
|
|
- id:that.loginUser.id
|
248
|
|
- }
|
249
|
|
- },
|
250
|
|
- searchType: that.stateValue
|
251
|
|
- })
|
|
349
|
+ .post(
|
|
350
|
+ "service/bpm/InspectionProcessActual/fetchServiceTasks/ALL",
|
|
351
|
+ postData
|
|
352
|
+ )
|
252
|
353
|
.then(function(res) {
|
253
|
354
|
if (res.data.data.length > 0) {
|
254
|
355
|
that.wushuju = false;
|
|
@@ -260,9 +361,9 @@ export default {
|
260
|
361
|
);
|
261
|
362
|
}
|
262
|
363
|
}
|
263
|
|
- if(that.searching){
|
264
|
|
- that.items =res.data.data;
|
265
|
|
- }else{
|
|
364
|
+ if (that.searching) {
|
|
365
|
+ that.items = res.data.data;
|
|
366
|
+ } else {
|
266
|
367
|
that.items = that.items.concat(res.data.data);
|
267
|
368
|
}
|
268
|
369
|
} else {
|
|
@@ -276,7 +377,7 @@ export default {
|
276
|
377
|
var that = this;
|
277
|
378
|
that.items = [];
|
278
|
379
|
that.idx = 0;
|
279
|
|
- that.searching=false;
|
|
380
|
+ that.searching = false;
|
280
|
381
|
setTimeout(() => {
|
281
|
382
|
that.getData();
|
282
|
383
|
}, 1000);
|
|
@@ -284,7 +385,7 @@ export default {
|
284
|
385
|
onPullingUp() {
|
285
|
386
|
var that = this;
|
286
|
387
|
that.idx = that.idx + 1;
|
287
|
|
- that.searching=false;
|
|
388
|
+ that.searching = false;
|
288
|
389
|
that.getData();
|
289
|
390
|
},
|
290
|
391
|
updatePullDownRefresh(val) {
|
|
@@ -432,7 +533,7 @@ export default {
|
432
|
533
|
}
|
433
|
534
|
}
|
434
|
535
|
</style>
|
435
|
|
-<style lang='less' scoped>
|
|
536
|
+<style lang="less" scoped>
|
436
|
537
|
.bgColor {
|
437
|
538
|
background-color: white;
|
438
|
539
|
}
|