仓库-出库入库,扫码根据客户需求进行改动
This commit is contained in:
@@ -76,6 +76,9 @@ export default {
|
||||
},
|
||||
// 新录入货物信息
|
||||
newMaterialList: [],
|
||||
|
||||
//工单计划
|
||||
outOrderPlan:[],
|
||||
// 1-仓库扫码 2-货物扫码 3-出货单扫码
|
||||
searchType: 3
|
||||
};
|
||||
@@ -101,19 +104,33 @@ export default {
|
||||
// 初始化,并且清空数据
|
||||
this.clearData.outInfo = JSON.parse(JSON.stringify(this.outInfo));
|
||||
this.clearData.newMaterialList = JSON.parse(JSON.stringify(this.newMaterialList));
|
||||
this.clearData.outOrderPlan = JSON.parse(JSON.stringify(this.outOrderPlan));
|
||||
this.searchType = 3;
|
||||
},
|
||||
clear() {
|
||||
this.outInfo = JSON.parse(JSON.stringify(this.clearData.outInfo));
|
||||
this.newMaterialList = JSON.parse(JSON.stringify(this.clearData.newMaterialList));
|
||||
this.outOrderPlan = JSON.parse(JSON.stringify(this.clearData.outOrderPlan));
|
||||
this.searchType = 3;
|
||||
},
|
||||
// 获取工单计划
|
||||
getOutOrderPlan(data){
|
||||
const query = {
|
||||
shipment_num:data.shipmentNum
|
||||
}
|
||||
WarehoseApi.generateOutorderplan(query).then(res=>{
|
||||
if(res.code === 200){
|
||||
this.outOrderPlan = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 扫码信息录入
|
||||
handleGetInfo(data, type) {
|
||||
if (type === 3) {
|
||||
// 出货单扫完后是扫箱号
|
||||
this.searchType = 2;
|
||||
this.outInfo = data;
|
||||
this.getOutOrderPlan(data);
|
||||
this.newMaterialList = [];
|
||||
} else if (type === 2) {
|
||||
if (this.newMaterialList.length > 0) {
|
||||
@@ -128,6 +145,24 @@ export default {
|
||||
|
||||
// 此时扫描的是箱号
|
||||
// TODO 检查扫描的箱号零件号是否在此工单下
|
||||
let flag = false;
|
||||
let list = JSON.parse(JSON.stringify(this.outOrderPlan));
|
||||
for(let item of list){
|
||||
// 扫描箱的工单号与计划中的批次号对比,数字是否在其中
|
||||
if(item.Patchcode === data.workoderID){
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
// 此箱号不在计划内
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前货物未不在出库单计划内,请扫其他货物!',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// TODO 箱出库,并关联到此出库单下
|
||||
this.newMaterialList.push(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user