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;