From a844920e3f4a38540b5838f331534b7047295fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Mon, 11 May 2026 15:26:48 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#502:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E6=8A=A4=E5=A3=AB=E7=AB=99-=E6=B1=87=E6=80=BB=E5=8F=91?= =?UTF-8?q?=E8=8D=AF=E7=94=B3=E8=AF=B7=E3=80=91=E9=A1=B6=E9=83=A8=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E7=B1=BB=E5=9E=8B=EF=BC=88=E9=95=BF=E6=9C=9F/?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=EF=BC=89=E8=BF=87=E6=BB=A4=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=97=A0=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:父组件 index.vue 中 therapyEnum 变量未声明为 ref,且未通过 props 传递给子组件 prescriptionList.vue, 导致点击"长期/临时"按钮时数据流断裂,子组件 API 调用始终使用本地未变化的 therapyEnum 值。 修复: 1. index.vue 新增 const therapyEnum = ref(undefined) 2. index.vue 新增 handleTherapyChange() 调用 handleGetPrescription() 刷新列表 3. index.vue 将 therapyEnum 作为 prop 传入 PrescriptionList 4. prescriptionList.vue 将本地 therapyEnum ref 改为 props 接收 --- .../drugDistribution/components/prescriptionList.vue | 7 +++++-- .../src/views/inpatientNurse/drugDistribution/index.vue | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue index 963c73d2..36b02de3 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue @@ -174,7 +174,6 @@ const activeNames = ref([]); const userStore = useUserStore(); const prescriptionList = ref([]); const deadline = ref(formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59'); -const therapyEnum = ref(undefined); const { proxy } = getCurrentInstance(); const loading = ref(false); const chooseAll = ref(false); @@ -190,6 +189,10 @@ const props = defineProps({ deadline: { type: String, }, + therapyEnum: { + type: Number, + default: undefined, + }, }); function handleGetPrescription() { @@ -200,7 +203,7 @@ function handleGetPrescription() { encounterIds: encounterIds, pageSize: 10000, pageNo: 1, - therapyEnum: therapyEnum.value, + therapyEnum: props.therapyEnum, exeStatus: props.exeStatus, requestStatus: props.requestStatus, }) diff --git a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue index e9deacfa..b8475ce2 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue @@ -58,7 +58,7 @@ :clearable="false" @change="handleGetPrescription" /> - + 全部 长期 临时 @@ -79,6 +79,7 @@ :exeStatus="exeStatus" :requestStatus="requestStatus" :deadline="deadline" + :therapyEnum="therapyEnum" />