From f16b20728c63ae88b92d149130bb3dd1974f6a0e Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 17 Feb 2025 16:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8F=91=E6=96=99=E5=92=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=8F=91=E6=96=99=E9=87=8D=E5=A4=8D=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/job/issueDetailBatch.vue | 86 ++++++++----------- src/pages/issue/record/directIssueByBatch.vue | 28 +++--- 2 files changed, 49 insertions(+), 65 deletions(-) diff --git a/src/pages/issue/job/issueDetailBatch.vue b/src/pages/issue/job/issueDetailBatch.vue index 8b782f5a..f6112f63 100644 --- a/src/pages/issue/job/issueDetailBatch.vue +++ b/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) } } diff --git a/src/pages/issue/record/directIssueByBatch.vue b/src/pages/issue/record/directIssueByBatch.vue index bb5a4d26..98ffbcb7 100644 --- a/src/pages/issue/record/directIssueByBatch.vue +++ b/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)