From 025963dcae00b00820a309d78884a2fe1b21cb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Mon, 11 May 2026 00:02:03 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#495:=20=E3=80=90=E5=8C=BB=E5=98=B1?= =?UTF-8?q?=E9=97=AD=E7=8E=AF=E3=80=91=E5=B7=B2=E6=A0=A1=E5=AF=B9=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E6=97=A0=E6=B3=95=E6=B5=81=E8=BD=AC=E8=87=B3"?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E6=89=A7=E8=A1=8C"=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=B4=B9=E7=94=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 医嘱执行模块 prescriptionList.vue 中 try-catch 被注释掉,导致数据处理 异常时静默失败且 loading 状态无法重置,页面显示空数据无报错。 - 恢复 try-catch 错误处理,捕获 res.data.records 空值及数据处理异常 - 添加 .catch() 处理 API 接口级别失败,重置 loading 并清空列表 - 修复无患者时 loading 状态未重置的问题 Co-Authored-By: Claude Opus 4.7 --- .../components/prescriptionList.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue index 05d74322..d39c2cce 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue @@ -283,9 +283,10 @@ function handleGetPrescription() { exeStatus: props.exeStatus, requestStatus: props.requestStatus, }).then((res) => { - // try { + try { + const records = res?.data?.records || []; // 根据encounterId分组 - const groupedPrescriptions = res.data.records.reduce((groups, prescription) => { + const groupedPrescriptions = records.reduce((groups, prescription) => { // 获取当前医嘱全部执行频次 let rate; let times; @@ -430,19 +431,26 @@ function handleGetPrescription() { // 将分组结果转换为数组形式 prescriptionList.value = Object.values(groupedPrescriptions); - loading.value = false; // 默认选中全部行 nextTick(() => { defaultSelectAllRows(); }); - // } catch { - // loading.value = false; - // } + } catch (error) { + console.error('医嘱执行-获取处方列表数据处理失败:', error); + prescriptionList.value = []; + } finally { + loading.value = false; + } + }).catch((error) => { + console.error('医嘱执行-获取处方列表接口失败:', error); + prescriptionList.value = []; + loading.value = false; }); chooseAll.value = false; } else { prescriptionList.value = []; selectedRowIds.value.clear(); + loading.value = false; // proxy.$message.warning('请选择患者'); } }