diff --git a/healthlink-his-ui/src/views/doctorstation/components/examination/examinationApplication.vue b/healthlink-his-ui/src/views/doctorstation/components/examination/examinationApplication.vue index 1eb377740..3399566c9 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/examination/examinationApplication.vue @@ -271,7 +271,8 @@ > @@ -1759,12 +1760,14 @@ watch(selectedMethods, () => { }, { deep: true }); // 监听患者变化 -watch(() => props.patientInfo, (newVal) => { - if (newVal?.encounterId) { - initPatientForm(newVal); +// 🔧 Bug #767 同类修复:移除 deep: true,避免深层属性变化时重置用户输入 +// 父组件通过整体替换 patientInfo 对象来切换患者,watch 引用变化即可,无需 deep +watch(() => props.patientInfo?.encounterId, (newEncounterId) => { + if (newEncounterId && props.patientInfo?.encounterId) { + initPatientForm(props.patientInfo); getList(); } -}, { immediate: true, deep: true }); +}, { immediate: true }); watch(() => props.activeTab, async (val) => { if (val === 'examination') { diff --git a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue index a52538b5f..094e6f6b5 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue @@ -2618,24 +2618,21 @@ watch(() => props.activeTab, async (newVal) => { }) // 监听patientInfo变化,确保encounterId及时更新并重新加载数据 -watch(() => props.patientInfo, async (newVal) => { - if (newVal && newVal.encounterId) { - const oldEncounterId = queryParams.encounterId - queryParams.encounterId = newVal.encounterId +// 🔧 Bug #767 修复:移除 deep: true,避免深层属性变化时重置就诊卡号等用户输入 +// 父组件通过整体替换 patientInfo 对象来切换患者,watch 引用变化即可,无需 deep +watch(() => props.patientInfo?.encounterId, async (newEncounterId, oldEncounterId) => { + if (newEncounterId) { + queryParams.encounterId = newEncounterId // 初始化数据 await initData(); // 如果encounterId发生变化,重新加载检验申请单列表 - if (oldEncounterId !== newVal.encounterId) { + if (oldEncounterId !== newEncounterId) { getInspectionList() } - - // 更新科室编码 - // const currentDeptCode = await getCurrentDeptCode(); - // formData.applyDeptCode = currentDeptCode || ''; } -}, { deep: true, immediate: true }) +}, { immediate: true }) // Bug #329: 监听已选择的检验项目,自动更新检验项目文本并设置默认执行科室 watch(() => selectedInspectionItems.value, async (newVal) => {