Browse Source

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

intex
lijuncheng 3 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() {
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)
}
}

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

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

Loading…
Cancel
Save