入库,出库添加检查接口,需要与后端对应
This commit is contained in:
@@ -147,6 +147,17 @@ export function generateOutorderplan(params) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否可出库 production_packcode(扫码结果) shipment_num(出库单号)
|
||||
*/
|
||||
export function checkProductionOut(params) {
|
||||
return request({
|
||||
url: '/mes/wm/WmOutOrder/checkProductionOut',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 移库接口
|
||||
/**
|
||||
* 移库(物料+客户)
|
||||
|
||||
@@ -127,26 +127,26 @@ export default {
|
||||
async handleScanGoodsCode(text) {
|
||||
let package_code = text;
|
||||
// 临时库处理
|
||||
let _warehouseInfo = this.warehouseInfo;
|
||||
if (_warehouseInfo != null && _warehouseInfo != undefined) {
|
||||
if (_warehouseInfo.remark === '临时' || _warehouseInfo.locaiton === 'LS1-01') {
|
||||
let resolutionData = {
|
||||
code: package_code
|
||||
};
|
||||
const emitRes = await WarehoseApi.resolutionPackage(resolutionData);
|
||||
if (emitRes.code !== 200 || emitRes.data === null) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该箱号数据解析异常!',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.emitInputChange(emitRes.data, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// let _warehouseInfo = this.warehouseInfo;
|
||||
// if (_warehouseInfo != null && _warehouseInfo != undefined) {
|
||||
// if (_warehouseInfo.remark === '临时' || _warehouseInfo.locaiton === 'LS1-01') {
|
||||
// let resolutionData = {
|
||||
// code: package_code
|
||||
// };
|
||||
// const emitRes = await WarehoseApi.resolutionPackage(resolutionData);
|
||||
// if (emitRes.code !== 200 || emitRes.data === null) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '该箱号数据解析异常!',
|
||||
// showCancel: false,
|
||||
// confirmText: '确定'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// this.emitInputChange(emitRes.data, 2);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// 成品库处理
|
||||
// 成品满箱扫码
|
||||
let locationCheckData = {
|
||||
@@ -182,19 +182,19 @@ export default {
|
||||
} else if (checkRes.data === 1) {
|
||||
|
||||
// 判断是否为满箱
|
||||
const isFullRes = await WarehoseApi.isFullPackage(locationCheckData);
|
||||
if (isFullRes.code !== 200 || !isFullRes.data) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该标签不为满箱标签!',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let resolutionData = {
|
||||
code: package_code
|
||||
};
|
||||
// const isFullRes = await WarehoseApi.isFullPackage(locationCheckData);
|
||||
// if (isFullRes.code !== 200 || !isFullRes.data) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '该标签不为满箱标签!',
|
||||
// showCancel: false,
|
||||
// confirmText: '确定'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// let resolutionData = {
|
||||
// code: package_code
|
||||
// };
|
||||
const emitRes = await WarehoseApi.resolutionPackage(resolutionData);
|
||||
if (emitRes.code !== 200 || emitRes.data === null) {
|
||||
uni.showModal({
|
||||
|
||||
@@ -130,35 +130,52 @@ export default {
|
||||
this.newMaterialList = [];
|
||||
} else if (type === 2) {
|
||||
const checkData = {
|
||||
originalCode: data.originalCode
|
||||
production_packcode: data.originalCode,
|
||||
location:this.warehouseInfo.location,
|
||||
isStrict:true,
|
||||
};
|
||||
WarehoseApi.isExistedWarehouse(checkData).then((res) => {
|
||||
if (res.code !== 200 || res.data) {
|
||||
WarehoseApi.checkWarehousing(checkData).then(res=>{
|
||||
if (res.code === 200 && res.data) {
|
||||
this.newMaterialList.push(data);
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '货物录入异常,已在其他库录入!',
|
||||
content: '不可入库:' + res.msg,
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 此时扫描的是箱号
|
||||
// 当前录入的箱号是否在同一批次录入过
|
||||
// 曾经是否扫过
|
||||
if (this.newMaterialList.length > 0) {
|
||||
for (let item of this.newMaterialList) {
|
||||
if (item.patchCode === data.patchCode) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '此货物已录入过',
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.newMaterialList.push(data);
|
||||
})
|
||||
// const checkData = {
|
||||
// originalCode: data.originalCode
|
||||
// };
|
||||
// WarehoseApi.isExistedWarehouse(checkData).then((res) => {
|
||||
// if (res.code !== 200 || res.data) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '货物录入异常,已在其他库录入!',
|
||||
// showCancel: false,
|
||||
// confirmText: '确定'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// // 此时扫描的是箱号
|
||||
// // 当前录入的箱号是否在同一批次录入过
|
||||
// // 曾经是否扫过
|
||||
// if (this.newMaterialList.length > 0) {
|
||||
// for (let item of this.newMaterialList) {
|
||||
// if (item.patchCode === data.patchCode) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '此货物已录入过',
|
||||
// showCancel: false,
|
||||
// confirmText: '确定'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -76,9 +76,9 @@ export default {
|
||||
},
|
||||
// 新录入货物信息
|
||||
newMaterialList: [],
|
||||
|
||||
|
||||
//工单计划
|
||||
outOrderPlan:[],
|
||||
outOrderPlan: [],
|
||||
// 1-仓库扫码 2-货物扫码 3-出货单扫码
|
||||
searchType: 3
|
||||
};
|
||||
@@ -130,7 +130,22 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const checkData = {
|
||||
production_packcode: data.originalCode,
|
||||
shipment_num: this.outInfo.shipmentNum
|
||||
};
|
||||
WarehoseApi.checkProductionOut(checkData).then((res) => {
|
||||
if (res.code === 200 && res.data) {
|
||||
this.newMaterialList.push(data);
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '不可出库:' + res.msg,
|
||||
showCancel: false,
|
||||
confirmText: '确定'
|
||||
});
|
||||
}
|
||||
});
|
||||
// 此时扫描的是箱号
|
||||
// TODO 检查扫描的箱号零件号是否在此工单下
|
||||
// let flag = false;
|
||||
@@ -156,7 +171,6 @@ export default {
|
||||
// return;
|
||||
// }
|
||||
// TODO 箱出库,并关联到此出库单下
|
||||
this.newMaterialList.push(data);
|
||||
}
|
||||
},
|
||||
// 货物出库
|
||||
@@ -191,8 +205,8 @@ export default {
|
||||
shipmentNum: this.outInfo.shipmentNum,
|
||||
patchCode: [this.newMaterialList[0].patchCode]
|
||||
};
|
||||
WarehoseApi.doMaterialOut(data).then(res=>{
|
||||
if(res.code !== 200){
|
||||
WarehoseApi.doMaterialOut(data).then((res) => {
|
||||
if (res.code !== 200) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '出库异常',
|
||||
@@ -208,8 +222,7 @@ export default {
|
||||
confirmText: '确认'
|
||||
});
|
||||
this.newMaterialList = [];
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -228,8 +241,8 @@ export default {
|
||||
const data = {
|
||||
shipmentNum: this.outInfo.shipmentNum
|
||||
};
|
||||
WarehoseApi.doOverOutorderplan(data).then(res=>{
|
||||
if(res.code === 200){
|
||||
WarehoseApi.doOverOutorderplan(data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '此出库单已完成',
|
||||
@@ -237,7 +250,7 @@ export default {
|
||||
confirmText: '确认'
|
||||
});
|
||||
this.clear();
|
||||
}else{
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '出库单完成异常!',
|
||||
@@ -245,8 +258,7 @@ export default {
|
||||
confirmText: '确认'
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user