diff --git a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue index 5833ca228..3c23c5c9f 100755 --- a/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue +++ b/healthlink-his-ui/src/views/inHospitalManagement/charge/register/components/accomplishList.vue @@ -5,7 +5,7 @@ @@ -425,14 +425,35 @@ const handlePrintCertificate = async () => { }; getContract(); -// 获取入院科室列表 +// 获取入院科室列表(仅住院科室:classEnum 包含 "2") function loadOrgList() { getOrgList().then((res) => { - orgList.value = res.data || []; + const records = res.data?.records || []; + orgList.value = records.filter( + (record) => record.typeEnum === 2 && checkClassEnumValue(record.classEnum, 2) + ); }); } +// 判断科室分类是否包含指定值(支持逗号分隔的多选值,如 "1,2") +function checkClassEnumValue(classEnum, targetValue) { + if (!classEnum) return false; + if (typeof classEnum === 'string' && classEnum.includes(',')) { + const values = classEnum.split(',').map(v => v.trim()); + return values.some(v => v == targetValue); + } + return classEnum == targetValue; +} + onMounted(() => { + // 默认检索近一周时间段 + const endDate = new Date(); + const startDate = new Date(); + startDate.setDate(startDate.getDate() - 7); + dateRange.value = [ + formatDateStr(startDate) + ' 00:00:00', + formatDateStr(endDate) + ' 23:59:59', + ]; getList(); loadOrgList(); }); @@ -465,7 +486,14 @@ function resetQuery() { startTime: '', endTime: '', }; - dateRange.value = []; + // 重置为默认近一周时间段 + const endDate = new Date(); + const startDate = new Date(); + startDate.setDate(startDate.getDate() - 7); + dateRange.value = [ + formatDateStr(startDate) + ' 00:00:00', + formatDateStr(endDate) + ' 23:59:59', + ]; getList(); } @@ -491,6 +519,14 @@ const priceTypeDic = (contractNo) => { return findObj?.contractName; }; +/** 格式化日期为 YYYY-MM-DD */ +function formatDateStr(date) { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; +} + const getList = () => { // 设置按申请时间排序 queryParams.value.sortField = 'requestTime';