Fix Bug #499: 【住院医生工作站-检查申请】检查申请列表缺失查询过滤功能,不符合临床高效检索要求
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,15 +3,56 @@
|
||||
<!-- ====== 顶部卡片:申请单列表 ====== -->
|
||||
<div class="top-section">
|
||||
<div class="section-header">
|
||||
<span class="section-title">检查项目 ({{ applicationList.length }})</span>
|
||||
<span class="section-title">检查项目 ({{ filteredApplicationList.length }})</span>
|
||||
<div class="header-actions">
|
||||
<el-button type="primary" @click="handleAdd" icon="Plus">新增</el-button>
|
||||
<el-button type="success" @click="handleSave" icon="Finished">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bug #499: 查询过滤工具栏 -->
|
||||
<div class="search-toolbar">
|
||||
<el-form :inline="true" size="small">
|
||||
<el-form-item label="日期范围">
|
||||
<el-date-picker
|
||||
v-model="searchForm.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="searchForm.applyStatus" placeholder="全部" clearable style="width: 140px">
|
||||
<el-option
|
||||
v-for="opt in statusOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="申请单号 / 检查项目"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch" icon="Search">搜索</el-button>
|
||||
<el-button @click="handleResetSearch" icon="Refresh">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="applicationList"
|
||||
:data="filteredApplicationList"
|
||||
:max-height="200"
|
||||
highlight-current-row
|
||||
@row-click="handleRowClick"
|
||||
@@ -452,6 +493,74 @@ const activeDetailTab = ref('applyForm');
|
||||
const applicationList = ref([]);
|
||||
const selectedItems = ref([]);
|
||||
|
||||
// Bug #499: 查询过滤状态
|
||||
const searchForm = reactive({
|
||||
dateRange: [],
|
||||
applyStatus: '',
|
||||
keyword: ''
|
||||
});
|
||||
|
||||
// 申请单状态选项
|
||||
const statusOptions = [
|
||||
{ label: '已开单', value: 0 },
|
||||
{ label: '已收费', value: 1 },
|
||||
{ label: '已预约', value: 2 },
|
||||
{ label: '已签到', value: 3 },
|
||||
{ label: '部分报告', value: 4 },
|
||||
{ label: '已完告', value: 5 },
|
||||
{ label: '已作废', value: 6 }
|
||||
];
|
||||
|
||||
// Bug #499: 过滤后的申请单列表
|
||||
const filteredApplicationList = computed(() => {
|
||||
let result = applicationList.value;
|
||||
|
||||
// 日期范围过滤
|
||||
if (searchForm.dateRange && searchForm.dateRange.length === 2) {
|
||||
const start = searchForm.dateRange[0];
|
||||
const end = searchForm.dateRange[1];
|
||||
result = result.filter(item => {
|
||||
const d = item.applyTime;
|
||||
if (!d) return false;
|
||||
const dateStr = d.length > 10 ? d.substring(0, 10) : d;
|
||||
return dateStr >= start && dateStr <= end;
|
||||
});
|
||||
}
|
||||
|
||||
// 状态过滤
|
||||
if (searchForm.applyStatus !== '' && searchForm.applyStatus !== null && searchForm.applyStatus !== undefined) {
|
||||
result = result.filter(item => item.applyStatus === searchForm.applyStatus);
|
||||
}
|
||||
|
||||
// 关键字过滤(申请单号、申检部位、检查项目名)
|
||||
if (searchForm.keyword) {
|
||||
const kw = searchForm.keyword.toLowerCase();
|
||||
result = result.filter(item => {
|
||||
return (item.applyNo || '').toLowerCase().includes(kw)
|
||||
|| (item.inspectionArea || '').toLowerCase().includes(kw);
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
// Bug #499: 搜索与重置
|
||||
function handleSearch() {
|
||||
// 过滤逻辑由 computed 自动处理
|
||||
}
|
||||
|
||||
function handleResetSearch() {
|
||||
const now = new Date();
|
||||
const end = now.toISOString().substring(0, 10);
|
||||
const start = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000).toISOString().substring(0, 10);
|
||||
searchForm.dateRange = [start, end];
|
||||
searchForm.applyStatus = '';
|
||||
searchForm.keyword = '';
|
||||
}
|
||||
|
||||
// 初始化默认日期范围为近一周
|
||||
handleResetSearch();
|
||||
|
||||
// 🔧 BugFix#426: 懒加载套餐明细
|
||||
async function loadPackageDetails(row, treeNode, resolve) {
|
||||
if (!row.isPackage || !row.packageId) {
|
||||
@@ -1443,6 +1552,19 @@ defineExpose({ getList });
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* Bug #499: 查询过滤工具栏 */
|
||||
.search-toolbar {
|
||||
margin-bottom: 10px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
.search-toolbar :deep(.el-form-item) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.search-toolbar :deep(.el-form-item__label) {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 底部区域:左表单 + 右分类 */
|
||||
.bottom-section {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user