From e750894e011adfa508d0684fa8e1e770979dafa2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E5=88=9D?= <3236758982@qq.com>
Date: Tue, 26 May 2026 10:39:41 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9D=8E=E7=BA=A2=E6=94=80=EF=BC=9AV2.0?=
=?UTF-8?q?.061=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E3=80=81=E9=94=80?=
=?UTF-8?q?=E5=94=AE=E5=87=BA=E5=BA=93=E6=B7=BB=E5=8A=A0=E6=89=AB=E7=A0=81?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages-erp/purchase-in/scan-in/index.vue | 19 ++-
.../scan-out/components/recent-scan-list.vue | 161 +++++++++---------
src/pages-erp/sale-out/scan-out/index.vue | 19 ++-
3 files changed, 108 insertions(+), 91 deletions(-)
diff --git a/src/pages-erp/purchase-in/scan-in/index.vue b/src/pages-erp/purchase-in/scan-in/index.vue
index 04e0827..b6f65c6 100644
--- a/src/pages-erp/purchase-in/scan-in/index.vue
+++ b/src/pages-erp/purchase-in/scan-in/index.vue
@@ -268,17 +268,28 @@ onMounted(async () => {
}, 500)
})
+const ERROR_DISPLAY_MS = 2000
+
/** 重置到初始状态 */
function resetToIdle() {
clearScanInputs()
locationInfo.value = null
productPreview.value = null
step.value = 'idle'
- // 延迟清空错误 + 聚焦光标,让用户先看到错误提示
setTimeout(() => {
clearFeedback()
focusLocationInput()
- }, 800)
+ }, ERROR_DISPLAY_MS)
+}
+
+/** 停留在产品扫码阶段 + 聚焦产品输入框(扫产品失败用) */
+function resetToProductScan() {
+ productBarCode.value = ''
+ productPreview.value = null
+ setTimeout(() => {
+ clearFeedback()
+ focusProductInput()
+ }, ERROR_DISPLAY_MS)
}
/** 聚焦库位码输入框 */
@@ -394,13 +405,13 @@ async function handleProductScan() {
productPreview.value = await getProductByBarCode(code)
} catch {
setErrorFeedback(`条码 ${code} 未匹配到产品`)
- resetToIdle()
+ resetToProductScan()
return
}
if (!productPreview.value?.id) {
setErrorFeedback(`条码 ${code} 未匹配到产品`)
- resetToIdle()
+ resetToProductScan()
return
}
diff --git a/src/pages-erp/sale-out/scan-out/components/recent-scan-list.vue b/src/pages-erp/sale-out/scan-out/components/recent-scan-list.vue
index 20b1c9b..130925e 100644
--- a/src/pages-erp/sale-out/scan-out/components/recent-scan-list.vue
+++ b/src/pages-erp/sale-out/scan-out/components/recent-scan-list.vue
@@ -3,134 +3,129 @@
暂无扫码记录
+
-
-
- {{ record.productName || '-' }}
- {{ record.productSpec || '-' }}
-
-
- {{ record.locationCode || '-' }}
- x{{ record.scanCount || 1 }}
-
+
-
- {{ formatTime(record.scanTime) }}
- 删除
+
+
+ 条码:{{ record.productBarCode || '-' }}
+ 规格:{{ record.productSpec || '-' }}
+
+
+ 仓库:{{ record.warehouseName || '-' }}
+ 单位:{{ record.productUnit || '-' }}
+
+
+ 库位:{{ record.locationCode || '-' }}
+ 批次:{{ record.batchNo || '-' }}
+
+
diff --git a/src/pages-erp/sale-out/scan-out/index.vue b/src/pages-erp/sale-out/scan-out/index.vue
index 4f9f5e8..1710f50 100644
--- a/src/pages-erp/sale-out/scan-out/index.vue
+++ b/src/pages-erp/sale-out/scan-out/index.vue
@@ -268,17 +268,28 @@ onMounted(async () => {
}, 500)
})
+const ERROR_DISPLAY_MS = 2000
+
/** 重置到初始状态 */
function resetToIdle() {
clearScanInputs()
locationInfo.value = null
productPreview.value = null
step.value = 'idle'
- // 延迟清空错误 + 聚焦光标,让用户先看到错误提示
setTimeout(() => {
clearFeedback()
focusLocationInput()
- }, 800)
+ }, ERROR_DISPLAY_MS)
+}
+
+/** 停留在产品扫码阶段 + 聚焦产品输入框(扫产品失败用) */
+function resetToProductScan() {
+ productBarCode.value = ''
+ productPreview.value = null
+ setTimeout(() => {
+ clearFeedback()
+ focusProductInput()
+ }, ERROR_DISPLAY_MS)
}
/** 聚焦库位码输入框 */
@@ -394,13 +405,13 @@ async function handleProductScan() {
productPreview.value = await getProductByBarCode(code)
} catch {
setErrorFeedback(`条码 ${code} 未匹配到产品`)
- resetToIdle()
+ resetToProductScan()
return
}
if (!productPreview.value?.id) {
setErrorFeedback(`条码 ${code} 未匹配到产品`)
- resetToIdle()
+ resetToProductScan()
return
}