调优:473- [住院医生工作站-检验申请] 列表页字段补全:新增“申请类型”、“标本类型”字段展示,处方号改申请单号
This commit is contained in:
@@ -32,6 +32,18 @@ public interface IRequestFormManageAppService {
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode);
|
||||
|
||||
/**
|
||||
* 查询申请单(支持筛选)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param typeCode 申请单类型
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status);
|
||||
|
||||
/**
|
||||
* 分页查询申请单
|
||||
*
|
||||
|
||||
@@ -413,12 +413,28 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
*/
|
||||
@Override
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode) {
|
||||
// 调用重载方法,不传筛选参数
|
||||
return getRequestForm(encounterId, typeCode, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询申请单(支持筛选)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param typeCode 申请单类型
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
@Override
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return new java.util.ArrayList<>(); // 返回空列表而不是查询数据库
|
||||
}
|
||||
|
||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode);
|
||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status);
|
||||
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
||||
// 查询处方详情
|
||||
List<RequestFormDetailQueryDto> requestFormDetail =
|
||||
|
||||
@@ -95,14 +95,21 @@ public class RequestFormManageController {
|
||||
* 查询检验申请单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @return 检验申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-inspection")
|
||||
public R<?> getInspectionRequestForm(@RequestParam(required = false) Long encounterId) {
|
||||
public R<?> getInspectionRequestForm(
|
||||
@RequestParam(required = false) Long encounterId,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@RequestParam(required = false) String status) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode()));
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,22 @@ public interface RequestFormManageAppMapper {
|
||||
List<RequestFormQueryDto> getRequestForm(@Param("encounterId") Long encounterId,
|
||||
@Param("typeCode") String typeCode);
|
||||
|
||||
/**
|
||||
* 查询申请单(支持筛选)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param typeCode 申请单类型
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(@Param("encounterId") Long encounterId,
|
||||
@Param("typeCode") String typeCode,
|
||||
@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 查询申请单详情
|
||||
*
|
||||
|
||||
@@ -21,6 +21,15 @@
|
||||
WHERE drf.delete_flag = '0'
|
||||
AND drf.encounter_id = #{encounterId}
|
||||
AND drf.type_code = #{typeCode}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
AND drf.create_time >= #{startDate}::date
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND drf.status = #{status}::integer
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||
@@ -133,4 +142,4 @@
|
||||
</where>
|
||||
ORDER BY drf.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user