From a139b790e0245a5a0f7f71db53b72ddb0433d4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Sun, 31 May 2026 10:28:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(#626):=20=E8=AF=B7=E4=BF=AE=E5=A4=8D=20Bug?= =?UTF-8?q?=20#626=EF=BC=9A=E3=80=90=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=99-=E5=BE=85=E5=86=99=E7=97=85?= =?UTF-8?q?=E5=8E=86=E3=80=91=E6=93=8D=E4=BD=9C=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8B=E7=9A=84=E6=8C=89=E9=92=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=9C=AA=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: - Bug #请修复 Bug #626 存在的问题 修复: - 修改文件:2 个** - | 文件 | 修改内容 | - |---|---| - | `src/views/doctorstation/pendingEmr.vue` | 重写两个按钮的实际逻辑 + 新增患者详情弹窗 | - | `src/views/doctorstation/index.vue` | 支持从待写病历页面跳转时自动选中患者 | - "写病历"按钮** (`pendingEmr.vue:225-232`) - 通过 `router.push` 跳转到 `/doctorstation/index?encounterId=XXX` - 传递患者的 `encounterId`,让医生工作站自动加载该患者并打开病历编辑 - "查看患者"按钮** (`pendingEmr.vue:235-255`) - 调用 `getPatientDetails(encounterId)` API 获取患者详情 - 弹出 `el-dialog` 展示患者信息(姓名、性别、年龄、病历号、身份证、电话、地址、挂号时间、就诊科室) - API 异常时降级使用列表行数据展示 - 医生工作站自动选中** (`doctorstation/index.vue:626-639`) - `getPatientList` 加载完成后,检查 URL 中的 `encounterId` 参数 - 自动调用 `handleCardClick` 选中对应患者 - 选中后清除 URL 参数,避免刷新时重复触发 - ### 全链路 6 环分析 - | 环节 | 状态 | 说明 | - |---|---|---| - | ① 录入 | ✅ 正常 | 待写病历列表正确展示患者数据 | - | ② 保存 | ✅ 正常 | 不涉及数据写入,仅页面跳转/弹窗 | - | ③ 查询 | ✅ 正常 | `getPatientDetails` API 已存在,调用正常 | - | ④ 修改 | ✅ 不涉及 | 不涉及数据修改 | - | ⑤ 删除 | ✅ 不涉及 | 不涉及数据删除 | - | ⑥ 关联 | ✅ 正常 | 跳转到医生工作站后可正常写病历,不影响其他模块 | - ### 验证结果 - ✅ Vite build 成功(1m 51s,无新增错误) - ✅ ESLint 通过(0 errors, 0 warnings) --- .../src/views/doctorstation/index.vue | 18 ++- .../src/views/doctorstation/pendingEmr.vue | 122 +++++++++++++----- 2 files changed, 106 insertions(+), 34 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/index.vue b/openhis-ui-vue3/src/views/doctorstation/index.vue index 30785ce8d..e357cf3e5 100755 --- a/openhis-ui-vue3/src/views/doctorstation/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/index.vue @@ -443,7 +443,7 @@ import { nextTick } from 'vue'; import { updatePatientInfo } from './components/store/patient.js'; import { ElMessage, ElMessageBox } from 'element-plus'; -import { useRoute } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; // // 监听路由离开事件 // onBeforeRouteLeave((to, from, next) => { @@ -460,6 +460,7 @@ defineOptions({ }); const route = useRoute(); +const router = useRouter(); // 监听路由参数变化 watch( @@ -621,6 +622,21 @@ function getPatientList() { active: currentEncounterId.value ? item.encounterId == currentEncounterId.value : false, }; }); + + // Bug #626: 从待写病历页面跳转过来时,自动选中对应患者 + const targetEncounterId = route.query.encounterId; + if (targetEncounterId && patientList.value.length > 0) { + const targetIndex = patientList.value.findIndex( + (item) => String(item.encounterId) === String(targetEncounterId) + ); + if (targetIndex !== -1) { + handleCardClick(patientList.value[targetIndex], targetIndex); + } + // 清除URL参数,避免刷新时重复选中 + if (route.query.encounterId) { + router.replace({ query: {} }); + } + } }); } function setVisitType(type) { diff --git a/openhis-ui-vue3/src/views/doctorstation/pendingEmr.vue b/openhis-ui-vue3/src/views/doctorstation/pendingEmr.vue index 1ebe07e7d..b10a48e2b 100755 --- a/openhis-ui-vue3/src/views/doctorstation/pendingEmr.vue +++ b/openhis-ui-vue3/src/views/doctorstation/pendingEmr.vue @@ -129,23 +129,79 @@ :total="total" @pagination="getList" /> + + + + + + {{ patientDetailData.patientName || '-' }} + + + {{ getGenderText(patientDetailData.gender) }} + + + {{ patientDetailData.age || '-' }} + + + {{ patientDetailData.busNo || '-' }} + + + {{ patientDetailData.idCard || '-' }} + + + {{ patientDetailData.phone || '-' }} + + + {{ patientDetailData.address || '-' }} + + + {{ parseTime(patientDetailData.registerTime, '{y}-{m}-{d} {h}:{i}:{s}') }} + + + {{ patientDetailData.organizationName || '-' }} + + + +