From 7466160008cba5c8d7ee43343bbe67ea73ecd737 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Thu, 28 May 2026 23:47:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(#586):=20=E8=AF=B7=E4=BF=AE=E5=A4=8D=20Bug?= =?UTF-8?q?=20#586=EF=BC=9A[=E4=BD=8F=E9=99=A2=E5=8C=BB=E7=94=9F=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=99-=E6=89=8B=E6=9C=AF=E7=94=B3=E8=AF=B7]=20?= =?UTF-8?q?=E6=89=8B=E6=9C=AF=E7=94=B3=E8=AF=B7=E5=8E=86=E5=8F=B2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=BC=BA=E5=B0=91=E8=BF=87=E6=BB=A4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: - 手术申请历史列表的查询 API `/reg-doctorstation/request-form/get-surgery` 和前端组件均未实现筛选过滤功能。 - ### 变更内容(2 个文件) - 前端 — `src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue`** - 在标题「手术申请」与表格之间新增**筛选控制栏**,包含: - 创建时间** — 日期范围选择器(`el-date-picker` daterange),默认近 7 天 - 申请状态** — 下拉选择(全部/待签发/已签发/已校对/已执行/已安排/已完成/已作废) - 关键字搜索** — 输入框,placeholder:`请输入手术单号/名称` - 【查询】** 蓝色高亮按钮 + **【重置】** 灰色按钮 - 支持在搜索框按 `Enter` 键直接触发查询 - 查询时带上 `startDate`、`endDate`、`status`、`keyword` 参数 - 后端 — `RequestFormManageController.java`** - 将 `getSurgeryRequestForm` 方法从仅接受 `encounterId` 扩展为同时接受 `startDate`、`endDate`、`status`、`keyword` 四个可选参数 - 调用已存在的 6 参数 `getRequestForm` 重载方法传入筛选条件(Mapper XML 已支持过滤逻辑) - ### 验证结果 - ✅ 前端 lint:**0 errors,70 warnings**(均为已有格式化规则,非本修改引入) - ✅ 后端编译:**mvn compile 通过** 修复: - 修改相关代码文件 --- .../RequestFormManageController.java | 13 +- .../applicationShow/surgeryApplication.vue | 130 +++++++++++++++++- 2 files changed, 139 insertions(+), 4 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java index 94b61f52d..fc53b5b1f 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java @@ -143,14 +143,23 @@ public class RequestFormManageController { * 查询手术申请单 * * @param encounterId 就诊id + * @param startDate 开始日期(可选,格式:yyyy-MM-dd) + * @param endDate 结束日期(可选,格式:yyyy-MM-dd) + * @param status 单据状态(可选) + * @param keyword 关键字(可选,申请单号/手术项目名称模糊匹配) * @return 手术申请单 */ @GetMapping(value = "/get-surgery") - public R getSurgeryRequestForm(@RequestParam(required = false) Long encounterId) { + public R getSurgeryRequestForm( + @RequestParam(required = false) Long encounterId, + @RequestParam(required = false) String startDate, + @RequestParam(required = false) String endDate, + @RequestParam(required = false) String status, + @RequestParam(required = false) String keyword) { if (encounterId == null) { return R.fail("就诊ID不能为空"); } - return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode())); + return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode(), startDate, endDate, status, keyword)); } /** * 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue index 94002db1e..965eb5343 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/surgeryApplication.vue @@ -16,6 +16,59 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + 重置 + + + +
import {computed, getCurrentInstance, ref, watch} from 'vue'; -import {Refresh} from '@element-plus/icons-vue'; +import {Refresh, Search} from '@element-plus/icons-vue'; import {patientInfo} from '../../store/patient.js'; import {getSurgery} from './api'; import {getDepartmentList} from '@/api/public.js'; @@ -127,6 +180,42 @@ const currentDetail = ref(null); const descJsonData = ref(null); const orgOptions = ref([]); +// 获取默认日期范围(近7天) +const getDefaultDateRange = () => { + const now = new Date(); + const endDate = now.toISOString().split('T')[0]; + const startDate = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]; + return [startDate, endDate]; +}; + +// 筛选表单数据 +const filterForm = ref({ + dateRange: getDefaultDateRange(), // 默认近一周 + status: '', // 申请状态 + keyword: '', // 关键字搜索 +}); + +/** + * 查询按钮处理 + */ +const handleSearch = async () => { + if (!patientInfo.value?.encounterId) { + proxy.$modal?.msgWarning?.('请先选择患者'); + return; + } + await fetchData(); +}; + +/** + * 重置按钮处理 + */ +const handleReset = () => { + filterForm.value.dateRange = getDefaultDateRange(); + filterForm.value.status = ''; + filterForm.value.keyword = ''; + fetchData(); +}; + const fetchData = async () => { if (!patientInfo.value?.encounterId) { tableData.value = []; @@ -135,7 +224,26 @@ const fetchData = async () => { } loading.value = true; try { - const res = await getSurgery({ encounterId: patientInfo.value.encounterId }); + // 构建查询参数 + const params = { encounterId: patientInfo.value.encounterId }; + + // 添加日期范围筛选 + if (filterForm.value.dateRange && filterForm.value.dateRange.length === 2) { + params.startDate = filterForm.value.dateRange[0]; + params.endDate = filterForm.value.dateRange[1]; + } + + // 添加状态筛选 + if (filterForm.value.status !== '' && filterForm.value.status !== undefined) { + params.status = filterForm.value.status; + } + + // 添加关键字搜索 + if (filterForm.value.keyword && filterForm.value.keyword.trim()) { + params.keyword = filterForm.value.keyword.trim(); + } + + const res = await getSurgery(params); if (res.code === 200 && res.data) { const raw = res.data?.records || res.data; const list = Array.isArray(raw) ? raw : [raw]; @@ -278,6 +386,24 @@ defineExpose({ padding: 0 8px; } +/* 筛选表单样式 */ +.filter-form { + padding: 0 8px; + margin-bottom: 8px; +} + +.filter-form-content { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0; +} + +:deep(.filter-form-content .el-form-item) { + margin-bottom: 0; + margin-right: 16px; +} + .report-table-wrapper { flex: 1; min-height: 0;