From 6f207fb20c28abd62a16565706007f2f1e0605e7 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期四, 24 七月 2025 09:08:20 +0800
Subject: [PATCH] 来料检回车聚焦

---
 pages/QC/LLJ/detail.vue |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/pages/QC/LLJ/detail.vue b/pages/QC/LLJ/detail.vue
index b124973..0b40165 100644
--- a/pages/QC/LLJ/detail.vue
+++ b/pages/QC/LLJ/detail.vue
@@ -142,8 +142,10 @@
 							</button>
 							<input v-if="(tableData.length < formData.checkQyt) && formData.fupAllow && formData.fdownAllow"
 								ref="numberInput"
+								:focus="isFocus"
 								@input="onNumberInput"
 								@confirm="onEnterSave"
+								@blur="isFocus = false"
 								v-model="formData.fcheckResu"
 								type="text"
 								class="result-input"
@@ -151,8 +153,10 @@
 								placeholder-class="placeholder" />
 							<input v-else
 								ref="textInput"
+								:focus="isFocus"
 								@input="search($event)"
 								@confirm="onEnterSave"
+								@blur="isFocus = false"
 								v-model="inputTxt"
 								type="text"
 								class="result-input"
@@ -298,6 +302,7 @@
 				showMeom:false,
 				meom: '',
 				autoSaveTimer: null, // 鑷姩淇濆瓨瀹氭椂鍣�
+				isFocus: false, // 鏂板锛屾帶鍒惰緭鍏ユ鑱氱劍
 			}
 		},
 		methods: {
@@ -560,22 +565,10 @@
 					this.$showMessage("淇濆瓨鎴愬姛");
 					this.refreshResult();
 					this.inputTxt = '';
-					
-					// 璁剧疆鐒︾偣鍥炲埌瀵瑰簲鐨勮緭鍏ユ
+					// 浣跨敤 isFocus 鎺у埗鑱氱劍锛屽吋瀹瑰绔�
+					this.isFocus = false;
 					this.$nextTick(() => {
-						if (this.formData.fupAllow && this.formData.fdownAllow) {
-							// 鏈変笂涓嬮檺鏃讹紝鐒︾偣鍥炲埌鏁板瓧杈撳叆妗�
-							if (this.$refs.numberInput) {
-								this.$refs.numberInput.focus();
-							}
-						} else {
-							// 鏃犱笂涓嬮檺鏃讹紝鐒︾偣鍥炲埌鏂囨湰杈撳叆妗�
-							if (this.$refs.textInput) {
-								this.$refs.textInput.focus();
-							} else if (this.$refs.textInput2) {
-								this.$refs.textInput2.focus();
-							}
-						}
+						this.isFocus = true;
 					});
 				})
 

--
Gitblit v1.9.3