|
|
@ -217,7 +217,7 @@ |
|
|
|
that.showMessage('未获取到详情'); |
|
|
|
} else { |
|
|
|
if (res.data.subList.length > 0) { |
|
|
|
res.data.allowModifyLocation = 'FALSE' |
|
|
|
// res.data.allowModifyLocation = 'FALSE' |
|
|
|
that.jobContent = res.data; |
|
|
|
that.jobStatus = res.data.status |
|
|
|
that.subList = res.data.subList; |
|
|
@ -261,16 +261,36 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
console.log(this.jobContent.allowModifyLocation) |
|
|
|
// if(this.jobContent.allowModifyLocation == 'TRUE'){ |
|
|
|
// this.managementType = managementTypeParams |
|
|
|
// if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
// this.setDataBatch(result) |
|
|
|
// } |
|
|
|
// }else{ |
|
|
|
// this.showErrorMessage(`不可以扫描推荐库位【${this.fromLocationCode}】的库位`) |
|
|
|
// } |
|
|
|
this.managementType = managementTypeParams |
|
|
|
let array1 = []//记录推荐的库位 |
|
|
|
let array2 = []//记录推荐的批次 |
|
|
|
this.detailSource.forEach(item=>{ |
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
array1.push(cur.fromLocationCode) |
|
|
|
array2.push(cur.batch) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 扫描的库位是否在 |
|
|
|
const obj1 = array1.find(item=>item == result.fromLocationCode) |
|
|
|
const obj2 = array2.find(item=>item == result.label.batch) |
|
|
|
if(this.jobContent.allowModifyLocation == 'FALSE'){ |
|
|
|
if(!obj1){ |
|
|
|
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.jobContent.allowModifyBatch == 'FALSE'){ |
|
|
|
if(!obj2){ |
|
|
|
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if(!obj1){ |
|
|
|
this.recommendQty = 0 |
|
|
|
}else{ |
|
|
|
this.recommendQty = result.balance.qty |
|
|
|
} |
|
|
|
// this.managementType = managementTypeParams |
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
this.setDataBatch(result) |
|
|
|
} |
|
|
@ -327,7 +347,7 @@ |
|
|
|
toLocationCode:this.toLocationCode, |
|
|
|
batch:result.label.batch, |
|
|
|
handleQty:result.label.qty, |
|
|
|
qty:result.balance.qty, |
|
|
|
qty:this.recommendQty, |
|
|
|
inventoryStatus:result.balance.inventoryStatus, |
|
|
|
toLocation:result.balance.toLocation, |
|
|
|
balance:result.balance, |
|
|
@ -596,8 +616,11 @@ |
|
|
|
|
|
|
|
autoCommit(){ |
|
|
|
// this.$throttle(this.submit, 2000, this)() |
|
|
|
// this.jobContent.allowSmallerQty = 'FALSE' |
|
|
|
this.jobContent.allowBiggerQty = 'FALSE' |
|
|
|
let str="" |
|
|
|
let str1="" |
|
|
|
let str2="" |
|
|
|
var totalQty =0; |
|
|
|
var taskQty =0; |
|
|
|
console.log(877,this.detailSource) |
|
|
@ -605,29 +628,43 @@ |
|
|
|
detail.subList.forEach(item => { |
|
|
|
if(item.scaned){ |
|
|
|
taskQty =calc.add(taskQty,item.qty) |
|
|
|
totalQty =calc.add(totalQty,item.handleQty) |
|
|
|
if(item.handleQty<item.qty){ |
|
|
|
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.qty}】不一致\n` |
|
|
|
totalQty =calc.add(totalQty,item.handleQty) |
|
|
|
if (this.jobContent.allowSmallerQty == "FALSE") { |
|
|
|
if(parseFloat(item.handleQty)<parseFloat(item.qty)){ |
|
|
|
str += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许小于任务数量【${item.qty}】` |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.jobContent.allowBiggerQty == 'FALSE') { |
|
|
|
if (parseFloat( item.handleQty )> parseFloat(item.qty)){ |
|
|
|
str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}】` |
|
|
|
} |
|
|
|
} |
|
|
|
if(item.handleQty>item.balance.qty){ |
|
|
|
str1 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}】` |
|
|
|
if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){ |
|
|
|
str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
if(str1){ |
|
|
|
this.$refs.comMessage.showMessage(str1, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log(877,str) |
|
|
|
if (str) { |
|
|
|
str1 = '不允许提交\n' + str |
|
|
|
this.showErrorMessage(str) |
|
|
|
return |
|
|
|
} |
|
|
|
if (str1) { |
|
|
|
str1 = '不允许提交\n' + str1 |
|
|
|
this.showErrorMessage(str1) |
|
|
|
return |
|
|
|
} |
|
|
|
if (str2) { |
|
|
|
str2 = '不允许提交\n' + str2 |
|
|
|
this.showErrorMessage(str2) |
|
|
|
return |
|
|
|
} |
|
|
|
if(str){ |
|
|
|
str = '任务明细未全部完成,是否提交?\n' + str |
|
|
|
} |
|
|
|
|
|
|
|
if(totalQty!=taskQty){ |
|
|
|
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交" |
|
|
|
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { |
|
|
@ -635,18 +672,6 @@ |
|
|
|
//防止重复点击 |
|
|
|
this.$throttle(this.submit, 2000, this)() |
|
|
|
} else { |
|
|
|
// this.detailSource.forEach(detail => { |
|
|
|
// detail.Items.forEach(item => { |
|
|
|
// taskQty =calc.add(taskQty,item.qty) |
|
|
|
// item.Locations.forEach(lco => { |
|
|
|
// lco.Batchs.forEach(batch => { |
|
|
|
// batch.Records = [] |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// this.$refs.comScanIssuePack.clearList() |
|
|
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
} |
|
|
|
}); |
|
|
|