From 29bbcee1b246a8f6d54858e60862916690867347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Wed, 13 Nov 2024 10:27:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20src\pages\transfer\record=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9=20Vue2=E5=8D=87=E7=BA=A7Vue3=2010/2?= =?UTF-8?q?5-11-11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/transfer/record/deliverRecord.vue | 87 ++++++++++++++++++--- src/pages/transfer/record/receiptRecord.vue | 19 +++-- 2 files changed, 88 insertions(+), 18 deletions(-) diff --git a/src/pages/transfer/record/deliverRecord.vue b/src/pages/transfer/record/deliverRecord.vue index 82d777a6..8e44cb58 100644 --- a/src/pages/transfer/record/deliverRecord.vue +++ b/src/pages/transfer/record/deliverRecord.vue @@ -8,7 +8,19 @@ - + + + + @@ -28,7 +40,7 @@ - + @@ -42,7 +54,9 @@ import { getPrecisionStrategyList } from '@/common/balance.js' import { goHome, deepCopyData, getPackingNumberAndBatchByList } from '@/common/basic.js' import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' - +import { + calc +} from '@/common/calc' import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' import winScanButton from '@/mycomponents/scan/winScanButton.vue' @@ -51,7 +65,8 @@ import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue' import winScanLocation from '@/mycomponents/scan/winScanLocation.vue' import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' -import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' +import RecordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' +import RecordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' import { useCountStore } from '@/store' // 获取自定义的store const store = useCountStore() @@ -67,11 +82,14 @@ const inInventoryStatus = ref('') // 目标入库库存状态 const outInventoryStatus = ref('') // 来源出库库存状态 const businessType = ref({}) const managementList = ref([]) +const managementType = ref('') const toWarehouseCode = ref('') const comMessageRef = ref() const scanPopup = ref() const fromLocationCode = ref() -const scanLocationCode = ref() +const scanLocationCode = ref(null) +const editItem = ref() + onLoad((option) => { uni.setNavigationBarTitle({ title: option.title @@ -94,7 +112,15 @@ onNavigationBarButtonTap((e) => { goHome() } }) -const getScanResult = (result) => { +const getScanResult = (result,managementTypeParams)=> { + managementType.value = managementTypeParams + if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ + setDataBatch(result) + }else{ + setData(result) + } +} +const setData = (result) => { const { balance } = result const { label } = result const pack = result.package @@ -124,7 +150,44 @@ const getScanResult = (result) => { } handleCalcHandleQty() } +const setDataBatch = (result)=>{ + let { balance,label } = result + let pack = result.package; + let item = detailSource.value.find(res => { + if (res.itemCode == balance.itemCode) { + return res + } + }) + if (item == undefined) { + let itemp = createItemInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + newDetail.inventoryStatus = "OK" + itemp.subList.push(newDetail); + detailSource.value.push(itemp) + } else { + let detail = item.subList.find(r => { + if (r.batch == balance.batch && + r.locationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + let newDetail = createDetailInfo(balance, pack); + item.subList.push(newDetail); + }else { + detail.handleQty = calc.add(detail.handleQty, result.label.qty) + } + } + calcHandleQty(detailSource.value) +} +const showScanToLocation = (item)=> { + editItem.value = item; + setTimeout(r => { + scanLocationCode.value.openScanPopup(); + }) +} const handleCalcHandleQty = () => { calcHandleQty(detailSource.value) } @@ -143,11 +206,15 @@ const removePack = () => { } const openScanPopup = () => { - if (fromLocationCode.value == '') { - showFromLocationPopup() - return + if (this.businessType) { + if (fromLocationCode.value == '') { + showFromLocationPopup() + return + } + scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) + } else { + getBusinessType() } - scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) } const showFromLocationPopup = () => { diff --git a/src/pages/transfer/record/receiptRecord.vue b/src/pages/transfer/record/receiptRecord.vue index 14e1201c..dc2b1913 100644 --- a/src/pages/transfer/record/receiptRecord.vue +++ b/src/pages/transfer/record/receiptRecord.vue @@ -8,7 +8,12 @@ - + + @@ -41,7 +46,7 @@ import { getPrecisionStrategyList } from '@/common/balance.js' import { goHome, deepCopyData, getPackingNumberAndBatchByList } from '@/common/basic.js' import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' - +import { calc } from '@/common/calc' import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' import winScanButton from '@/mycomponents/scan/winScanButton.vue' @@ -88,8 +93,10 @@ onNavigationBarButtonTap((e) => { goHome() } }) - -const getScanResult = (result) => { +const getScanResult = (result)=> { + setData(result) +} +const setData = (result) => { const { label } = result const pack = result.package const item = detailSource.value.find((res) => { @@ -266,10 +273,6 @@ const showErrorMessage = (message) => { }) } -const showScanMessage = (message) => { - comMessageRef.value.showScanMessage(message) -} - const afterCloseMessage = () => { scanPopupGetFocus() }