|
|
@ -265,64 +265,48 @@ |
|
|
|
closeScan() { |
|
|
|
this.resizeCollapse(); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
if(!result.package.number){ |
|
|
|
this.showErrorMessage("包装号不能为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title:"校验中...", |
|
|
|
mask:true |
|
|
|
|
|
|
|
this.managementType = managementTypeParams |
|
|
|
let array1 = []//记录推荐的库位 |
|
|
|
let array2 = []//记录推荐的批次 |
|
|
|
this.detailSource.forEach(item=>{ |
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
array1.push(cur.fromLocationCode) |
|
|
|
array2.push(cur.batch) |
|
|
|
}) |
|
|
|
}) |
|
|
|
//校验箱码是否已经发料 |
|
|
|
issueCheck(result.package.number).then(res=>{ |
|
|
|
uni.hideLoading() |
|
|
|
if(res.data.length==0){ |
|
|
|
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) |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.showErrorMessage("箱码["+result.package.number+"]已经发过料") |
|
|
|
// 扫描的库位是否在 |
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error.message) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
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) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setDataBatch11(result) { |
|
|
|
console.log(result) |
|
|
|
try { |
|
|
@ -560,7 +544,7 @@ |
|
|
|
that.$forceUpdate() |
|
|
|
}, 100) |
|
|
|
}else { |
|
|
|
this.showErrorMessage("包装号["+packingNumber+"]已经扫描") |
|
|
|
itemDetail.handleQty=calc.add(itemDetail.handleQty,result.label.qty) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|