|
@ -236,6 +236,8 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
updateData(record) { |
|
|
updateData(record) { |
|
|
|
|
|
|
|
|
|
|
|
if(record){ |
|
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
|
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
|
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
let itemHandleQty = 0; |
|
|
let itemHandleQty = 0; |
|
@ -253,8 +255,34 @@ |
|
|
itemHandleQty = calc.add(itemHandleQty, 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) |
|
|
} |
|
|
} |
|
|
// item.handleQty=itemHandleQty; |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
//实际扫描的数量 |
|
|
|
|
|
item.handleQty =totalQty |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
submit(){ |
|
|
submit(){ |
|
@ -280,50 +308,18 @@ |
|
|
checkCount(){ |
|
|
checkCount(){ |
|
|
let str="" |
|
|
let str="" |
|
|
let commitHint="" |
|
|
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=>{ |
|
|
this.detailSource.forEach(detail=>{ |
|
|
detail.Items.forEach(item=>{ |
|
|
detail.Items.forEach(item=>{ |
|
|
if(this.jobContent.allowPartialComplete=="FALSE"){ |
|
|
if(this.jobContent.allowPartialComplete=="FALSE"){ |
|
|
if(item.taskQty!=item.totalQty){ |
|
|
if(item.taskQty!=item.handleQty){ |
|
|
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` |
|
|
str += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致\n` |
|
|
} |
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
//允许部分提交,提交的数量和任务数量不一致,提示 |
|
|
//允许部分提交,提交的数量和任务数量不一致,提示 |
|
|
if(item.taskQty!=item.totalQty){ |
|
|
if(item.taskQty!=item.handleQty){ |
|
|
commitHint += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致,是否提交\n` |
|
|
commitHint += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致,是否提交?\n` |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|