Commit 1a360f97 authored by 13841799530's avatar 13841799530

解润东

20220517
巡查记录分页
parent 8f0df435
Pipeline #8350 passed with stage
in 5 minutes and 5 seconds
...@@ -154,6 +154,7 @@ export default { ...@@ -154,6 +154,7 @@ export default {
}, },
methods: { methods: {
tabChange(name,title){ tabChange(name,title){
console.log(title)
this.page=1 this.page=1
this.hdType=title this.hdType=title
this.messageList=[] this.messageList=[]
......
...@@ -22,6 +22,13 @@ ...@@ -22,6 +22,13 @@
<!-- v-for="(item, index) in messageList" <!-- v-for="(item, index) in messageList"
:key="index" :key="index"
@click="touchstart(index, item)"--> @click="touchstart(index, item)"-->
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model="Loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell-group inset @click="touchstart(item)" v-for="(item, index) in patrolList" :key="index"> <van-cell-group inset @click="touchstart(item)" v-for="(item, index) in patrolList" :key="index">
<van-row gutte> <van-row gutte>
<van-col span="10"> <van-col span="10">
...@@ -57,6 +64,8 @@ ...@@ -57,6 +64,8 @@
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
</van-list>
</van-pull-refresh>
</div> </div>
<!-- 暂无数据 --> <!-- 暂无数据 -->
<!-- v-if="isHaveNews" --> <!-- v-if="isHaveNews" -->
...@@ -100,6 +109,12 @@ export default { ...@@ -100,6 +109,12 @@ export default {
return { return {
startTime:'', startTime:'',
endTime:'', endTime:'',
Loading: false,
finished: false,
refreshing:false,
total:0,//总条数
page:1,//页码
psize:5,//页数量
date: '', date: '',
id:'',//巡查周期id id:'',//巡查周期id
text: this.$route.query.content?this.$route.query.content:"巡查记录", text: this.$route.query.content?this.$route.query.content:"巡查记录",
...@@ -184,14 +199,24 @@ export default { ...@@ -184,14 +199,24 @@ export default {
var obj={ var obj={
cycle:this.id, cycle:this.id,
startTime:this.startTime, startTime:this.startTime,
endTime:this.endTime endTime:this.endTime,
page:this.page,
psize:this.psize,
} }
this.patrolList=[]
getFun('patrol/list',obj).then((res)=>{ getFun('patrol/list',obj).then((res)=>{
this.patrolList=res.data res.rows.forEach((item)=>{
this.patrolList.push(item)
})
this.patrolList.forEach((i)=>{ this.patrolList.forEach((i)=>{
i.show=false i.show=false
}) })
//防止分页超出操作
this.page++
this.total=res.rows.total
if (this.patrolList.length>=this.total) {
this.finished = true;
}
this.Loading = false
}) })
}, },
onSearch(val) { onSearch(val) {
...@@ -201,7 +226,22 @@ export default { ...@@ -201,7 +226,22 @@ export default {
item.show = true item.show = true
this.$forceUpdate() this.$forceUpdate()
}, },
//下拉页面刷新
onRefresh() {
// 清空列表数据
this.page=1
this.finished = false;
this.Loading=true
this.onLoad();
},
//上拉页面加载数据
onLoad() {
if (this.refreshing) {
this.patrolList=[]
this.refreshing = false;
}
this.loading()
},
// 详情 // 详情
goDetail(data) { goDetail(data) {
console.log(data) console.log(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment