diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/examineApplication.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/examineApplication.vue index 23614584..f81ff8fa 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/examineApplication.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/examineApplication.vue @@ -49,6 +49,15 @@ + + + @@ -180,9 +189,22 @@ const descJsonData = ref(null); const orgOptions = ref([]); // 筛选表单数据 +const getDefaultDateRange = () => { + const now = new Date(); + const weekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000); + const formatDate = (d) => { + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const day = String(d.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + }; + return [formatDate(weekAgo), formatDate(now)]; +}; + const filterForm = ref({ - dateRange: [], // [startDate, endDate] + dateRange: getDefaultDateRange(), // 默认近一周 status: '', // 申请单状态 + keyword: '', // 关键字搜索 }); const fetchData = async () => { @@ -207,6 +229,11 @@ const fetchData = async () => { params.status = filterForm.value.status; } + // 添加关键字搜索 + if (filterForm.value.keyword && filterForm.value.keyword.trim()) { + params.keyword = filterForm.value.keyword.trim(); + } + const res = await getCheck(params); if (res.code === 200 && res.data) { const raw = res.data?.records || res.data; @@ -243,8 +270,9 @@ const handleSearch = async () => { * 重置按钮处理 */ const handleReset = () => { - filterForm.value.dateRange = []; + filterForm.value.dateRange = getDefaultDateRange(); filterForm.value.status = ''; + filterForm.value.keyword = ''; fetchData(); }; @@ -344,8 +372,9 @@ watch( getLocationInfo(); } else { tableData.value = []; - filterForm.value.dateRange = []; + filterForm.value.dateRange = getDefaultDateRange(); filterForm.value.status = ''; + filterForm.value.keyword = ''; } }, { immediate: true }