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 5e6bd41bf..1ad323bbe 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 @@ + + + @@ -213,10 +222,19 @@ 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: [], // [startDate, endDate] + dateRange: getDefaultDateRange(), // 默认近一周 status: '', // 申请单状态 + keyword: '', // 关键字搜索 }); const fetchData = async () => { @@ -241,6 +259,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; @@ -277,8 +300,9 @@ const handleSearch = async () => { * 重置按钮处理 */ const handleReset = () => { - filterForm.value.dateRange = []; + filterForm.value.dateRange = getDefaultDateRange(); filterForm.value.status = ''; + filterForm.value.keyword = ''; fetchData(); }; @@ -486,8 +510,9 @@ watch( getLocationInfo(); } else { tableData.value = []; - filterForm.value.dateRange = []; + filterForm.value.dateRange = getDefaultDateRange(); filterForm.value.status = ''; + filterForm.value.keyword = ''; } }, { immediate: true }