From e8ce6dde3cb6cb84cf1f0ff8548b2c6637304140 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Tue, 5 Aug 2025 22:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99-OCR=E8=AF=86?= =?UTF-8?q?=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materialsStation/toolsLease/codeOut.vue | 28 +- .../{ocrOutScan.nvue => ocrOutScan-old.nvue} | 0 .../toolsLease/ocrScan/ocrOutScan.vue | 1015 +++++++++++++++++ src/services/index.js | 5 + 4 files changed, 1041 insertions(+), 7 deletions(-) rename src/pages/materialsStation/toolsLease/ocrScan/{ocrOutScan.nvue => ocrOutScan-old.nvue} (100%) create mode 100644 src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue diff --git a/src/pages/materialsStation/toolsLease/codeOut.vue b/src/pages/materialsStation/toolsLease/codeOut.vue index 4edfa68..01b20fc 100644 --- a/src/pages/materialsStation/toolsLease/codeOut.vue +++ b/src/pages/materialsStation/toolsLease/codeOut.vue @@ -241,17 +241,31 @@ onLoad((opt) => { }) onShow((opt) => { - uni.$on('paramsReceived', (data) => { + uni.$once('paramsReceived', (data) => { console.log('🚀 ~ uni.$on ~ data:', data) if (data) { - codeDeviceList.value.unshift({ + if (data.typeId != queryParamsTemp.value.typeId) { + uni.showToast({ + title: `规格型号${data.typeName}不匹配, 请重新添加`, + icon: 'none', + duration: 1500, + }) + return + } + + const newItem = { ...data, - checked: true, // 默认未选中 - }) + checked: true, + outType: 4, + } // 去重 - codeDeviceList.value = [ - ...new Map(codeDeviceList.value.map((item) => [item.maId, item])).values(), - ] + const exists = codeDeviceList.value.some((item) => item.maCode === newItem.maCode) + if (exists) { + uni.showToast({ title: '设备已添加', icon: 'none' }) + } else { + codeDeviceList.value.unshift(newItem) + } + allChecked.value = codeDeviceList.value.every((e) => e.checked) } }) diff --git a/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.nvue b/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan-old.nvue similarity index 100% rename from src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.nvue rename to src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan-old.nvue diff --git a/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue b/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue new file mode 100644 index 0000000..d342427 --- /dev/null +++ b/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue @@ -0,0 +1,1015 @@ + + + + + diff --git a/src/services/index.js b/src/services/index.js index 85eefd6..850101c 100644 --- a/src/services/index.js +++ b/src/services/index.js @@ -5,6 +5,11 @@ import { http } from '@/utils/http' */ export const appLoginAPI = (data) => { return false + // return http({ + // method: 'POST', + // url: '/auth/login', + // data, + // }) } /** * 获取用户信息