|
@@ -3,12 +3,20 @@
|
3
|
3
|
<div slot="content" class="scroll-wrapper">
|
4
|
4
|
<div class="demo">
|
5
|
5
|
<div class="header">事件列表</div>
|
6
|
|
- <cube-select
|
7
|
|
- class="stateSearch"
|
8
|
|
- v-model="searchType"
|
9
|
|
- :options="searchsType"
|
10
|
|
- @change="stateChange()"
|
11
|
|
- ></cube-select>
|
|
6
|
+ <div class="stateSearchWrap">
|
|
7
|
+ <cube-select
|
|
8
|
+ class="stateSearch"
|
|
9
|
+ v-model="searchType"
|
|
10
|
+ :options="searchsType"
|
|
11
|
+ @change="typeChange()"
|
|
12
|
+ ></cube-select>
|
|
13
|
+ <cube-select
|
|
14
|
+ class="stateSearch"
|
|
15
|
+ v-model="searchState"
|
|
16
|
+ :options="searchsState"
|
|
17
|
+ @change="typeChange()"
|
|
18
|
+ ></cube-select>
|
|
19
|
+ </div>
|
12
|
20
|
<div class="scroll-list-wrap">
|
13
|
21
|
<cube-scroll
|
14
|
22
|
ref="scroll"
|
|
@@ -188,6 +196,7 @@ export default {
|
188
|
196
|
disjunctor: false
|
189
|
197
|
},
|
190
|
198
|
isAssign: false, //是否有权限指派
|
|
199
|
+ isAll: false, //是否显示全部事件
|
191
|
200
|
loginUser: JSON.parse(localStorage.getItem("loginUser")),
|
192
|
201
|
valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
|
193
|
202
|
items: [],
|
|
@@ -203,15 +212,11 @@ export default {
|
203
|
212
|
candidateGroups: "",
|
204
|
213
|
searchsType: [
|
205
|
214
|
{
|
206
|
|
- text: "全部",
|
207
|
|
- value: "userAll"
|
208
|
|
- },
|
209
|
|
- {
|
210
|
|
- text: "待处理",
|
|
215
|
+ text: "待我处理",
|
211
|
216
|
value: "todo"
|
212
|
217
|
},
|
213
|
218
|
{
|
214
|
|
- text: "处理过",
|
|
219
|
+ text: "与我关联",
|
215
|
220
|
value: "done"
|
216
|
221
|
}
|
217
|
222
|
// {
|
|
@@ -219,8 +224,11 @@ export default {
|
219
|
224
|
// value: "create"
|
220
|
225
|
// }
|
221
|
226
|
],
|
222
|
|
- searchType: "userAll",
|
|
227
|
+ searchsState:[],//状态列表
|
|
228
|
+ searchType: "all",
|
|
229
|
+ searchState: 0,
|
223
|
230
|
type: "all",
|
|
231
|
+ isToday: "",
|
224
|
232
|
sum: 10,
|
225
|
233
|
idx: 0,
|
226
|
234
|
stateClass: "",
|
|
@@ -405,22 +413,22 @@ export default {
|
405
|
413
|
getParamsState() {
|
406
|
414
|
if (this.$route.params.type) {
|
407
|
415
|
this.type = this.$route.params.type;
|
|
416
|
+ this.isToday = this.$route.params.isToday;
|
408
|
417
|
if (this.type === "todo") {
|
409
|
418
|
this.searchType = "todo";
|
410
|
419
|
} else if (this.type === "done") {
|
411
|
420
|
this.searchType = "done";
|
412
|
421
|
} else {
|
413
|
|
- this.searchType = "userAll";
|
|
422
|
+ this.searchType = "all";
|
414
|
423
|
}
|
415
|
424
|
}
|
416
|
425
|
},
|
417
|
|
- stateChange() {
|
418
|
|
- var that = this;
|
|
426
|
+ typeChange() {
|
419
|
427
|
this.loadShow = true;
|
420
|
|
- that.items = [];
|
421
|
|
- that.idx = 0;
|
422
|
|
- that.sum = 10;
|
423
|
|
- that.getData();
|
|
428
|
+ this.items = [];
|
|
429
|
+ this.idx = 0;
|
|
430
|
+ this.sum = 10;
|
|
431
|
+ this.getData();
|
424
|
432
|
},
|
425
|
433
|
toIncidentDetails(data) {
|
426
|
434
|
console.log(1111111);
|
|
@@ -452,25 +460,53 @@ export default {
|
452
|
460
|
},
|
453
|
461
|
|
454
|
462
|
getData() {
|
455
|
|
- var that = this;
|
456
|
463
|
let postData = {
|
457
|
|
- assignee: that.loginUser.id,
|
458
|
|
- candidateGroups: that.candidateGroups,
|
459
|
|
- searchType: that.searchType,
|
460
|
|
- idx: that.idx,
|
461
|
|
- sum: that.sum,
|
462
|
|
- incident: { temporary: true }
|
|
464
|
+ assignee: this.loginUser.id,
|
|
465
|
+ candidateGroups: this.candidateGroups,
|
|
466
|
+ searchType: this.searchType,
|
|
467
|
+ idx: this.idx,
|
|
468
|
+ sum: this.sum,
|
|
469
|
+ incident: { temporary: true,statusId:this.searchState?this.searchState:undefined }
|
463
|
470
|
};
|
464
|
|
- if (this.type === "today") {
|
|
471
|
+ if (this.isToday == "today") {
|
465
|
472
|
postData.incident.acceptDate =
|
466
|
473
|
formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
|
467
|
474
|
postData.incident.acceptDateEnd =
|
468
|
475
|
formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
|
469
|
476
|
}
|
470
|
|
-
|
471
|
|
- that.$http
|
|
477
|
+ if(this.searchType === 'all'){
|
|
478
|
+ // 全部事件
|
|
479
|
+ if(this.loginUser.duty){
|
|
480
|
+ // 当前的所属责任科室
|
|
481
|
+ postData.incident.duty = this.loginUser.duty;
|
|
482
|
+ }else if(this.loginUser.branch){
|
|
483
|
+ // 当前的所属院区
|
|
484
|
+ postData.incident.branch = this.loginUser.branch.id;
|
|
485
|
+ }
|
|
486
|
+ this.$http
|
|
487
|
+ .post("service/user/data/fetchDataList/incident", postData)
|
|
488
|
+ .then((res) => {
|
|
489
|
+ if (res.data.list.length > 0) {
|
|
490
|
+ for (var i = 0; i < res.data.list.length; i++) {
|
|
491
|
+ res.data.list[i].createTime = formatDate(
|
|
492
|
+ new Date(res.data.list[i].createTime),
|
|
493
|
+ "yyyy-MM-dd hh:mm"
|
|
494
|
+ );
|
|
495
|
+ }
|
|
496
|
+ if (this.idx) {
|
|
497
|
+ this.items = this.items.concat(res.data.list);
|
|
498
|
+ } else {
|
|
499
|
+ this.items = res.data.list;
|
|
500
|
+ }
|
|
501
|
+ } else {
|
|
502
|
+ this.pullUpLoad = false;
|
|
503
|
+ }
|
|
504
|
+ this.loadShow = false;
|
|
505
|
+ });
|
|
506
|
+ }else{
|
|
507
|
+ this.$http
|
472
|
508
|
.post("service/bpm/bpm/fetchTask/bpm_incident", postData)
|
473
|
|
- .then(function(res) {
|
|
509
|
+ .then((res) => {
|
474
|
510
|
if (res.data.data.length > 0) {
|
475
|
511
|
for (var i = 0; i < res.data.data.length; i++) {
|
476
|
512
|
res.data.data[i].createTime = formatDate(
|
|
@@ -478,16 +514,17 @@ export default {
|
478
|
514
|
"yyyy-MM-dd hh:mm"
|
479
|
515
|
);
|
480
|
516
|
}
|
481
|
|
- if (that.idx) {
|
482
|
|
- that.items = that.items.concat(res.data.data);
|
|
517
|
+ if (this.idx) {
|
|
518
|
+ this.items = this.items.concat(res.data.data);
|
483
|
519
|
} else {
|
484
|
|
- that.items = res.data.data;
|
|
520
|
+ this.items = res.data.data;
|
485
|
521
|
}
|
486
|
522
|
} else {
|
487
|
|
- that.pullUpLoad = false;
|
|
523
|
+ this.pullUpLoad = false;
|
488
|
524
|
}
|
489
|
|
- that.loadShow = false;
|
|
525
|
+ this.loadShow = false;
|
490
|
526
|
});
|
|
527
|
+ }
|
491
|
528
|
},
|
492
|
529
|
onPullingDown() {
|
493
|
530
|
var that = this;
|
|
@@ -531,6 +568,14 @@ export default {
|
531
|
568
|
this.$refs.scroll.destroy();
|
532
|
569
|
this.$refs.scroll.initScroll();
|
533
|
570
|
});
|
|
571
|
+ },
|
|
572
|
+ // 获取事件状态
|
|
573
|
+ getStateList(){
|
|
574
|
+ this.$http
|
|
575
|
+ .post("service/common/common/getDictionary", {"type":"list","key":"incident_status"})
|
|
576
|
+ .then((res) => {
|
|
577
|
+ this.searchsState = [{text:'全部',value:0},...res.data.map(v=>({text:v.name,value:v.id}))]
|
|
578
|
+ });
|
534
|
579
|
}
|
535
|
580
|
},
|
536
|
581
|
created() {
|
|
@@ -538,6 +583,13 @@ export default {
|
538
|
583
|
let menu = JSON.parse(localStorage.getItem("menu"));
|
539
|
584
|
if (menu) {
|
540
|
585
|
this.isAssign = menu.some(v => v.link == "shijianliebiao_assign");
|
|
586
|
+ this.isAll = menu.some(v => v.link == "shijianliebiao_all");
|
|
587
|
+ if(this.isAll){
|
|
588
|
+ this.searchsType.unshift({
|
|
589
|
+ text: "全部事件",
|
|
590
|
+ value: "all"
|
|
591
|
+ })
|
|
592
|
+ }
|
541
|
593
|
}
|
542
|
594
|
that.loginUser.group.forEach(element => {
|
543
|
595
|
that.candidateGroups += element.id + ",";
|
|
@@ -549,6 +601,7 @@ export default {
|
549
|
601
|
this.getParamsState();
|
550
|
602
|
this.loadShow = true;
|
551
|
603
|
this.getData();
|
|
604
|
+ this.getStateList();
|
552
|
605
|
|
553
|
606
|
localStorage.removeItem("modelData");
|
554
|
607
|
// localStorage.removeItem("category");
|
|
@@ -698,11 +751,15 @@ export default {
|
698
|
751
|
top: 0;
|
699
|
752
|
z-index: 6;
|
700
|
753
|
}
|
701
|
|
-.stateSearch {
|
|
754
|
+.stateSearchWrap{
|
702
|
755
|
width: 100%;
|
703
|
756
|
position: fixed;
|
704
|
757
|
top: 0.88rem;
|
705
|
758
|
z-index: 6;
|
|
759
|
+ display: flex;
|
|
760
|
+ .stateSearch {
|
|
761
|
+ flex: 1;
|
|
762
|
+ }
|
706
|
763
|
}
|
707
|
764
|
.bgColor {
|
708
|
765
|
background-color: white;
|