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() }