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;