Commit 96828b88 by LJM

按货品上架分页优化

parent a189f224
Showing with 25 additions and 12 deletions
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
is_submit: true, is_submit: true,
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 1000, limit: 50,
index: 0, index: 0,
array: ['入库批次号', '全量搜索'], array: ['入库批次号', '全量搜索'],
list: [], list: [],
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
warehouse_id: '', warehouse_id: '',
stock_in_type: '', stock_in_type: '',
hasMoreData: true, //是否分页加载
formParams: { formParams: {
position_code: '' position_code: ''
}, },
...@@ -172,6 +173,13 @@ ...@@ -172,6 +173,13 @@
} }
}; };
}, },
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
console.log(e); console.log(e);
if (e.index == 0) { if (e.index == 0) {
...@@ -430,9 +438,14 @@ ...@@ -430,9 +438,14 @@
getData(callback) { getData(callback) {
this.request(API.getPendingShelfByBatchSn, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(API.getPendingShelfByBatchSn, '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.filter_list = createArray(this.list.length, false); this.hasMoreData = true;
typeof callback == 'function' && callback(res.data.list, res.data.msg); this.list = this.list.concat(res.data.list);
this.filter_list = createArray(this.list.length, false);
typeof callback == 'function' && callback(res.data.list, res.data.msg);
} else {
this.hasMoreData = false;
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
......
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统 // const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统 // const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统 // const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统 // const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统 const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统 const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统 const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统 const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = { const API = {
......
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