|
|
@ -501,13 +501,22 @@ |
|
|
|
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); |
|
|
|
that.fromLocationCode = balance.locationCode; |
|
|
|
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); |
|
|
|
if (fromLocation &&!fromLocation.isNewAdd) { |
|
|
|
//扫描的库位在列表中存在 |
|
|
|
if (fromLocation){ |
|
|
|
//不是在任务列表中的,是新加的库位 |
|
|
|
// if(fromLocation.isNewAdd){ |
|
|
|
|
|
|
|
// }else { |
|
|
|
// //在任务列表中。 |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
let batch = fromLocation.Batchs.find(r => r.batch == lot); |
|
|
|
if (batch != undefined) { |
|
|
|
if (batch.Records == undefined) { |
|
|
|
batch.Records = []; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
|
if (record == undefined) { |
|
|
|
//如果有推荐箱码 |
|
|
@ -531,7 +540,7 @@ |
|
|
|
} else { |
|
|
|
that.addRecord(batch, label, balance, packageInfo) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
|
res => { |
|
|
@ -539,7 +548,7 @@ |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
if (this.jobContent.allowModifyBatch == "TRUE") { |
|
|
|
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + |
|
|
@ -562,8 +571,9 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
//扫描的不在任务列表中,询问是否可以添加, |
|
|
|
if (this.jobContent.allowModifyLocation == "TRUE") { |
|
|
|
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + |
|
|
|
"】与推荐的库位不一致,是否要继续发料?", res => { |
|
|
@ -574,12 +584,155 @@ |
|
|
|
that.$emit("afterScan"); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + |
|
|
|
"】与推荐的库位不一致,不允许继续发料?") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// if (fromLocation && !fromLocation.isNewAdd) { |
|
|
|
// let batch = fromLocation.Batchs.find(r => r.batch == lot); |
|
|
|
// if (batch != undefined) { |
|
|
|
// if (batch.Records == undefined) { |
|
|
|
// batch.Records = []; |
|
|
|
// } |
|
|
|
|
|
|
|
// let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
|
// if (record == undefined) { |
|
|
|
// //如果有推荐箱码 |
|
|
|
// if (batch.Recommends != undefined && batch.Recommends.length > 0) { |
|
|
|
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
|
// if (recommend != undefined) { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo) |
|
|
|
// } else { |
|
|
|
// //允许修改箱码 |
|
|
|
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo); |
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// ) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo) |
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// } |
|
|
|
// ) |
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// if (this.jobContent.allowModifyBatch == "TRUE") { |
|
|
|
// this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + |
|
|
|
// '】的发料明细,是否要继续发料?', res => { |
|
|
|
// if (res) { |
|
|
|
// let batch = that.createBatchInfo(label, balance, packageInfo); |
|
|
|
// //新增加的批次赋值details |
|
|
|
// if (fromLocation.Batchs.length > 0) { |
|
|
|
// batch.detail = fromLocation.Batchs[0].detail; |
|
|
|
// } |
|
|
|
// fromLocation.Batchs.unshift(batch); |
|
|
|
// this.getfocus(); |
|
|
|
// that.$emit("afterScan"); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('未查找到批次【' + lot + '】的发料明细', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// if (fromLocation&&fromLocation.isNewAdd) { |
|
|
|
// let batch = fromLocation.Batchs.find(r => r.batch == lot); |
|
|
|
// if (batch != undefined) { |
|
|
|
// if (batch.Records == undefined) { |
|
|
|
// batch.Records = []; |
|
|
|
// } |
|
|
|
|
|
|
|
// let record = batch.Records.find(r => r.packingNumber == packingCode); |
|
|
|
// if (record == undefined) { |
|
|
|
// //如果有推荐箱码 |
|
|
|
// if (batch.Recommends != undefined && batch.Recommends.length > 0) { |
|
|
|
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); |
|
|
|
// if (recommend != undefined) { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo) |
|
|
|
// } else { |
|
|
|
// //允许修改箱码 |
|
|
|
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo); |
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// ) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// that.addRecord(batch, label, balance, packageInfo) |
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// } |
|
|
|
// ) |
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// if (this.jobContent.allowModifyBatch == "TRUE") { |
|
|
|
// this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + |
|
|
|
// '】的发料明细,是否要继续发料?', res => { |
|
|
|
// if (res) { |
|
|
|
// let batch = that.createBatchInfo(label, balance, packageInfo); |
|
|
|
// //新增加的批次赋值details |
|
|
|
// if (fromLocation.Batchs.length > 0) { |
|
|
|
// batch.detail = fromLocation.Batchs[0].detail; |
|
|
|
// } |
|
|
|
// fromLocation.Batchs.unshift(batch); |
|
|
|
// this.getfocus(); |
|
|
|
// that.$emit("afterScan"); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// that.showErrorMessage('未查找到批次【' + lot + '】的发料明细', |
|
|
|
// res => { |
|
|
|
// that.getfocus(); |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// if (this.jobContent.allowModifyLocation == "TRUE") { |
|
|
|
// this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + |
|
|
|
// "】与推荐的库位不一致,是否要继续发料?", res => { |
|
|
|
// if (res) { |
|
|
|
// let locaion = that.createLocationInfo(label, balance, packageInfo); |
|
|
|
// item.Locations.push(locaion); |
|
|
|
// this.getfocus(); |
|
|
|
// that.$emit("afterScan"); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + |
|
|
|
// "】与推荐的库位不一致,不允许继续发料?") |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
} catch (e) { |
|
|
|
that.showErrorMessage(e.stack, |
|
|
|
res => { |
|
|
@ -596,7 +749,7 @@ |
|
|
|
qty: balance.qty, |
|
|
|
uom: balance.uom, |
|
|
|
handleQty: 0, |
|
|
|
isNewAdd:true, |
|
|
|
isNewAdd: true, |
|
|
|
Batchs: [] |
|
|
|
} |
|
|
|
let batch = this.createBatchInfo(label, balance, packageInfo); |
|
|
@ -656,12 +809,60 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
addRecord(batch, label, balance, packageInfo) { |
|
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
|
batch.Records.push(record); |
|
|
|
this.issueRecord.unshift(record) |
|
|
|
this.calcBatchHandleQty(batch); |
|
|
|
this.getfocus(); |
|
|
|
this.$emit("afterScan"); |
|
|
|
if (packageInfo.parentNumber) { |
|
|
|
var checkData = batch.Records.find(r => { |
|
|
|
if (r.packingNumber == packageInfo.parentNumber && |
|
|
|
r.batch == balance.batch) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (checkData) { |
|
|
|
//提示已经扫描 |
|
|
|
this.showErrorMessage("箱码[" + packageInfo.number + "]批次[" + balance.batch + |
|
|
|
"]的父包装已经扫描") |
|
|
|
} else { |
|
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
|
batch.Records.push(record); |
|
|
|
this.issueRecord.unshift(record) |
|
|
|
this.calcBatchHandleQty(batch); |
|
|
|
this.getfocus(); |
|
|
|
this.$emit("afterScan"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//扫描的是父包装 |
|
|
|
var checkData = batch.Records.find(r => { |
|
|
|
if (r.parentPackingNumber == packageInfo.number && |
|
|
|
r.batch == balance.batch) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (checkData) { |
|
|
|
//是否移除 |
|
|
|
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" + |
|
|
|
balance |
|
|
|
.batch + "]是父包装,是否移除子包装", res => { |
|
|
|
if (res) { |
|
|
|
batch.Records = []; |
|
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
|
batch.Records.push(record); |
|
|
|
this.issueRecord.unshift(record) |
|
|
|
this.calcBatchHandleQty(batch); |
|
|
|
this.getfocus(); |
|
|
|
this.$emit("afterScan"); |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("扫描的是父包装,是否移除子包装") |
|
|
|
} else { |
|
|
|
let record = this.creatRecord(label, balance, packageInfo); |
|
|
|
batch.Records.push(record); |
|
|
|
this.issueRecord.unshift(record) |
|
|
|
this.calcBatchHandleQty(batch); |
|
|
|
this.getfocus(); |
|
|
|
this.$emit("afterScan"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getfocus() { |
|
|
|