From dbe9fdadc1db50d1628b69e29c9cfb2937bb0781 Mon Sep 17 00:00:00 2001 From: guanyu Date: Mon, 18 May 2026 09:15:40 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#520:=20[=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E7=94=B3=E8=AF=B7]=20=E6=A3=80=E9=AA=8C=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=88=97=E8=A1=A8=E7=82=B9=E5=87=BB=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=95=8C=E9=9D=A2=E6=97=A0=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:getLocationInfo() 缺少 try-catch,当 getDepartmentList() API 失败时, 未捕获的异常向上传播导致 handleViewDetail 在设置 detailDialogVisible=true 前终止, 详情弹窗永远无法打开。 修复:为 getLocationInfo() 添加 try-catch 错误处理,API 失败时降级为空数组, 确保 handleViewDetail 的后续代码(设置 currentDetail 和打开弹窗)能正常执行。 与 examineApplication.vue 的已有修复保持一致。 Co-Authored-By: Claude Opus 4.7 --- .../home/components/applicationShow/testApplication.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue index c6e36d3bd..ff6138493 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue @@ -409,8 +409,13 @@ const hasMatchedFields = computed(() => { /** 查询科室 */ const getLocationInfo = async () => { - const res = await getDepartmentList(); - orgOptions.value = res.data || []; + try { + const res = await getDepartmentList(); + orgOptions.value = Array.isArray(res.data) ? res.data : []; + } catch (e) { + console.warn('科室列表加载失败:', e.message); + orgOptions.value = []; + } }; const recursionFun = (targetDepartment) => {