From 2fca205e92bda499f50d8336da5809952ac8fffe Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 9 Oct 2024 15:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=99=E7=9B=98=E4=BB=BB=E5=8A=A1=E6=89=B9?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/PackageAndItemCard.vue | 2 +- src/pages/count/job/fuzzyCountDetail.vue | 82 ++++++++++++------- 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/src/mycomponents/package/PackageAndItemCard.vue b/src/mycomponents/package/PackageAndItemCard.vue index 502e14c8..a518ffdd 100644 --- a/src/mycomponents/package/PackageAndItemCard.vue +++ b/src/mycomponents/package/PackageAndItemCard.vue @@ -3,7 +3,7 @@ - + diff --git a/src/pages/count/job/fuzzyCountDetail.vue b/src/pages/count/job/fuzzyCountDetail.vue index 62b156aa..b8b66714 100644 --- a/src/pages/count/job/fuzzyCountDetail.vue +++ b/src/pages/count/job/fuzzyCountDetail.vue @@ -44,8 +44,7 @@ - + 已扫描: @@ -102,6 +101,9 @@ getCountScopeType } from '@/common/directory.js'; + import { + getManagementPrecisions, + } from '@/common/balance.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -338,32 +340,57 @@ } }, - onScan(packInfo) { - let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == - packInfo - .number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); - if (detail == undefined) { - detail = this.createDetailInfo(packInfo); - this.detailSource.unshift(detail) - this.scanPopupGetFocus(); - } else { - let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r - .packingNumber == - packInfo - .number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); - if (index >= 0) { - this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 - //提交 - this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { - if (res) { - this.closeScanPopup(); - this.edit(detail); + async onScan(packInfo) { + console.log(packInfo) + //获取管理模式,封装参数\ + await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => { + if (res.success) { + this.managementList = res.list; + this.managementType = this.managementList.some(item => item.ManagementPrecision == + 'BY_BATCH') ? 'BY_BATCH' : '' + if (this.managementType == 'BY_BATCH') { + let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.batch == packInfo + .batch && r.inventoryStatus == "OK"); + if (detail == undefined) { + detail = this.createDetailInfo(packInfo); + detail.packingNumber = '' + detail.packUnit = '' + this.detailSource.unshift(detail) + this.scanPopupGetFocus(); } else { + let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.batch == packInfo + .batch && r.inventoryStatus == "OK"); + if (index >= 0) { + this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 + this.detailSource[0].qty = calc.add(this.detailSource[0].qty, packInfo.qty) + } + } + } else { + let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == + packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); + if (detail == undefined) { + detail = this.createDetailInfo(packInfo); + this.detailSource.unshift(detail) this.scanPopupGetFocus(); + } else { + let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber == + packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); + if (index >= 0) { + this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 + //提交 + this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { + if (res) { + this.closeScanPopup(); + this.edit(detail); + } else { + this.scanPopupGetFocus(); + } + }); + } } - }); + } } - } + }) }, //创建盘盈的明细 @@ -400,10 +427,7 @@ return detail; }, - editClose() { - this.$refs.countQtyEdit.closeEditPopup(); - }, - + swipeClick(e, item, index) { if (e.content.text == "编辑") { this.edit(item) @@ -467,7 +491,7 @@ mask: true }); var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); + console.log("提交参数", params); countJobSubmit(params).then(res => { uni.hideLoading() if (res.data == null) {