Commit 3ec27c51 by liangjianmin

refactor(arrivalRegister): 移除仓库限制,简化到货登记逻辑

- 去掉了之前的仓库限制,现在所有仓库均可进行到货登记
- 优化了入库登记的逻辑,确保用户体验流畅
- 统一了成功和失败的提示信息格式,提升代码可读性
parent 814380fd
Showing with 42 additions and 72 deletions
......@@ -1160,81 +1160,51 @@
});
return false;
}
//深圳自营仓 + 寄售仓
if (this.filter_id_warehouse_id[0] == 9 || this.filter_id_warehouse_id[0] == 16) {
//先判断一下自营货品信息判断是否是第一次入库
this.request(API.getZyGoodsData, 'GET', { stock_in_sn: this.filter_id_stock_in_sn.join(','), is_first_check: 1 }, true).then(res => {
if (res.code === 0) {
if (res.data.length > 0) {
//标记第一次入库
this.getOtherAttrList();
this.showDrawer(decodeURIComponent(this.filter_id_stock_in_sn.join(',')), 1);
} else {
//如果是第二次入库就直接登记成功
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
//清空字段
this.searchParams.mobile_register_all_search = ''; //全量搜索
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; //入仓号
this.searchParams.tracking_no = ''; //Fedex
this.searchParams.box_sn = ''; //箱号
this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
this.filter_id = [];
this.filter_id_warehouse_id = [];
}, 200);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else {
//非深圳自营直接登记
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
//清空字段
this.searchParams.mobile_register_all_search = ''; //全量搜索
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; //入仓号
this.searchParams.tracking_no = ''; //Fedex
this.searchParams.box_sn = ''; //箱号
this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
this.filter_id = [];
this.filter_id_warehouse_id = [];
}, 200);
//去掉了之前的仓库限制,现在所有仓库都可以进行到货登记
this.request(API.getZyGoodsData, 'GET', { stock_in_sn: this.filter_id_stock_in_sn.join(','), is_first_check: 1 }, true).then(res => {
if (res.code === 0) {
if (res.data.length > 0) {
//标记第一次入库
this.getOtherAttrList();
this.showDrawer(decodeURIComponent(this.filter_id_stock_in_sn.join(',')), 1);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
//如果是第二次入库就直接登记成功
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
//清空字段
this.searchParams.mobile_register_all_search = ''; //全量搜索
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; //入仓号
this.searchParams.tracking_no = ''; //Fedex
this.searchParams.box_sn = ''; //箱号
this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
this.filter_id = [];
this.filter_id_warehouse_id = [];
}, 200);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
});
}
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 打印入仓号
......
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