|
@@ -3,7 +3,7 @@
|
|
|
<scroll-view scroll-y="true" class="check-map-list">
|
|
|
<tm-top-menu>
|
|
|
<view class="top-menu" @click="showModalHandle(!showModal)">
|
|
|
- <text>第{{checkIndex}}/{{planList.length}}次查核</text>
|
|
|
+ <text>{{createTitle}}</text>
|
|
|
<image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
|
|
|
</view>
|
|
|
</tm-top-menu>
|
|
@@ -77,12 +77,13 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- checkIndex: function() {
|
|
|
- let index = this.planList.findIndex((item)=> item.id === this.checkId);
|
|
|
- if(index !== -1) {
|
|
|
- return index + 1;
|
|
|
+ createTitle: function() {
|
|
|
+ let item = this.planList.find((item)=> item.id === this.checkId);
|
|
|
+ if(item) {
|
|
|
+ let name = item.name;
|
|
|
+ return name.slice(0, name.length - 3) + `/${this.planList.length}` + name.slice(-3);
|
|
|
} else {
|
|
|
- return 0;
|
|
|
+ return '';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -90,8 +91,8 @@
|
|
|
this.dispatch('planList', {situationId}).then((data)=>{
|
|
|
if(data) {
|
|
|
this.planList = data;
|
|
|
- let check = data.find((item)=> Number(item.status)=== 2);
|
|
|
- this.checkId = check ? check.id
|
|
|
+ let checkArr = data.filter((item)=> Number(item.status)=== 2).sort((a,b)=>a.createTime - b.createTime);
|
|
|
+ this.checkId = checkArr ? checkArr[checkArr.length - 1].id
|
|
|
: data.length > 0 ? data[0].id : '';
|
|
|
this.getDepList();
|
|
|
}
|