调优:473- [住院医生工作站-检验申请] 列表页字段补全:新增“申请类型”、“标本类型”字段展示,处方号改申请单号

This commit is contained in:
2026-05-07 16:08:13 +08:00
parent 936c2a6133
commit b31c891bd1
6 changed files with 201 additions and 6 deletions

View File

@@ -16,6 +16,49 @@
<Refresh />
</el-icon>
</div>
<!-- 筛选表单 -->
<div class="filter-form">
<el-form :inline="true" :model="filterForm" class="filter-form-content">
<el-form-item label="申请日期">
<el-date-picker
v-model="filterForm.dateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="单据状态">
<el-select
v-model="filterForm.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option label="全部" value="" />
<el-option label="待签发" value="0" />
<el-option label="已签发" value="1" />
<el-option label="已采集" value="2" />
<el-option label="已收样" value="3" />
<el-option label="报告已出" value="4" />
<el-option label="已作废" value="5" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch" :loading="loading">
<el-icon><Search /></el-icon>
查询
</el-button>
<el-button @click="handleReset">
<el-icon><Refresh /></el-icon>
重置
</el-button>
</el-form-item>
</el-form>
</div>
<div class="report-table-wrapper">
<el-table
v-loading="loading"
@@ -25,6 +68,11 @@
height="100%"
style="width: 100%"
>
<template #empty>
<div class="empty-data">
<el-empty description="暂无匹配记录" :image-size="80" />
</div>
</template>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="name" label="申请单名称" width="140" />
@@ -117,7 +165,7 @@
<script setup>
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 {getInspection} from './api';
import {getOrgList} from '@/views/doctorstation/components/api.js';
@@ -131,6 +179,12 @@ const currentDetail = ref(null);
const descJsonData = ref(null);
const orgOptions = ref([]);
// 筛选表单数据
const filterForm = ref({
dateRange: [], // [startDate, endDate]
status: '', // 单据状态
});
const fetchData = async () => {
if (!patientInfo.value?.encounterId) {
tableData.value = [];
@@ -139,7 +193,21 @@ const fetchData = async () => {
}
loading.value = true;
try {
const res = await getInspection({ 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;
}
const res = await getInspection(params);
if (res.code === 200 && res.data) {
const raw = res.data?.records || res.data;
const list = Array.isArray(raw) ? raw : [raw];
@@ -160,6 +228,28 @@ const handleRefresh = async () => {
await fetchData();
};
/**
* 查询按钮处理
*/
const handleSearch = async () => {
if (!patientInfo.value?.encounterId) {
proxy.$modal?.msgWarning?.('请先选择患者');
return;
}
await fetchData();
};
/**
* 重置按钮处理
*/
const handleReset = () => {
// 重置筛选条件为默认值
filterForm.value.dateRange = [];
filterForm.value.status = '';
// 重新加载数据
fetchData();
};
const labelMap = {
categoryType: '项目类别',
targetDepartment: '发往科室',
@@ -266,10 +356,31 @@ watch(
() => patientInfo.value?.encounterId,
(val) => {
if (val) {
// 设置默认日期范围为近7天
const today = new Date();
const sevenDaysAgo = new Date(today);
sevenDaysAgo.setDate(today.getDate() - 6); // 包含今天共7天
// 格式化为 YYYY-MM-DD
const formatDate = (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}`;
};
filterForm.value.dateRange = [
formatDate(sevenDaysAgo),
formatDate(today)
];
fetchData();
getLocationInfo();
} else {
tableData.value = [];
// 重置筛选条件
filterForm.value.dateRange = [];
filterForm.value.status = '';
}
},
{ immediate: true }
@@ -306,6 +417,23 @@ defineExpose({
padding: 0 8px;
}
.filter-form {
padding: 12px 8px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
}
.filter-form-content {
:deep(.el-form-item) {
margin-bottom: 0;
margin-right: 16px;
}
:deep(.el-form-item__label) {
font-weight: 500;
}
}
.report-table-wrapper {
flex: 1;
min-height: 0;
@@ -313,6 +441,13 @@ defineExpose({
padding: 0 8px;
}
.empty-data {
padding: 40px 0;
display: flex;
justify-content: center;
align-items: center;
}
.report-refresh-icon {
cursor: pointer;
color: #909399;