Commit 627a2326 by LJM

加入分页

parent 7256909d
Showing with 17 additions and 1 deletions
......@@ -85,6 +85,9 @@ export default {
index: 0,
array: ['出库单号'],
list: [],
page: 1,
limit: 20,
hasMoreData: true, //是否分页加载
searchParams: {
stock_out_sn: '' //出库单号
}
......@@ -97,6 +100,13 @@ export default {
});
}
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onShow() {
this.getData();
},
......@@ -124,6 +134,7 @@ export default {
} else {
this.input_flag = false;
}
y;
this.getData();
}, 500),
/**
......@@ -155,7 +166,12 @@ export default {
getData() {
this.request(API.getTakedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
if (res.data.total > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
......
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 sign in to comment