diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue index e68a5f4c6..b571440e3 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue @@ -380,6 +380,28 @@ watch( }, { immediate: true } ); + +// 编辑模式下,applicationListAll 加载完成后重新回显已选项目 +watch( + () => applicationListAll.value, + () => { + if (!props.editData?.requestFormId) return; + if (!props.editData.requestFormDetailList?.length) return; + if (!applicationListAll.value.length) return; + + const selectedIds = []; + props.editData.requestFormDetailList.forEach((detail) => { + const matched = applicationListAll.value.find( + (item) => item.adviceName === detail.adviceName + ); + if (matched) { + selectedIds.push(matched.adviceDefinitionId); + } + }); + transferValue.value = selectedIds; + } +); + const submit = () => { if (transferValue.value.length == 0) { return proxy.$message.error('请选择申请单');