From 0a43c7fde3df03093bdaeb231004f1f216c36874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Tue, 12 Nov 2024 19:57:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20src\pages\scrap\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/scrap/record/scrapRecord.vue | 76 +++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/src/pages/scrap/record/scrapRecord.vue b/src/pages/scrap/record/scrapRecord.vue index 503e5010..d52e7e92 100644 --- a/src/pages/scrap/record/scrapRecord.vue +++ b/src/pages/scrap/record/scrapRecord.vue @@ -19,7 +19,17 @@ - + + + + @@ -46,7 +56,9 @@ import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRef import { scrapRecordSubmit } from '@/api/request2.js' import { goHome, deepCopyData } from '@/common/basic.js' - +import { + calc +} from '@/common/calc' import { getInventoryStatusDesc, getDirectoryItemArray, getScarpReasonList } from '@/common/directory.js' import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' @@ -56,7 +68,8 @@ import winScanPack from '@/mycomponents/scan/winScanPack.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() @@ -77,6 +90,7 @@ const comMessageRef = ref() const scanPopup = ref() const scanLocationCode = ref() const managementList = ref([]) +const managementType = ref('') const show = ref(false) const reasonCode = ref('') onLoad((option) => { @@ -102,8 +116,46 @@ onNavigationBarButtonTap((e) => { goHome() } }) - -const getScanResult = (result) => { +const getScanResult = (result, managementTypeParams)=> { + managementType.value = managementTypeParams + console.log("模式" + managementTypeParams) + if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { + setDataBatch(result) + } else { + setData(result) + } +} +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) { + const itemp = createItemInfo(balance, pack); + let newDetail = createDetailInfo(balance, pack); // + itemp.subList.push(newDetail); + detailSource.value.push(itemp) + } else { + const 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 setData = (result) => { const { balance } = result const { label } = result const pack = result.package @@ -157,11 +209,17 @@ 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 { + //TODO 没有定义 + // getBusinessType() } - scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) + } const showFromLocationPopup = () => { nextTick(() => {