fix(doctorstation): 优化医嘱tab页诊断显示、输入框焦点及数据懒加载

- 诊断下拉框改为只读显示,仅显示主诊断,移除无主诊断时的兜底逻辑
  - 编辑区所有数字输入框(el-input-number)改为el-input,修复执行次数等输入框无法聚焦问题
  - 医嘱数据加载改为切到医嘱tab时触发,不再在选患者时预加载
  - focus选择器从.el-input-number__inner适配为.el-input__inner
This commit is contained in:
wangjian963
2026-06-24 11:17:34 +08:00
parent 69efdd89f6
commit 8845fdcd70
2 changed files with 23 additions and 55 deletions

View File

@@ -69,19 +69,13 @@
删除
</el-button>
<span class="descriptions-item-label"> 诊断 </span>
<el-select
v-model="conditionDefinitionId"
placeholder="诊断"
<el-input
:model-value="diagnosisName"
placeholder=""
style="width: 180px"
>
<el-option
v-for="item in diagnosisList"
:key="item.conditionId"
:label="item.name"
:value="item.definitionId"
@click="handleDiagnosisChange(item)"
/>
</el-select>
readonly
disabled
/>
<span class="descriptions-item-label"> 费用性质 </span>
<el-select
v-model="accountId"
@@ -377,12 +371,9 @@
class="required-field"
data-prop="executeNum"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.executeNum = el)"
v-model="scope.row.executeNum"
:min="1"
controls-position="right"
:controls="false"
style="width: 70px; margin-right: 20px"
@keyup.enter.prevent="handleEnter('executeNum', scope.row, scope.rowIndex)"
/>
@@ -419,15 +410,12 @@
class="required-field"
data-prop="doseQuantity"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.doseQuantity = el)"
v-model="scope.row.doseQuantity"
:min="0"
controls-position="right"
:controls="false"
style="width: 70px"
@input="convertValues(scope.row, scope.rowIndex)"
@keyup.enter.prevent="handleEnter('doseQuantity', scope.row, scope.rowIndex)"
@keyup.enter.prevent="handleEnter('doseQuantity', scope.row, scope.rowIndex)"
@change="calculateTotalAmount(scope.row, scope.rowIndex)"
/>
</el-form-item>
@@ -455,11 +443,9 @@
class="required-field"
data-prop="dose"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.dose = el)"
v-model="scope.row.dose"
controls-position="right"
:controls="false"
style="width: 70px"
@input="convertDoseValues(scope.row, scope.rowIndex)"
@keyup.enter.prevent="handleEnter('dose', scope.row, scope.rowIndex)"
@@ -548,13 +534,10 @@
class="required-field"
data-prop="dispensePerDuration"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.dispensePerDuration = el)"
v-model="scope.row.dispensePerDuration"
style="width: 80px"
:min="1"
controls-position="right"
:controls="false"
@input="calculateTotalAmount(scope.row, scope.rowIndex)"
@change="calculateTotalAmount(scope.row, scope.rowIndex)"
@keyup.enter.prevent="
@@ -564,7 +547,7 @@
<template #suffix>
</template>
</el-input-number>
</el-input>
</el-form-item>
<el-form-item
label="总量:"
@@ -572,12 +555,10 @@
class="required-field"
data-prop="quantity"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.quantity = el)"
v-model="scope.row.quantity"
style="width: 70px"
controls-position="right"
:controls="false"
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.rowIndex)"
@input="calculateTotalPrice(scope.row, scope.rowIndex)"
/>
@@ -666,13 +647,11 @@
class="required-field"
data-prop="quantity"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.quantity = el)"
v-model="scope.row.quantity"
placeholder="数量"
style="width: 70px"
controls-position="right"
:controls="false"
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.rowIndex)"
@input="calculateTotalAmount(scope.row, scope.rowIndex)"
/>
@@ -753,13 +732,11 @@
class="required-field"
data-prop="quantity"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.quantity = el)"
v-model="scope.row.quantity"
placeholder="数量"
style="width: 70px"
controls-position="right"
:controls="false"
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.rowIndex)"
@input="calculateTotalAmount(scope.row, scope.rowIndex)"
/>
@@ -848,13 +825,11 @@
class="required-field"
data-prop="quantity"
>
<el-input-number
<el-input
:ref="(el) => (inputRefs.quantity = el)"
v-model="scope.row.quantity"
placeholder="执行次数"
style="width: 100px"
controls-position="right"
:controls="false"
@keyup.enter.prevent="handleEnter('quantity', scope.row, scope.rowIndex)"
@input="calculateTotalPrice(scope.row, scope.rowIndex)"
/>
@@ -2220,7 +2195,6 @@ function getListInfo(addNewRow) {
// 关键:先等待处方列表数据获取完成
isAdding.value = false;
const res = await getPrescriptionList(props.patientInfo.encounterId);
// 🔧 BugFix: 过滤掉已作废statusEnum=5的会诊医嘱
const filteredData = res.data.filter(item => {
// 防止 contentJson 为空或 undefined 导致 JSON.parse 报错
@@ -2329,13 +2303,6 @@ function getDiagnosisInfo() {
encounterDiagnosisId.value = diagnosisInfo[0].encounterDiagnosisId;
diagnosisName.value = diagnosisInfo[0].name;
console.log('getDiagnosisInfo - 已设置主诊断:', diagnosisInfo[0]);
} else if (diagnosisList.value.length > 0) {
// 如果没有主诊断,使用第一个诊断
conditionDefinitionId.value = diagnosisList.value[0].definitionId;
conditionId.value = diagnosisList.value[0].conditionId;
encounterDiagnosisId.value = diagnosisList.value[0].encounterDiagnosisId;
diagnosisName.value = diagnosisList.value[0].name;
console.log('getDiagnosisInfo - 已设置第一个诊断:', diagnosisList.value[0]);
}
return res;
}).catch((error) => {
@@ -2668,15 +2635,15 @@ function selectAdviceBase(key, row) {
const lastExpandedRow = expandedRows[expandedRows.length - 1];
// 查找doseQuantity输入框优先
let targetInput = lastExpandedRow.querySelector('[data-prop="doseQuantity"] .el-input-number__inner');
let targetInput = lastExpandedRow.querySelector('[data-prop="doseQuantity"] .el-input__inner');
// 如果没找到,尝试其他方式
if (!targetInput && row.adviceType == 1) {
// 西药的情况找第一个el-input-number
targetInput = lastExpandedRow.querySelector('.el-input-number__inner');
// 西药的情况找第一个el-input
targetInput = lastExpandedRow.querySelector('.el-input__inner');
} else if (!targetInput) {
// 诊疗/耗材的情况找quantity输入框
targetInput = lastExpandedRow.querySelector('[data-prop="quantity"] .el-input-number__inner');
targetInput = lastExpandedRow.querySelector('[data-prop="quantity"] .el-input__inner');
}
// 最后的备用方案

View File

@@ -718,6 +718,7 @@ function handleClick(tab) {
diagnosisRef.value.getDetail(patientInfo.value.encounterId);
break;
case 'prescription':
prescriptionRef.value.getListInfo();
prescriptionRef.value.getDiagnosisInfo();
break;
case 'tcm':
@@ -848,7 +849,7 @@ function handleCardClick(item, index) {
updatePatientInfo(item);
activeTab.value = 'hospitalizationEmr';
nextTick(() => {
prescriptionRef.value.getListInfo();
// 医嘱数据改为切换到对应tab时才加载
tcmRef.value.getListInfo();
inspectionRef.value.getList();
if(examinationRef.value) examinationRef.value.getList();