Commit 067af4b2 by LJM

js

parent 893a1180
{ {
"name" : "wmsApp", "name" : "wms",
"appid" : "__UNI__655E80D", "appid" : "__UNI__655E80D",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
......
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
return { return {
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 10, limit: 30,
index: 0, index: 0,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
list: [], list: [],
...@@ -220,6 +220,7 @@ export default { ...@@ -220,6 +220,7 @@ export default {
this.getWareHouselist(); this.getWareHouselist();
}, },
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
...@@ -284,13 +285,14 @@ export default { ...@@ -284,13 +285,14 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
} else if (this.index == 1) { } else if (this.index == 1) {
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
} else if (this.index == 2) { } else if (this.index == 2) {
this.searchParams.stock_in_with_stock_in_items_inhouses = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
} }
this.getData(); this.getData();
}, },
...@@ -299,7 +301,7 @@ export default { ...@@ -299,7 +301,7 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(type, event) { handleInput: debounce(function(type, event) {
this.list = []; this.resetChange();
var val = event.target.value; var val = event.target.value;
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
...@@ -344,7 +346,7 @@ export default { ...@@ -344,7 +346,7 @@ export default {
* @param {Object} stock_in_sn 入库单号 * @param {Object} stock_in_sn 入库单号
*/ */
getDetail(stock_in_sn) { getDetail(stock_in_sn) {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_sn: stock_in_sn, is_register: 0 }, true).then(res => { this.request(API.stockInMobileRegisterList, 'POST', { page: 1, limit: this.limit, stock_in_sn: stock_in_sn, is_register: 0 }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.detail = res.data.list[0]; this.detail = res.data.list[0];
} else { } else {
...@@ -382,6 +384,7 @@ export default { ...@@ -382,6 +384,7 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
}, 2000); }, 2000);
...@@ -421,6 +424,7 @@ export default { ...@@ -421,6 +424,7 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.filter_id = []; this.filter_id = [];
...@@ -453,6 +457,13 @@ export default { ...@@ -453,6 +457,13 @@ export default {
closeDrawer() { closeDrawer() {
this.$refs.showRight.close(); this.$refs.showRight.close();
this.$refs.showRightAdd.close(); this.$refs.showRightAdd.close();
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -148,13 +148,14 @@ export default { ...@@ -148,13 +148,14 @@ export default {
input_flag: false, input_flag: false,
all_flag: false, //全选标记 all_flag: false, //全选标记
page: 1, page: 1,
limit: 1000, limit: 30,
index: 0, index: 0,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id filter_id: [], //过滤id
detail: {}, //详情的数据 detail: {}, //详情的数据
hasMoreData: true, //是否分页加载
searchParams: { searchParams: {
stock_in_sn: '', //入库单号 stock_in_sn: '', //入库单号
tracking_no: '', //物流单号 tracking_no: '', //物流单号
...@@ -169,7 +170,15 @@ export default { ...@@ -169,7 +170,15 @@ export default {
}); });
} }
}, },
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
...@@ -213,6 +222,7 @@ export default { ...@@ -213,6 +222,7 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
...@@ -228,6 +238,7 @@ export default { ...@@ -228,6 +238,7 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(type, event) { handleInput: debounce(function(type, event) {
this.resetChange();
var val = event.target.value; var val = event.target.value;
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
...@@ -253,8 +264,13 @@ export default { ...@@ -253,8 +264,13 @@ export default {
getData() { getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 1, ...this.searchParams }, false).then(res => { this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 1, ...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;
this.list = this.list.concat(res.data.list);
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
...@@ -268,7 +284,7 @@ export default { ...@@ -268,7 +284,7 @@ export default {
* @param {Object} stock_in_sn 入库单号 * @param {Object} stock_in_sn 入库单号
*/ */
getDetail(stock_in_sn) { getDetail(stock_in_sn) {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, stock_in_sn: stock_in_sn }, true).then(res => { this.request(API.stockInMobileRegisterList, 'POST', { page: 1, limit: this.limit, stock_in_sn: stock_in_sn }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.detail = res.data.list[0]; this.detail = res.data.list[0];
} else { } else {
...@@ -341,6 +357,13 @@ export default { ...@@ -341,6 +357,13 @@ export default {
}, },
closeDrawer() { closeDrawer() {
this.$refs.showRight.close(); this.$refs.showRight.close();
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
input_flag: false, input_flag: false,
all_flag: false, //全选标记 all_flag: false, //全选标记
page: 1, page: 1,
limit: 10, limit: 30,
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
this.searchParams.stock_out_sn = options.stock_out_sn; this.searchParams.stock_out_sn = options.stock_out_sn;
}, },
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
...@@ -160,6 +161,7 @@ export default { ...@@ -160,6 +161,7 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
this.getData(); this.getData();
...@@ -169,6 +171,7 @@ export default { ...@@ -169,6 +171,7 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
...@@ -201,9 +204,10 @@ export default { ...@@ -201,9 +204,10 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.resetChange();
this.filter_id = [];
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.filter_id = [];
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -240,6 +244,13 @@ export default { ...@@ -240,6 +244,13 @@ export default {
}); });
} }
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -256,7 +256,7 @@ export default { ...@@ -256,7 +256,7 @@ export default {
return { return {
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 10, limit: 30,
index: 0, index: 0,
array: ['入库单号', '入库批次号', '销售员', '入仓号', '理货容器'], array: ['入库单号', '入库批次号', '销售员', '入仓号', '理货容器'],
list: [], list: [],
...@@ -287,17 +287,17 @@ export default { ...@@ -287,17 +287,17 @@ export default {
} }
}, },
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
radioChange(e, type) { radioChange(e, type) {
this.resetChange();
if (type == 1) { if (type == 1) {
this.searchParams.stock_in_type = e.detail.value; this.searchParams.stock_in_type = e.detail.value;
} else if (type == 2) { } else if (type == 2) {
this.searchParams.shelf_status = e.detail.value; this.searchParams.shelf_status = e.detail.value;
} }
this.page = 1;
this.list = [];
this.getData(); this.getData();
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
...@@ -351,6 +351,7 @@ export default { ...@@ -351,6 +351,7 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.search_keyword = ''; this.searchParams.search_keyword = '';
this.getData(); this.getData();
...@@ -360,7 +361,7 @@ export default { ...@@ -360,7 +361,7 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
this.list = []; this.resetChange();
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
...@@ -436,8 +437,9 @@ export default { ...@@ -436,8 +437,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
if (type == 2) { if (type == 2) {
this.closeDrawer(); this.closeDrawer();
} }
...@@ -484,8 +486,9 @@ export default { ...@@ -484,8 +486,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
if (type == 2) { if (type == 2) {
this.closeDrawer(); this.closeDrawer();
} }
...@@ -503,8 +506,9 @@ export default { ...@@ -503,8 +506,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
if (type == 2) { if (type == 2) {
this.closeDrawer(); this.closeDrawer();
} }
...@@ -530,6 +534,13 @@ export default { ...@@ -530,6 +534,13 @@ export default {
}); });
} }
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -114,6 +114,7 @@ export default { ...@@ -114,6 +114,7 @@ export default {
this.stock_out_sn = options.stock_out_sn; this.stock_out_sn = options.stock_out_sn;
}, },
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
...@@ -198,8 +199,9 @@ export default { ...@@ -198,8 +199,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -215,6 +217,13 @@ export default { ...@@ -215,6 +217,13 @@ export default {
} }
} }
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
input_contaion: false, input_contaion: false,
all_flag: false, //全选标记 all_flag: false, //全选标记
page: 1, page: 1,
limit: 10, limit: 30,
index: 0, index: 0,
indexContainer: -1, indexContainer: -1,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
...@@ -212,6 +212,7 @@ export default { ...@@ -212,6 +212,7 @@ export default {
}, },
onShow() { onShow() {
if (this.noexebshowFalg) { if (this.noexebshowFalg) {
this.resetChange();
this.getData(); this.getData();
this.getTallyContainerDefault(); this.getTallyContainerDefault();
} }
...@@ -268,6 +269,7 @@ export default { ...@@ -268,6 +269,7 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput(type) { clearInput(type) {
this.resetChange();
if (type == 1) { if (type == 1) {
this.input_flag = false; this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
...@@ -282,7 +284,6 @@ export default { ...@@ -282,7 +284,6 @@ export default {
this.searchParams.container_name = ''; this.searchParams.container_name = '';
this.searchParams.container_id = ''; this.searchParams.container_id = '';
} }
this.getData(); this.getData();
}, },
/** /**
...@@ -308,8 +309,8 @@ export default { ...@@ -308,8 +309,8 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(type, event) { handleInput: debounce(function(type, event) {
this.resetChange();
var val = event.target.value; var val = event.target.value;
this.list = [];
if (val) { if (val) {
if (type == 1) { if (type == 1) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
...@@ -458,8 +459,9 @@ export default { ...@@ -458,8 +459,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.closeDrawer(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -534,7 +536,7 @@ export default { ...@@ -534,7 +536,7 @@ export default {
success: uploadFileRes => { success: uploadFileRes => {
uni.hideLoading(); uni.hideLoading();
var data = JSON.parse(uploadFileRes.data); var data = JSON.parse(uploadFileRes.data);
if (data.code === 200) { if (data.code === 0) {
self.image_list.push(data.data.oss_file_url); self.image_list.push(data.data.oss_file_url);
} else { } else {
uni.showToast({ uni.showToast({
...@@ -569,6 +571,13 @@ export default { ...@@ -569,6 +571,13 @@ export default {
current: index, current: index,
urls: img urls: img
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
data() { data() {
return { return {
page: 1, page: 1,
limit: 10, limit: 30,
input_flag: false, input_flag: false,
index: 0, index: 0,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
...@@ -263,17 +263,17 @@ export default { ...@@ -263,17 +263,17 @@ export default {
} }
}, },
onShow() { onShow() {
this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
radioChange(e, type) { radioChange(e, type) {
this.resetChange();
if (type == 1) { if (type == 1) {
this.searchParams.stock_tally_with_stock_in_stock_in_type_in = e.detail.value; this.searchParams.stock_tally_with_stock_in_stock_in_type_in = e.detail.value;
} else if (type == 2) { } else if (type == 2) {
this.searchParams.tally_status = e.detail.value; this.searchParams.tally_status = e.detail.value;
} }
this.page = 1;
this.list = [];
this.getData(); this.getData();
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
...@@ -320,6 +320,7 @@ export default { ...@@ -320,6 +320,7 @@ export default {
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
...@@ -335,8 +336,8 @@ export default { ...@@ -335,8 +336,8 @@ export default {
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(type, event) { handleInput: debounce(function(type, event) {
this.resetChange();
var val = event.target.value; var val = event.target.value;
this.list = [];
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
...@@ -415,8 +416,9 @@ export default { ...@@ -415,8 +416,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -499,8 +501,9 @@ export default { ...@@ -499,8 +501,9 @@ export default {
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.getData(); this.resetChange();
this.filter_id = []; this.filter_id = [];
this.getData();
this.closeDrawer(); this.closeDrawer();
}, 2000); }, 2000);
} else { } else {
...@@ -528,6 +531,13 @@ export default { ...@@ -528,6 +531,13 @@ export default {
current: index, current: index,
urls: img urls: img
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
} }
} }
}; };
......
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