From dd24a2ea978b1e77ae4a510053cd1df0bf1863e7 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期二, 18 三月 2025 15:07:30 +0800 Subject: [PATCH] Qx --- src/views/doctor/check/index.vue | 44 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue index a5cc1af..d612c46 100644 --- a/src/views/doctor/check/index.vue +++ b/src/views/doctor/check/index.vue @@ -274,16 +274,22 @@ <el-col v-show="baogaoqian"> <template> <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px"> - <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"> + <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index" :lazy="false"> <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px" style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName"> <el-table-column prop="project.proName" label="妫�娴嬮」鐩�" width="150"> </el-table-column> <el-table-column prop="proResult" label="妫�娴嬬粨鏋�" width="150"> - <template slot-scope="scope"> + <!-- <template slot-scope="scope"> <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off" placeholder="璇疯緭鍏ユ娴嬬粨鏋�" @focus="handleFocus(scope.row)" @blur="handleInputConfirm(scope.row)" @input="vale($event, scope.row)" :disabled="scope.row.project.proName === 'BMI'" + ></el-input> --> + <template slot-scope="{ row, $index }"> + <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-item${index}-row${$index}`" + @keydown.enter.native="keyInputConfirm($event,index,$index)" @focus="handleFocus(row)" + @blur="handleInputConfirm(row)" @input="vale($event, row)" + :disabled="row.project.proName === 'BMI'" ></el-input> </template> </el-table-column> @@ -414,16 +420,22 @@ <el-col :span="18" v-show="baogaohou"> <template> <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px"> - <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"> + <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index" :lazy="false"> <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px" style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName"> <el-table-column prop="project.proName" label="妫�娴嬮」鐩�" width="100"> </el-table-column> <el-table-column prop="proResult" label="妫�娴嬬粨鏋�" width="150"> - <template slot-scope="scope"> + <!-- <template slot-scope="scope"> <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off" placeholder="璇疯緭鍏ユ娴嬬粨鏋�" @focus="handleFocus(scope.row)" @blur="handleInputConfirm(scope.row)" - @input="vale"></el-input> + @input="vale"></el-input> --> + <template slot-scope="{ row, $index }"> + <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-item${index}-row${$index}`" + @keydown.enter.native="keyInputConfirm($event,index,$index)" @focus="handleFocus(row)" + @blur="handleInputConfirm(row)" @input="vale($event, row)" + :disabled="row.project.proName === 'BMI'" + ></el-input> </template> </el-table-column> <el-table-column label="瑙勫垯" width="70"> @@ -1388,6 +1400,28 @@ this.row.rulesList = param2; }, + + keyInputConfirm(event,index, currentRowIndex) { + // 闃绘榛樿鍥炶溅琛屼负锛屾瘮濡傛彁浜よ〃鍗� + event.preventDefault(); + event.stopPropagation() + const nextRowIndex = currentRowIndex + 1; // 璁$畻涓嬩竴琛岀储寮� + // 濡傛灉涓嬩竴琛屽瓨鍦紝鍒欒仛鐒﹁琛岀殑杈撳叆妗� + if (nextRowIndex < this.proParentList.sons.length) { + this.$nextTick(() => { + const nextInputRef = `input-item${index}-row${nextRowIndex}`; + const nextInput = this.$refs[nextInputRef]; + if (nextInput) { + // 澶勭悊 ref 鍙兘涓烘暟缁勭殑鎯呭喌锛堝鍔ㄦ�佹覆鏌擄級 + const target = Array.isArray(nextInput) ? nextInput[0] : nextInput; + target.focus(); // 鑱氱劍杈撳叆妗� + // target.select(); // 鍙�夛細閫変腑鏂囨湰 + } + }); + } + + }, + getList() { this.loading = true; this.queryParams.type = this.tjStatus; -- Gitblit v1.8.0