|
|
@ -236,25 +236,53 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
updateData(record) { |
|
|
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
|
|
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
|
let itemHandleQty = 0; |
|
|
|
if (item != undefined) { |
|
|
|
item.Locations.forEach(l => { |
|
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
|
record.batch); |
|
|
|
let handleQty = 0; |
|
|
|
if (batch != undefined) { |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty = calc.add(handleQty, res.qty) |
|
|
|
|
|
|
|
if(record){ |
|
|
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
|
|
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
|
let itemHandleQty = 0; |
|
|
|
if (item != undefined) { |
|
|
|
item.Locations.forEach(l => { |
|
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == |
|
|
|
record.batch); |
|
|
|
let handleQty = 0; |
|
|
|
if (batch != undefined) { |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty = calc.add(handleQty, res.qty) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
itemHandleQty = calc.add(itemHandleQty, handleQty) |
|
|
|
} |
|
|
|
}) |
|
|
|
item.handleQty=itemHandleQty; |
|
|
|
} |
|
|
|
this.$forceUpdate() |
|
|
|
}else { |
|
|
|
//计算扫描数量 |
|
|
|
this.detailSource.forEach(detail => { |
|
|
|
detail.Items.forEach(item => { |
|
|
|
var taskQty =0; |
|
|
|
item.taskQty =calc.add(taskQty,item.qty) |
|
|
|
var totalQty =0; |
|
|
|
item.Locations.forEach(lco => { |
|
|
|
lco.Batchs.forEach(batch => { |
|
|
|
batch.Records.forEach(record => { |
|
|
|
if(record){ |
|
|
|
var handleQty =record.qty?record.qty:0 |
|
|
|
totalQty = calc.add(totalQty,handleQty) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
itemHandleQty = calc.add(itemHandleQty, handleQty) |
|
|
|
} |
|
|
|
//实际扫描的数量 |
|
|
|
item.handleQty =totalQty |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// item.handleQty=itemHandleQty; |
|
|
|
|
|
|
|
// |
|
|
|
}, |
|
|
|
|
|
|
|
submit(){ |
|
|
@ -280,50 +308,18 @@ |
|
|
|
checkCount(){ |
|
|
|
let str="" |
|
|
|
let commitHint="" |
|
|
|
this.detailSource.forEach(detail => { |
|
|
|
detail.Items.forEach(item => { |
|
|
|
var taskQty =0; |
|
|
|
item.taskQty =calc.add(taskQty,item.qty) |
|
|
|
var totalQty =0; |
|
|
|
item.Locations.forEach(lco => { |
|
|
|
lco.Batchs.forEach(batch => { |
|
|
|
batch.Records.forEach(record => { |
|
|
|
// if (batch.qty != record.qty) { |
|
|
|
// var tempHandleQty = 0 |
|
|
|
// if (record.qty) { |
|
|
|
// tempHandleQty = record.qty |
|
|
|
// } else { |
|
|
|
// tempHandleQty = 0 |
|
|
|
// } |
|
|
|
// if (batch.qty != 0) { |
|
|
|
// str += |
|
|
|
// `包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n` |
|
|
|
// } |
|
|
|
// } |
|
|
|
if(record){ |
|
|
|
var hanleQty =record.qty?record.qty:0 |
|
|
|
totalQty = calc.add(totalQty,hanleQty) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
//实际扫描的数量 |
|
|
|
item.totalQty =totalQty |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
//如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 |
|
|
|
this.detailSource.forEach(detail=>{ |
|
|
|
detail.Items.forEach(item=>{ |
|
|
|
if(this.jobContent.allowPartialComplete=="FALSE"){ |
|
|
|
if(item.taskQty!=item.totalQty){ |
|
|
|
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` |
|
|
|
if(item.taskQty!=item.handleQty){ |
|
|
|
str += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致\n` |
|
|
|
} |
|
|
|
}else { |
|
|
|
//允许部分提交,提交的数量和任务数量不一致,提示 |
|
|
|
if(item.taskQty!=item.totalQty){ |
|
|
|
commitHint += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致,是否提交\n` |
|
|
|
if(item.taskQty!=item.handleQty){ |
|
|
|
commitHint += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致,是否提交?\n` |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|