From 33a59d5e2650521b51cb065a219f31f8afbbb241 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 29 Aug 2024 16:40:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=89=AB=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycomponents/package/packageCard.vue | 14 +++++++ src/mycomponents/scan/winComScan.vue | 3 ++ src/mycomponents/scan/winScanPack.vue | 11 +++++- .../scan/winScanPackAndLocation.vue | 26 +++++++++++++ .../job/productReceiptDetail.vue | 3 +- .../purchaseReceipt/job/receiptDetail.vue | 20 ++++++---- src/pages/putaway/job/putawayDetail.vue | 37 +++++++++++++++---- src/pages/putaway/job/putawayJob.vue | 2 +- 8 files changed, 98 insertions(+), 18 deletions(-) diff --git a/src/mycomponents/package/packageCard.vue b/src/mycomponents/package/packageCard.vue index 607e3f39..649ffcc5 100644 --- a/src/mycomponents/package/packageCard.vue +++ b/src/mycomponents/package/packageCard.vue @@ -70,6 +70,20 @@ const props = defineProps({ default: '库位' } }) +watch( + () => props.dataContent, + (newVal, oldVal) => { + if (newVal.scaned) { + newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}` + } else { + newVal.copyContent = '' + } + }, + { + immediate: true, + deep: true + } +) const copy = () => { // HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 const content = `HPQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}` diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue index b2dd09ca..3e2ced0e 100644 --- a/src/mycomponents/scan/winComScan.vue +++ b/src/mycomponents/scan/winComScan.vue @@ -102,6 +102,9 @@ watch( placeholderValue.value = `请扫描${val}` } ) +const setItemCodeSimulate = () => { + scanMsg.value = scanMsg +} const hide = () => { // #ifdef APP-PLUS // 只是解决软键盘的闪现 diff --git a/src/mycomponents/scan/winScanPack.vue b/src/mycomponents/scan/winScanPack.vue index 0f8ac98c..28d88f89 100644 --- a/src/mycomponents/scan/winScanPack.vue +++ b/src/mycomponents/scan/winScanPack.vue @@ -16,6 +16,8 @@ + + @@ -41,6 +43,12 @@ const props = defineProps({ const show = ref(false) const comMessageRef = ref() const comscan = ref() +const comscansimulate = ref() +// 模拟扫描功能 +const simulateScan = (item) => { + comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent) + comscansimulate.value.clickScanMsg() +} const openScanPopup = () => { setTimeout((res) => { show.value = true @@ -88,7 +96,8 @@ defineExpose({ openScanPopup, closeScanPopup, getfocus, - losefocus + losefocus, + simulateScan }) diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index fa8e25ea..38129740 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -34,6 +34,8 @@ + + @@ -141,6 +143,30 @@ const openScanPopupForJob = (fromLocationCodePrams, fromLocationListPrams, jobCo inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态 fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) // 出库库存状态 } +// 模拟扫描 +const openScanPopupForJobSimulate = (fromLocationCodeParams, fromLocationListParams, jobContent, item) => { + fromLocationCode.value = fromLocationCodeParams + fromLocationList.value = fromLocationListParams + if (fromLocationListParams != '') { + // this.packGetFocus(); + if (comscansimulate.value != undefined) { + comscansimulate.value.getfocus() + } + } else if (fromLocationList.value.length == 0) { + // this.locationGetFocus(); + alert('没有来源库位:List') + } else { + fromLocationCode.value = fromLocationList.value[0] + } + fromInventoryStatuses.value = getDirectoryItemArray(jobContent.outInventoryStatuses) + inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态 + fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) // 出库库存状态 + const timer = setTimeout((res) => { + if (timer) { + clearTimeout(timer) + } + }, 500) +} const closeScanPopup = (content) => { show.value = false emit('close', '') diff --git a/src/pages/productReceipt/job/productReceiptDetail.vue b/src/pages/productReceipt/job/productReceiptDetail.vue index 5d4186a6..ea954f26 100644 --- a/src/pages/productReceipt/job/productReceiptDetail.vue +++ b/src/pages/productReceipt/job/productReceiptDetail.vue @@ -180,7 +180,8 @@ const getDetail = () => { r.subList.forEach((s) => { if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { s.scaned = true - s.handleQty = s.qty + scanPopup.value.simulateScan(s) + // s.handleQty = s.qty } }) }) diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 942002db..2559021d 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -97,7 +97,7 @@ const comReceiptDetailCardRef = ref() const count = ref(0) onLoad((option) => { id.value = option.id - // scanedPackingNumber.value = option.scaned || '' + scanedPackingNumber.value = option.scaned || '' operation.value = option.operation if (id.value != undefined) { // 新建的任务自动接收 @@ -168,14 +168,19 @@ const getDetail = () => { jobStatus.value = res.data.status jobToLocationCode.value = subList.value[0].toLocationCode detailSource.value = getTreeDataSource(subList.value) - detailSource.value.forEach((r) => { - r.subList.forEach((s) => { - s.scaned = false - if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true + isAllReceived.value = false + nextTick(() => { + detailSource.value.forEach((r) => { + r.subList.forEach((s) => { + if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { + s.scaned = true + scanPopup.value.simulateScan(s) + } + }) }) + count.value++ + isAllReceived.value = false }) - count.value++ - isAllReceived.value = false } else { showMessage('列表数据为0') } @@ -406,7 +411,6 @@ const submitJob = () => { pageSize: 1000 }).then((res1) => { timerCount += 1 - console.log(11111) if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) { uni.hideLoading() clearInterval(timer1) diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue index 05491938..84caba2b 100644 --- a/src/pages/putaway/job/putawayDetail.vue +++ b/src/pages/putaway/job/putawayDetail.vue @@ -146,13 +146,6 @@ const getDetail = () => { subList.value = res.data.subList detailSource.value = getTreeDataSource(subList.value) - detailSource.value.forEach((r) => { - r.subList.forEach((s) => { - if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true - s.inventoryStatus = s.inspectResult // 更新检验结果状态 - }) - }) - fromLocationCode.value = subList.value[0].fromLocationCode jobToLocationCode.value = subList.value[0].toLocationCode toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) @@ -162,6 +155,16 @@ const getDetail = () => { } else { toLocationCode.value = jobToLocationCode.value } + detailSource.value.forEach((r) => { + r.subList.forEach((s) => { + if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { + s.scaned = true + s.packList.forEach((item) => (item.scaned = true)) + s.inventoryStatus = s.inspectResult // 更新检验结果状态 + openScanPopupSimulate(s) + } + }) + }) } else { showMessage('列表数据为0') } @@ -200,6 +203,26 @@ const continueScan = () => { const updateData = () => { calcTreeHandleQty(detailSource.value) } +// 模拟扫描功能 +const openScanPopupSimulate = (item) => { + let fromlocationCode = '' + const fromlocationList = [] + for (let i = 0; i < detailSource.value.length; i++) { + const item = detailSource.value[i] + item.subList.forEach((l) => { + // 重复的库位不往里面插入 + const location = fromlocationList.find((res) => res == l.fromLocationCode) + if (location == undefined) { + fromlocationList.push(l.fromLocationCode) + } + // 来源库位赋默认值 + if (fromlocationCode == '') { + fromlocationCode = l.fromLocationCode + } + }) + } + scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item) +} const openScanPopup = () => { let fromlocationCode = '' const fromlocationList = [] diff --git a/src/pages/putaway/job/putawayJob.vue b/src/pages/putaway/job/putawayJob.vue index 77aee44f..5506707c 100644 --- a/src/pages/putaway/job/putawayJob.vue +++ b/src/pages/putaway/job/putawayJob.vue @@ -256,7 +256,7 @@ const openScanPopup = () => { const selectItem = (item) => { scanPopup.value.closeScanPopup() uni.navigateTo({ - url: `./putawayDetail?id=${item.masterId}&status=${item.status}` + url: `./putawayDetail?id=${item.masterId}&status=${item.status}&scaned=${item.packingNumber}` }) }