入库,出库添加检查接口,需要与后端对应

This commit is contained in:
赵正易 2024-03-27 16:38:57 +08:00
parent 9387549718
commit 0cd58461b9
4 changed files with 108 additions and 68 deletions

View File

@ -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
})
}
// 移库接口
/**
* 移库物料+客户

View File

@ -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({

View File

@ -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;
// }
// }
// }
});
}
},

View File

@ -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: '确认'
});
}
})
});
}
}
});