| | |
| | | <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-${$index}`" |
| | | @keyup.enter.native="keyInputConfirm($event, $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 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-${$index}`" |
| | | @keyup.enter.native="keyInputConfirm($event, $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"> |
| | |
| | | this.row.rulesList = param2; |
| | | }, |
| | | |
| | | |
| | | keyInputConfirm(event, currentRowIndex) { |
| | | // 阻止默认回车行为,比如提交表单 |
| | | event.preventDefault(); |
| | | const nextRowIndex = currentRowIndex + 1; // 计算下一行索引 |
| | | |
| | | // 如果下一行存在,则聚焦该行的输入框 |
| | | if (nextRowIndex < this.proParentList.sons.length) { |
| | | this.$nextTick(() => { |
| | | const nextInputRef = `input-${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; |