767 【门诊医生工作站-检验】申请单下的就诊卡号无法填写
This commit is contained in:
@@ -271,7 +271,8 @@
|
||||
>
|
||||
<el-input
|
||||
v-model="form.medicalrecordNumber"
|
||||
readonly
|
||||
size="small"
|
||||
placeholder="请输入就诊卡号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -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') {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user