Browse Source

去掉发料和直接发料重复扫描

intex_online20250220
lijuncheng 4 days ago
parent
commit
f16b20728c
  1. 86
      src/pages/issue/job/issueDetailBatch.vue
  2. 28
      src/pages/issue/record/directIssueByBatch.vue

86
src/pages/issue/job/issueDetailBatch.vue

@ -265,64 +265,48 @@
closeScan() { closeScan() {
this.resizeCollapse(); this.resizeCollapse();
}, },
getScanResult(result, managementTypeParams) { getScanResult(result, managementTypeParams) {
if(!result.package.number){ if(!result.package.number){
this.showErrorMessage("包装号不能为空") this.showErrorMessage("包装号不能为空")
return; return;
} }
uni.showLoading({
title:"校验中...", this.managementType = managementTypeParams
mask:true 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=>{ const obj1 = array1.find(item=>item == result.fromLocationCode)
uni.hideLoading() const obj2 = array2.find(item=>item == result.label.batch)
if(res.data.length==0){ if(this.jobContent.allowModifyLocation == 'FALSE'){
this.managementType = managementTypeParams if(!obj1){
let array1 = []// this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
let array2 = []// return
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+"]已经发过料")
} }
}
}).catch(error=>{ if(this.jobContent.allowModifyBatch == 'FALSE'){
uni.hideLoading() if(!obj2){
this.showErrorMessage(error.message) 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) { setDataBatch11(result) {
console.log(result) console.log(result)
try { try {
@ -560,7 +544,7 @@
that.$forceUpdate() that.$forceUpdate()
}, 100) }, 100)
}else { }else {
this.showErrorMessage("包装号["+packingNumber+"]已经扫描") itemDetail.handleQty=calc.add(itemDetail.handleQty,result.label.qty)
} }
} }

28
src/pages/issue/record/directIssueByBatch.vue

@ -212,19 +212,21 @@
title:"校验中...", title:"校验中...",
mask:true mask:true
}) })
this.setData(result);
// //
issueCheck(result.package.number).then(res=>{ // issueCheck(result.package.number).then(res=>{
uni.hideLoading() // uni.hideLoading()
if(res.data.length==0){ // if(res.data.length==0){
this.setData(result); // this.setData(result);
}else { // }else {
this.showErrorMessage("箱码["+result.package.number+"]已经发过料") // this.showErrorMessage("["+result.package.number+"]")
} // }
}).catch(error=>{ // }).catch(error=>{
uni.hideLoading() // uni.hideLoading()
this.showErrorMessage(error.message) // this.showErrorMessage(error.message)
}) // })
}, },
@ -257,9 +259,7 @@
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { detail.handleQty=calc.add(detail.qty,balance.qty)
this.showErrorMessage("箱码[" + pack.number + "]已经扫描")
}
} }
} }
calcHandleQty(this.detailSource) calcHandleQty(this.detailSource)

Loading…
Cancel
Save