|
|
@ -338,23 +338,47 @@ |
|
|
|
// } |
|
|
|
}, |
|
|
|
checkSubmit() { |
|
|
|
var tempHandleQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].handleQty |
|
|
|
var tempQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].qty |
|
|
|
var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty |
|
|
|
if (tempHandleQty == 0) { |
|
|
|
this.showErrorMessage("实际数量为0,请先扫描数据") |
|
|
|
return |
|
|
|
} |
|
|
|
if (tempHandleQty > tempQty) { |
|
|
|
//大于需求数量 |
|
|
|
this.showCommitMessage("实际数量【" + tempHandleQty + "】大于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty, |
|
|
|
toPackQty) |
|
|
|
} else if (tempHandleQty < tempQty) { |
|
|
|
this.showCommitMessage("实际数量【" + tempHandleQty + "】小于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty, |
|
|
|
toPackQty) |
|
|
|
|
|
|
|
let str="" |
|
|
|
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 hanleQty =record.qty?record.qty:0 |
|
|
|
totalQty = calc.add(totalQty,hanleQty) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
//实际扫描的数量 |
|
|
|
item.totalQty =totalQty |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
//如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 |
|
|
|
this.detailSource.forEach(detail=>{ |
|
|
|
detail.Items.forEach(item=>{ |
|
|
|
if(item.taskQty!=item.totalQty){ |
|
|
|
str += `物料号【${item.itemCode}】实际提交数量【${item.totalQty}】与任务数量【${item.taskQty}】与不一致\n` |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
var toPackQty = this.detailSource[0].Items[0].qty |
|
|
|
var commitHandleQty =this.detailSource[0].Items[0].totalQty |
|
|
|
if(str){ |
|
|
|
str ="是否提交\n"+str |
|
|
|
this.showCommitMessage(str,commitHandleQty,toPackQty) |
|
|
|
}else { |
|
|
|
this.packageHint(tempHandleQty, toPackQty) |
|
|
|
this.packageHint(commitHandleQty, toPackQty) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
packageHint(tempHandleQty, toPackQty) { |
|
|
|
//包装提示 |
|
|
|