- 将"已取消"状态显示修改为"已取消/作废"
- 修复申请时间显示问题,使用动态时间并统一格式 - 过滤查询中的已作废会诊数据 - 优化参与医生列表显示字段 - 修复时间格式化显示为YYYY-MM-DD格式
This commit is contained in:
@@ -61,6 +61,8 @@ import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.openhis.web.consultation.enums.ConsultationStatusEnum.CANCELLED;
|
||||
|
||||
/**
|
||||
* 会诊管理AppService实现类
|
||||
*
|
||||
@@ -134,6 +136,8 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
|
||||
// 根据就诊ID,查询该患者的会诊申请
|
||||
wrapper.eq(ConsultationRequest::getEncounterId, encounterId);
|
||||
// 过滤已作废的数据
|
||||
wrapper.ne(ConsultationRequest::getConsultationStatus, CANCELLED.getCode());
|
||||
wrapper.orderByDesc(ConsultationRequest::getCreateTime);
|
||||
|
||||
List<ConsultationRequest> list = consultationRequestMapper.selectList(wrapper);
|
||||
@@ -282,11 +286,15 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
entity = new ConsultationRequest();
|
||||
entity.setConsultationId(generateConsultationId());
|
||||
entity.setTenantId(SecurityUtils.getLoginUser().getTenantId().longValue());
|
||||
entity.setConsultationRequestDate(new Date());
|
||||
}
|
||||
|
||||
// 复制基本属性(现在字段名已统一,可以直接复制)
|
||||
BeanUtils.copyProperties(dto, entity, "id", "consultationId", "invitedList", "submitFlag", "provisionalDiagnosis", "consultationRequestDate");
|
||||
BeanUtils.copyProperties(dto, entity, "id", "consultationId", "invitedList", "submitFlag", "provisionalDiagnosis");
|
||||
|
||||
// 新增时:如果前端没有传递申请时间,使用服务器时间
|
||||
if (!isUpdate && entity.getConsultationRequestDate() == null) {
|
||||
entity.setConsultationRequestDate(new Date());
|
||||
}
|
||||
|
||||
// 如果前端没有传递申请医生ID,使用当前登录用户
|
||||
if (entity.getRequestingPhysicianId() == null) {
|
||||
@@ -440,7 +448,7 @@ public class ConsultationAppServiceImpl implements IConsultationAppService {
|
||||
|
||||
} else {
|
||||
// 作废:将状态改为"已取消"
|
||||
entity.setConsultationStatus(ConsultationStatusEnum.CANCELLED.getCode());
|
||||
entity.setConsultationStatus(CANCELLED.getCode());
|
||||
entity.setCancelReason(cancelReason);
|
||||
entity.setCancelNatureDate(new Date());
|
||||
consultationRequestMapper.updateById(entity);
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum ConsultationStatusEnum {
|
||||
/**
|
||||
* 已取消
|
||||
*/
|
||||
CANCELLED(50, "已取消");
|
||||
CANCELLED(50, "已取消/作废");
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<el-table-column prop="invitedObjectText" label="邀请对象" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="department" label="申请科室" width="100" align="center" />
|
||||
<el-table-column prop="requestingPhysician" label="申请医师" width="100" align="center" />
|
||||
<el-table-column prop="createTime" label="申请时间" width="160" align="center" />
|
||||
<el-table-column prop="consultationRequestDate" label="申请时间" width="160" align="center" />
|
||||
<el-table-column label="提交" width="60" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.submitted" disabled />
|
||||
@@ -53,7 +53,7 @@
|
||||
提交
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" @click="handleDeleteRow(row)">
|
||||
删除
|
||||
作废
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 已提交状态:显示取消提交按钮 -->
|
||||
@@ -117,7 +117,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请时间:">
|
||||
<el-input v-model="formData.createTime" disabled />
|
||||
<el-input v-model="currentTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -240,35 +240,24 @@
|
||||
|
||||
<!-- 🎯 新增:参与医生列表(表格形式) -->
|
||||
<el-form-item label="参与医生签名:" v-if="participatingPhysicians.length > 0">
|
||||
<el-table
|
||||
:data="participatingPhysicians"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
<el-table
|
||||
:data="participatingPhysicians"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
max-height="300"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="deptName" label="科室" width="120" align="center" />
|
||||
<el-table-column prop="physicianName" label="医生" width="100" align="center" />
|
||||
<el-table-column prop="confirmTime" label="确认时间" width="160" align="center">
|
||||
<el-table-column prop="confirmingDeptName" label="代表科室" width="120" align="center" />
|
||||
<el-table-column prop="confirmingPhysicianName" label="所属医生" width="100" align="center" />
|
||||
<el-table-column prop="signature" label="签名医生" width="100" align="center" />
|
||||
<el-table-column prop="signatureDate" label="签名时间" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ formatDateTime(row.confirmTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signatureTime" label="签名时间" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ formatDateTime(row.signatureTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.invitedStatus >= 3" type="success">已签名</el-tag>
|
||||
<el-tag v-else-if="row.invitedStatus >= 1" type="warning">已确认</el-tag>
|
||||
<el-tag v-else type="info">待确认</el-tag>
|
||||
{{ formatDateTime(row.signatureDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -349,7 +338,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted, watch, defineProps } from 'vue';
|
||||
import { ref, reactive, computed, onMounted, onUnmounted, watch, defineProps } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
@@ -388,6 +377,10 @@ const activityList = ref([]);
|
||||
// 当前选中的行
|
||||
const selectedRow = ref(null);
|
||||
|
||||
// 实时显示的当前时间
|
||||
const currentTime = ref('');
|
||||
let timeTimer = null; // 定时器引用
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
consultationId: '',
|
||||
@@ -651,9 +644,6 @@ const loadConsultationList = async () => {
|
||||
submitted: item.consultationStatus >= 10,
|
||||
completed: item.consultationStatus === 40,
|
||||
invitedObjectText: item.invitedObject || (item.invitedList?.map(inv => inv.physicianName).join('、') || ''),
|
||||
consultationDate: item.consultationDate,
|
||||
// 确保字段正确映射
|
||||
createTime: item.consultationRequestDate || item.createTime,
|
||||
};
|
||||
});
|
||||
console.log('会诊列表:', consultationList.value);
|
||||
@@ -700,7 +690,7 @@ const loadMainDiagnosis = async () => {
|
||||
};
|
||||
|
||||
// 点击表格行
|
||||
const handleRowClick = (row) => {
|
||||
const handleRowClick = async (row) => {
|
||||
selectedRow.value = row;
|
||||
if (row) {
|
||||
console.log('点击的行数据:', row);
|
||||
@@ -747,12 +737,10 @@ const handleRowClick = (row) => {
|
||||
// 🎯 填充参与医生列表(显示确认和签名状态)
|
||||
participatingPhysicians.value = row.invitedList.map(inv => ({
|
||||
physicianId: inv.physicianId,
|
||||
physicianName: inv.physicianName,
|
||||
deptId: inv.deptId,
|
||||
deptName: inv.deptName,
|
||||
invitedStatus: inv.invitedStatus || 0,
|
||||
confirmTime: inv.confirmTime || null,
|
||||
signatureTime: inv.signatureTime || null,
|
||||
confirmingPhysicianName: inv.physicianName || '',
|
||||
confirmingDeptName: inv.deptName || '',
|
||||
signature: inv.signatureTime ? inv.physicianName : '', // 有签名时间才显示签名医生
|
||||
signatureDate: inv.signatureTime || null,
|
||||
}));
|
||||
|
||||
console.log('参与医生列表:', participatingPhysicians.value);
|
||||
@@ -865,6 +853,7 @@ const handleSave = async () => {
|
||||
consultationUrgency: formData.isUrgent ? '2' : '1',
|
||||
consultationPurpose: formData.consultationPurpose,
|
||||
consultationDate: formData.consultationDate,
|
||||
consultationRequestDate: currentTime.value, // 使用动态申请时间
|
||||
patientId: props.patientInfo.patientId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
patientName: props.patientInfo.patientName,
|
||||
@@ -1128,7 +1117,7 @@ const formatDateTime = (dateTime) => {
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
};
|
||||
|
||||
// 监听 activeTab 变化
|
||||
@@ -1165,12 +1154,25 @@ onMounted(() => {
|
||||
console.log('会诊组件已挂载');
|
||||
loadActivityList();
|
||||
loadDepartmentTree();
|
||||
|
||||
|
||||
// 初始化当前时间并启动实时更新(每秒更新一次)
|
||||
currentTime.value = formatDateTime(new Date());
|
||||
timeTimer = setInterval(() => {
|
||||
currentTime.value = formatDateTime(new Date());
|
||||
}, 1000);
|
||||
|
||||
if (props.activeTab === 'consultation' && props.patientInfo?.encounterId) {
|
||||
loadConsultationList();
|
||||
handleNew();
|
||||
}
|
||||
});
|
||||
|
||||
// 组件卸载时清除定时器
|
||||
onUnmounted(() => {
|
||||
if (timeTimer) {
|
||||
clearInterval(timeTimer);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user