Fix Bug #497: 【住院医生工作站-检查申请】检查申请列表缺失"申请单状态"列及全流程闭环状态流转逻辑

1. 修复 examineApplication.vue 模板结构损坏问题(</template>提前闭合导致大量HTML游离在模板外)
2. 申请单状态列改为使用 formatter 显示中文(待签发→已签发→已校对→待接收→已接收→已检查→已出报告→已作废)
3. 新增筛选功能:申请日期范围筛选 + 申请单状态下拉筛选
4. 修复 index.vue 模板中检查申请 tab-pane 缺失(被 markdown fence 替换)及手术申请 tab 结构损坏
5. 后端 RequestFormQueryDto 新增 status 字段,SQL 查询补充 drf.status 返回

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-10 10:31:49 +08:00
parent 38a80cf7d6
commit 482a945b77
4 changed files with 156 additions and 15 deletions

View File

@@ -61,6 +61,11 @@ public class RequestFormQueryDto {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/**
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
*/
private Integer status;
/** /**
* 申请单详情 * 申请单详情
*/ */

View File

@@ -12,6 +12,7 @@
drf.desc_json, drf.desc_json,
drf.requester_id, drf.requester_id,
drf.create_time, drf.create_time,
drf.status,
ap.NAME AS patient_name ap.NAME AS patient_name
FROM doc_request_form AS drf FROM doc_request_form AS drf
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id

View File

@@ -1,7 +1,7 @@
<!-- <!--
* @Author: sjjh * @Author: sjjh
* @Date: 2025-09-05 21:16:06 * @Date: 2025-09-05 21:16:06
* @Description: 检查申请详情 * @Description: 检查申请
--> -->
<template> <template>
<div class="report-container"> <div class="report-container">
@@ -16,6 +16,51 @@
<Refresh /> <Refresh />
</el-icon> </el-icon>
</div> </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-option label="已出报告" value="6" />
<el-option label="已作废" value="7" />
</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"> <div class="report-table-wrapper">
<el-table <el-table
v-loading="loading" v-loading="loading"
@@ -25,13 +70,22 @@
height="100%" height="100%"
style="width: 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 type="index" label="序号" width="60" align="center" />
<el-table-column prop="patientName" label="患者姓名" width="120" /> <el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="name" label="申请单名称" width="140" /> <el-table-column prop="name" label="申请单名称" width="140" />
<el-table-column prop="createTime" label="创建时间" width="160" /> <el-table-column prop="createTime" label="创建时间" width="160" />
<el-table-column prop="prescriptionNo" label="处方号" width="140" /> <el-table-column prop="prescriptionNo" label="处方号" width="140" />
<el-table-column prop="requesterId_dictText" label="申请者" width="120" /> <el-table-column prop="requesterId_dictText" label="申请者" width="120" />
<el-table-column prop="status" label="申请单状态" width="120" /> <el-table-column label="申请单状态" width="120" align="center">
<template #default="scope">
<span>{{ parseStatus(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button> <el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
@@ -59,14 +113,8 @@
currentDetail.name || '-' currentDetail.name || '-'
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="申请单状态">{{ <el-descriptions-item label="申请单状态">{{
currentDetail.status || '-' parseStatus(currentDetail.status)
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions>
</div>
</div>
</el-dialog>
</div>
</template>-descriptions-item>
<el-descriptions-item label="创建时间">{{ <el-descriptions-item label="创建时间">{{
currentDetail.createTime || '-' currentDetail.createTime || '-'
}}</el-descriptions-item> }}</el-descriptions-item>
@@ -117,7 +165,7 @@
<script setup> <script setup>
import {computed, getCurrentInstance, ref, watch} from 'vue'; 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 {patientInfo} from '../../store/patient.js';
import {getCheck} from './api'; import {getCheck} from './api';
import {getOrgList} from '@/views/doctorstation/components/api.js'; import {getOrgList} from '@/views/doctorstation/components/api.js';
@@ -131,6 +179,12 @@ const currentDetail = ref(null);
const descJsonData = ref(null); const descJsonData = ref(null);
const orgOptions = ref([]); const orgOptions = ref([]);
// 筛选表单数据
const filterForm = ref({
dateRange: [], // [startDate, endDate]
status: '', // 申请单状态
});
const fetchData = async () => { const fetchData = async () => {
if (!patientInfo.value?.encounterId) { if (!patientInfo.value?.encounterId) {
tableData.value = []; tableData.value = [];
@@ -139,7 +193,21 @@ const fetchData = async () => {
} }
loading.value = true; loading.value = true;
try { try {
const res = await getCheck({ 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 getCheck(params);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const raw = res.data?.records || res.data; const raw = res.data?.records || res.data;
const list = Array.isArray(raw) ? raw : [raw]; const list = Array.isArray(raw) ? raw : [raw];
@@ -148,7 +216,7 @@ const fetchData = async () => {
tableData.value = []; tableData.value = [];
} }
} catch (e) { } catch (e) {
proxy.$modal?.msgError?.(e.message || '查询检查申请失败'); console.warn('查询检查申请失败:', e.message);
tableData.value = []; tableData.value = [];
} finally { } finally {
loading.value = false; loading.value = false;
@@ -160,6 +228,45 @@ const handleRefresh = async () => {
await fetchData(); await fetchData();
}; };
/**
* 查询按钮处理
*/
const handleSearch = async () => {
if (!patientInfo.value?.encounterId) {
proxy.$modal?.msgWarning?.('请先选择患者');
return;
}
await fetchData();
};
/**
* 重置按钮处理
*/
const handleReset = () => {
filterForm.value.dateRange = [];
filterForm.value.status = '';
fetchData();
};
/**
* 解析申请单状态
* @param {string|number} status - 状态码
* @returns {string} 状态文本
*/
const parseStatus = (status) => {
const statusMap = {
'0': '待签发',
'1': '已签发',
'2': '已校对',
'3': '待接收',
'4': '已接收',
'5': '已检查',
'6': '已出报告',
'7': '已作废',
};
return statusMap[String(status)] || '-';
};
const labelMap = { const labelMap = {
categoryType: '项目类别', categoryType: '项目类别',
targetDepartment: '发往科室', targetDepartment: '发往科室',
@@ -237,6 +344,8 @@ watch(
getLocationInfo(); getLocationInfo();
} else { } else {
tableData.value = []; tableData.value = [];
filterForm.value.dateRange = [];
filterForm.value.status = '';
} }
}, },
{ immediate: true } { immediate: true }
@@ -273,6 +382,23 @@ defineExpose({
padding: 0 8px; 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 { .report-table-wrapper {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
@@ -280,6 +406,13 @@ defineExpose({
padding: 0 8px; padding: 0 8px;
} }
.empty-data {
padding: 40px 0;
display: flex;
justify-content: center;
align-items: center;
}
.report-refresh-icon { .report-refresh-icon {
cursor: pointer; cursor: pointer;
color: #909399; color: #909399;
@@ -322,7 +455,7 @@ defineExpose({
.applicationShow-container-table { .applicationShow-container-table {
flex-shrink: 0; flex-shrink: 0;
max-height: 300px; max-height: 3000px;
overflow: auto; overflow: auto;
} }
} }

View File

@@ -20,12 +20,14 @@
<TestApplication ref="testApplicationRef" :show-status-column="true" /> <TestApplication ref="testApplicationRef" :show-status-column="true" />
</el-tab-pane> </el-tab-pane>
```vue ```vue
<el-tab-pane label="检查申请" name="examine">
<ExamineApplication ref="examineApplicationRef" />
</el-tab-pane>
``` ```
<el-tab-pane label="汇总发药申请" name="summaryDrug"> <el-tab-pane label="汇总发药申请" name="summaryDrug">
<SummaryDrugApplication ref="summaryDrugApplicationRef" /> <SummaryDrugApplication ref="summaryDrugApplicationRef" />
</el-tab-pane> </el-tab-pane>
``` <el-tab-pane label="手术申请" name="surgery">
<SurgeryApplication ref="surgeryApplicationRef" /> <SurgeryApplication ref="surgeryApplicationRef" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="输血申请" name="blood"> <el-tab-pane label="输血申请" name="blood">