From 3c436c0dc2d7d5dc0d012414078258e091485276 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Thu, 28 May 2026 22:54:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(#612):=20=E8=AF=B7=E4=BF=AE=E5=A4=8D=20Bug?= =?UTF-8?q?=20#612=EF=BC=9A[=E4=B8=80=E8=88=AC]=20[=E6=82=A3=E8=80=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E9=97=A8=E8=AF=8A=E5=B0=B1=E8=AF=8A?= =?UTF-8?q?=E8=AE=B0=E5=BD=95]=E7=8A=B6=E6=80=81=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E6=98=AF=E7=A9=BA=E7=9A=84=E6=96=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: - "门诊就诊记录"页面的状态列,当数据库 `enc.status_enum` 为 NULL 时,后端 `EnumUtils.getInfoByValue()` 无法匹配到枚举值,返回 null,前端显示空白方框。同时下拉"无状态"查询(0)被错误转为 `undefined`,导致不传过滤条件。 - ### 修改内容(3 个文件) 修复: - 状态列显示:当 `subjectStatusEnum_enumText` 为空时显示"无状态"文本,不再显示空白方框 - 移除 `subjectStatusEnum=0` 转 `undefined` 的逻辑,让后端正确接收"无状态"过滤条件 - 3. 后端 - 空状态过滤** (`OutpatientRecordServiceImpl.java`) - 当 `subjectStatusEnum=0` 时,使用 `queryWrapper.isNull("enc.status_enum")` 过滤状态为空的记录 - ### 验证结果 - ✅ `npm run lint`: 0 errors - ✅ `mvn compile`: 编译通过 --- .../appservice/impl/OutpatientRecordServiceImpl.java | 7 ++++++- .../views/patientmanagement/outpatienrecords/index.vue | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/OutpatientRecordServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/OutpatientRecordServiceImpl.java index c35f8d833..2e04fa4a2 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/OutpatientRecordServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/OutpatientRecordServiceImpl.java @@ -86,7 +86,12 @@ public class OutpatientRecordServiceImpl implements IOutpatientRecordService { // 处理就诊对象状态筛选 if (outpatientRecordSearchParam.getSubjectStatusEnum() != null) { - queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum()); + if (outpatientRecordSearchParam.getSubjectStatusEnum() == 0) { + // 前端选择"无状态"(0)时,过滤 status_enum IS NULL 的记录 + queryWrapper.isNull("enc.status_enum"); + } else { + queryWrapper.eq("enc.status_enum", outpatientRecordSearchParam.getSubjectStatusEnum()); + } } // 处理医生姓名查询(支持模糊查询) diff --git a/openhis-ui-vue3/src/views/patientmanagement/outpatienrecords/index.vue b/openhis-ui-vue3/src/views/patientmanagement/outpatienrecords/index.vue index 8f7c99a8c..cef6ec72b 100755 --- a/openhis-ui-vue3/src/views/patientmanagement/outpatienrecords/index.vue +++ b/openhis-ui-vue3/src/views/patientmanagement/outpatienrecords/index.vue @@ -95,13 +95,13 @@ - + @@ -165,11 +165,8 @@ function getList() { console.log('当前查看患者:', route.query.patientName); } - // 构建请求参数 - "无状态"(0) 转为 undefined,让后端不加过滤 + // 构建请求参数 const requestParams = { ...queryParams.value }; - if (requestParams.subjectStatusEnum === 0) { - requestParams.subjectStatusEnum = undefined; - } listOutpatienRecords(requestParams).then((response) => { outpatienRecordsList.value = response.data.records; total.value = response.data.total;