Commit 627a2326 by LJM

加入分页

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