From a653457ef9e7d0760c9a49179794d590846b6934 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 23 七月 2025 20:06:56 +0800
Subject: [PATCH] LLJ检验结果录入优化:保存后自动聚焦输入框

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

diff --git a/pages/QC/LLJ/detail.vue b/pages/QC/LLJ/detail.vue
index 41783ec..b124973 100644
--- a/pages/QC/LLJ/detail.vue
+++ b/pages/QC/LLJ/detail.vue
@@ -141,6 +141,7 @@
 								澶囨敞
 							</button>
 							<input v-if="(tableData.length < formData.checkQyt) && formData.fupAllow && formData.fdownAllow"
+								ref="numberInput"
 								@input="onNumberInput"
 								@confirm="onEnterSave"
 								v-model="formData.fcheckResu"
@@ -149,6 +150,7 @@
 								placeholder="璇疯緭鍏ユ楠岀粨鏋�..."
 								placeholder-class="placeholder" />
 							<input v-else
+								ref="textInput"
 								@input="search($event)"
 								@confirm="onEnterSave"
 								v-model="inputTxt"
@@ -182,7 +184,9 @@
 						 
 						<view class="input-wrapper" style="margin-top: 15px;">
 
-							<input v-if="(tableData.length < formData.checkQyt)" @input="search($event)"
+							<input v-if="(tableData.length < formData.checkQyt)" 
+								ref="textInput2"
+								@input="search($event)"
 								@confirm="onEnterSave"
 								v-model="inputTxt" type="text" class="result-input" placeholder="璇疯緭鍏ユ楠岀粨鏋�..."
 								placeholder-class="placeholder" />
@@ -556,6 +560,23 @@
 					this.$showMessage("淇濆瓨鎴愬姛");
 					this.refreshResult();
 					this.inputTxt = '';
+					
+					// 璁剧疆鐒︾偣鍥炲埌瀵瑰簲鐨勮緭鍏ユ
+					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();
+							}
+						}
+					});
 				})
 
 			},

--
Gitblit v1.9.3