From a0c6a684bd0830e76567ebb2956da7e718437ed1 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Tue, 28 May 2024 15:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/saleHome/component/shop.vue | 5 +++++ src/views/saleHome/index.vue | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/saleHome/component/shop.vue b/src/views/saleHome/component/shop.vue index 5d9fc8c..59a7bee 100644 --- a/src/views/saleHome/component/shop.vue +++ b/src/views/saleHome/component/shop.vue @@ -40,8 +40,13 @@ const handleEnter = _.throttle(() => { emit("getStoreList", obj, true); }, 300) +const inputBlur = ()=>{ + codeRef.value?.blur(); +} + defineExpose({ name, + inputBlur }); const isfocus = ref(false); diff --git a/src/views/saleHome/index.vue b/src/views/saleHome/index.vue index ce07390..1a8812d 100644 --- a/src/views/saleHome/index.vue +++ b/src/views/saleHome/index.vue @@ -45,11 +45,12 @@ const getStoreList = (data = {}, reload = false) => { if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true; storeList.value = storeList.value.concat(res.data.lists); if ( - data.bar_code && + data.code && storeList.value.length == 1 && - isAllDigits(data.bar_code) + isAllDigits(data.code) ) { - shopRef.value.bar_code = ""; + shopRef.value.code = ""; + shopRef.value.inputBlur(); changeItem(storeList.value[0]); } where.value.page_no++;