会诊管理中 门诊会诊申请确认和门诊会诊申请管理模块全部功能的实现。包括数据库设计,前端UI设计,后端接口开发。
This commit is contained in:
@@ -30,28 +30,37 @@
|
||||
stripe
|
||||
highlight-current-row
|
||||
@current-change="handleRowChange"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table-column type="index" width="60" label="序号" align="center" />
|
||||
<el-table-column label="紧急" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.urgent" />
|
||||
<el-checkbox v-model="scope.row.urgent" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="consultationId" label="申请单号" min-width="160" />
|
||||
<el-table-column prop="patientName" label="病人姓名" min-width="100" />
|
||||
<el-table-column prop="consultationTime" label="会诊时间" min-width="160" />
|
||||
<el-table-column prop="invitee" label="邀请对象" min-width="120" />
|
||||
<el-table-column prop="consultationDate" label="会诊时间" min-width="160">
|
||||
<template #default="scope">
|
||||
{{ formatDateTime(scope.row.consultationDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invitedObject" label="邀请对象" min-width="120" />
|
||||
<el-table-column prop="applyDept" label="申请科室" min-width="120" />
|
||||
<el-table-column prop="applyDoctor" label="申请医师" min-width="120" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="160" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="160">
|
||||
<template #default="scope">
|
||||
{{ formatDateTime(scope.row.applyTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="确认" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.confirmed" disabled />
|
||||
<el-checkbox :model-value="scope.row.myInvitedStatus >= 20" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签名" width="70" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.signed" disabled />
|
||||
<el-checkbox :model-value="scope.row.myInvitedStatus >= 30" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -68,7 +77,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="性别">
|
||||
<el-input v-model="formData.gender" disabled />
|
||||
<el-input v-model="formData.genderText" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -78,7 +87,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="就诊卡号">
|
||||
<el-input v-model="formData.cardNo" disabled />
|
||||
<el-input v-model="formData.patientIdentifierNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -93,7 +102,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会诊时间">
|
||||
<el-input v-model="formData.consultationTime" disabled />
|
||||
<el-input :model-value="formatDateTime(formData.consultationDate)" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -103,52 +112,92 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会诊邀请对象">
|
||||
<el-input v-model="formData.invitee" disabled />
|
||||
<el-input v-model="formData.invitedObject" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="提交医生">
|
||||
<el-input v-model="formData.applyDoctor" disabled />
|
||||
<el-input v-model="formData.submittingPhysician" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="提交时间">
|
||||
<el-input v-model="formData.applyTime" disabled />
|
||||
<el-input :model-value="formatDateTime(formData.submittingTime)" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="病史及目的">
|
||||
<el-input v-model="formData.history" type="textarea" :rows="3" disabled />
|
||||
<el-input v-model="formData.consultationPurpose" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊确认参加医师" required>
|
||||
<el-input v-model="formData.confirmingPhysician" placeholder="请输入会诊确认参加医师" />
|
||||
<el-form-item label="门诊诊断">
|
||||
<el-input v-model="formData.provisionalDiagnosis" type="textarea" :rows="2" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊意见" required>
|
||||
<el-input v-model="formData.opinion" type="textarea" :rows="4" placeholder="请输入会诊意见" />
|
||||
<el-input
|
||||
v-model="formData.consultationOpinion"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入会诊意见"
|
||||
:disabled="!canEdit"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 会诊意见列表 -->
|
||||
<el-form-item label="所有会诊意见">
|
||||
<div class="opinions-container">
|
||||
<el-timeline v-if="opinionList.length > 0">
|
||||
<el-timeline-item
|
||||
v-for="opinion in opinionList"
|
||||
:key="opinion.physicianId"
|
||||
:timestamp="formatDateTime(opinion.confirmTime)"
|
||||
placement="top"
|
||||
>
|
||||
<el-card shadow="hover">
|
||||
<div class="opinion-header">
|
||||
<span class="physician-info">
|
||||
<el-tag type="info" size="small">{{ opinion.deptName }}</el-tag>
|
||||
<span style="margin-left: 8px; font-weight: bold;">{{ opinion.physicianName }}</span>
|
||||
</span>
|
||||
<el-tag v-if="opinion.isSigned" type="success" size="small">
|
||||
<el-icon><Check /></el-icon> 已签名
|
||||
</el-tag>
|
||||
<el-tag v-else type="warning" size="small">已确认</el-tag>
|
||||
</div>
|
||||
<div class="opinion-content">
|
||||
{{ opinion.opinion }}
|
||||
</div>
|
||||
<div v-if="opinion.signatureTime" class="opinion-footer">
|
||||
签名时间:{{ formatDateTime(opinion.signatureTime) }}
|
||||
</div>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<el-empty v-else description="暂无会诊意见" :image-size="80" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属医生">
|
||||
<el-input v-model="formData.confirmDoctor" disabled />
|
||||
<el-input v-model="formData.confirmingPhysicianName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="代表科室">
|
||||
<el-input v-model="formData.confirmDept" disabled />
|
||||
<el-input v-model="formData.confirmingDeptName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签名医生">
|
||||
<el-input v-model="formData.signDoctor" disabled />
|
||||
<el-input v-model="formData.signature" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签名时间">
|
||||
<el-input v-model="formData.signTime" disabled />
|
||||
<el-input :model-value="formatDateTime(formData.signatureDate)" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -158,94 +207,85 @@
|
||||
</template>
|
||||
|
||||
<script setup name="consultationConfirmation">
|
||||
import { computed, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { computed, ref, onMounted, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Check } from '@element-plus/icons-vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {
|
||||
getPendingConfirmationList,
|
||||
confirmConsultation,
|
||||
cancelConfirmation,
|
||||
signConsultation,
|
||||
getConsultationOpinions
|
||||
} from './api'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const buildMockRows = () => ([
|
||||
{
|
||||
consultationId: 'CS20250812001',
|
||||
urgent: false,
|
||||
patientName: '陈明',
|
||||
gender: '男',
|
||||
age: '45',
|
||||
cardNo: 'CARD20250812001',
|
||||
consultationTime: '2025-08-12 17:48',
|
||||
invitee: '演示测试',
|
||||
applyDept: '内科',
|
||||
applyDoctor: '徐斌',
|
||||
applyTime: '2025-08-12 16:30',
|
||||
history: '胸闷、气短一周,既往有高血压史。',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmed: false,
|
||||
signed: false
|
||||
},
|
||||
{
|
||||
consultationId: 'CS20250812002',
|
||||
urgent: true,
|
||||
patientName: '赵敏',
|
||||
gender: '女',
|
||||
age: '32',
|
||||
cardNo: 'CARD20250812002',
|
||||
consultationTime: '2025-08-12 18:10',
|
||||
invitee: '李医生',
|
||||
applyDept: '神经内科',
|
||||
applyDoctor: '王婷',
|
||||
applyTime: '2025-08-12 16:50',
|
||||
history: '头晕伴视物模糊3天。',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmed: false,
|
||||
signed: false
|
||||
}
|
||||
])
|
||||
|
||||
const tableData = ref(buildMockRows())
|
||||
const loading = ref(false)
|
||||
const tableData = ref([])
|
||||
const currentRow = ref(null)
|
||||
const opinionList = ref([]) // 会诊意见列表
|
||||
|
||||
const formData = ref({
|
||||
id: null,
|
||||
consultationRequestId: null,
|
||||
consultationId: '',
|
||||
urgent: false,
|
||||
patientName: '',
|
||||
gender: '',
|
||||
genderText: '',
|
||||
age: '',
|
||||
cardNo: '',
|
||||
consultationTime: '',
|
||||
invitee: '',
|
||||
patientIdentifierNo: '',
|
||||
applyDept: '',
|
||||
applyDoctor: '',
|
||||
applyTime: '',
|
||||
history: '',
|
||||
applyTime: null,
|
||||
consultationDate: null,
|
||||
urgent: false,
|
||||
invitedObject: '',
|
||||
consultationPurpose: '',
|
||||
provisionalDiagnosis: '',
|
||||
confirmingPhysician: '',
|
||||
opinion: '',
|
||||
confirmDoctor: '',
|
||||
confirmDept: '',
|
||||
signDoctor: '',
|
||||
signTime: ''
|
||||
consultationOpinion: '',
|
||||
confirmingPhysicianName: '',
|
||||
confirmingDeptName: '',
|
||||
signature: '',
|
||||
signatureDate: null,
|
||||
submittingPhysician: '',
|
||||
submittingTime: null,
|
||||
consultationStatus: 0
|
||||
})
|
||||
|
||||
const confirmButtonText = computed(() => {
|
||||
if (!currentRow.value) {
|
||||
return '确认'
|
||||
}
|
||||
return currentRow.value.confirmed ? '取消确认' : '确认'
|
||||
// 基于当前医生的个人状态判断(使用ConsultationStatusEnum:20=已确认)
|
||||
return currentRow.value.myInvitedStatus >= 20 ? '取消确认' : '确认'
|
||||
})
|
||||
|
||||
const canSign = computed(() => {
|
||||
return !!currentRow.value && currentRow.value.confirmed && !currentRow.value.signed
|
||||
// 只要当前医生已确认但未签名,就可以签名(不需要等待所有医生都确认)
|
||||
// 使用ConsultationStatusEnum:20=已确认,30=已签名
|
||||
return !!currentRow.value &&
|
||||
currentRow.value.myInvitedStatus >= 20 && // 已确认
|
||||
currentRow.value.myInvitedStatus < 30 // 但还未签名
|
||||
})
|
||||
|
||||
const formatDateTime = (date = new Date()) => {
|
||||
const canEdit = computed(() => {
|
||||
// 当前医生未确认时可以编辑(使用ConsultationStatusEnum:10=已提交/待确认,20=已确认)
|
||||
return !!currentRow.value && (!currentRow.value.myInvitedStatus || currentRow.value.myInvitedStatus < 20)
|
||||
})
|
||||
|
||||
const formatDateTime = (date) => {
|
||||
if (!date) return ''
|
||||
const d = new Date(date)
|
||||
if (isNaN(d.getTime())) return ''
|
||||
|
||||
const pad = (value) => String(value).padStart(2, '0')
|
||||
const yyyy = date.getFullYear()
|
||||
const mm = pad(date.getMonth() + 1)
|
||||
const dd = pad(date.getDate())
|
||||
const hh = pad(date.getHours())
|
||||
const mi = pad(date.getMinutes())
|
||||
const ss = pad(date.getSeconds())
|
||||
const yyyy = d.getFullYear()
|
||||
const mm = pad(d.getMonth() + 1)
|
||||
const dd = pad(d.getDate())
|
||||
const hh = pad(d.getHours())
|
||||
const mi = pad(d.getMinutes())
|
||||
const ss = pad(d.getSeconds())
|
||||
return `${yyyy}-${mm}-${dd} ${hh}:${mi}:${ss}`
|
||||
}
|
||||
|
||||
@@ -255,84 +295,207 @@ const getDoctorDept = () => userStore.orgName || '当前科室'
|
||||
const applyRowToForm = (row) => {
|
||||
if (!row) {
|
||||
Object.keys(formData.value).forEach((key) => {
|
||||
formData.value[key] = key === 'urgent' ? false : ''
|
||||
if (key === 'urgent') {
|
||||
formData.value[key] = false
|
||||
} else if (key === 'consultationStatus') {
|
||||
formData.value[key] = 0
|
||||
} else {
|
||||
formData.value[key] = key === 'id' || key === 'consultationRequestId' ? null : ''
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
formData.value.consultationId = row.consultationId
|
||||
formData.value.urgent = row.urgent
|
||||
formData.value.patientName = row.patientName
|
||||
formData.value.gender = row.gender
|
||||
formData.value.age = row.age
|
||||
formData.value.cardNo = row.cardNo
|
||||
formData.value.consultationTime = row.consultationTime
|
||||
formData.value.invitee = row.invitee
|
||||
formData.value.applyDept = row.applyDept
|
||||
formData.value.applyDoctor = row.applyDoctor
|
||||
formData.value.applyTime = row.applyTime
|
||||
formData.value.history = row.history
|
||||
formData.value.confirmingPhysician = row.confirmingPhysician
|
||||
formData.value.opinion = row.opinion
|
||||
formData.value.confirmDoctor = row.confirmDoctor || ''
|
||||
formData.value.confirmDept = row.confirmDept || ''
|
||||
formData.value.signDoctor = row.signDoctor || ''
|
||||
formData.value.signTime = row.signTime || ''
|
||||
|
||||
formData.value = {
|
||||
id: row.id,
|
||||
consultationRequestId: row.consultationRequestId,
|
||||
consultationId: row.consultationId,
|
||||
patientName: row.patientName,
|
||||
genderText: row.genderText,
|
||||
age: row.age,
|
||||
patientIdentifierNo: row.patientIdentifierNo,
|
||||
applyDept: row.applyDept,
|
||||
applyDoctor: row.applyDoctor,
|
||||
applyTime: row.applyTime,
|
||||
consultationDate: row.consultationDate,
|
||||
urgent: row.urgent,
|
||||
invitedObject: row.invitedObject,
|
||||
consultationPurpose: row.consultationPurpose,
|
||||
provisionalDiagnosis: row.provisionalDiagnosis,
|
||||
confirmingPhysician: row.confirmingPhysician || '',
|
||||
consultationOpinion: '', // 先清空,后面从 opinionList 中获取
|
||||
confirmingPhysicianName: row.confirmingPhysicianName || '',
|
||||
confirmingDeptName: row.confirmingDeptName || '',
|
||||
signature: row.signature || '',
|
||||
signatureDate: row.signatureDate,
|
||||
submittingPhysician: row.submittingPhysician,
|
||||
submittingTime: row.submittingTime,
|
||||
consultationStatus: row.consultationStatus
|
||||
}
|
||||
|
||||
// 从会诊意见列表中获取当前医生的信息
|
||||
if (opinionList.value.length > 0) {
|
||||
const currentPhysicianId = userStore.practitionerId || userStore.user?.practitionerId
|
||||
const myOpinion = opinionList.value.find(op => op.physicianId === currentPhysicianId)
|
||||
|
||||
if (myOpinion) {
|
||||
// 如果当前医生已确认,回显其信息
|
||||
formData.value.confirmingPhysicianName = myOpinion.physicianName
|
||||
formData.value.confirmingDeptName = myOpinion.deptName
|
||||
|
||||
// 回显会诊意见(去掉前缀"科室-医生:")
|
||||
if (myOpinion.opinion) {
|
||||
// 格式:科室-医生:意见内容
|
||||
const opinionText = myOpinion.opinion
|
||||
const colonIndex = opinionText.indexOf(':')
|
||||
if (colonIndex > 0) {
|
||||
// 提取冒号后面的内容
|
||||
formData.value.consultationOpinion = opinionText.substring(colonIndex + 1)
|
||||
} else {
|
||||
formData.value.consultationOpinion = opinionText
|
||||
}
|
||||
}
|
||||
|
||||
if (myOpinion.isSigned) {
|
||||
formData.value.signature = myOpinion.physicianName
|
||||
formData.value.signatureDate = myOpinion.signatureTime
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleRowChange = (row) => {
|
||||
const handleRowChange = async (row) => {
|
||||
currentRow.value = row
|
||||
|
||||
// 先加载会诊意见列表
|
||||
if (row) {
|
||||
await loadConsultationOpinions(row.consultationId)
|
||||
} else {
|
||||
opinionList.value = []
|
||||
}
|
||||
|
||||
// 然后应用数据到表单(这样可以使用 opinionList 中的数据)
|
||||
applyRowToForm(row)
|
||||
}
|
||||
|
||||
const handleConfirm = () => {
|
||||
// 加载会诊意见列表
|
||||
const loadConsultationOpinions = async (consultationId) => {
|
||||
try {
|
||||
const res = await getConsultationOpinions(consultationId)
|
||||
if (res.code === 200) {
|
||||
opinionList.value = res.data || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载会诊意见失败', error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleConfirm = async () => {
|
||||
if (!currentRow.value) {
|
||||
return
|
||||
}
|
||||
if (!currentRow.value.confirmed) {
|
||||
if (!formData.value.opinion.trim()) {
|
||||
|
||||
try {
|
||||
// 如果已确认,则取消确认(使用ConsultationStatusEnum:20=已确认,30=已签名)
|
||||
if (currentRow.value.myInvitedStatus >= 20) {
|
||||
// 已签名不能取消确认
|
||||
if (currentRow.value.myInvitedStatus >= 30) {
|
||||
ElMessage.warning('已签名的会诊无法取消确认')
|
||||
return
|
||||
}
|
||||
|
||||
await ElMessageBox.confirm('确定要取消确认吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
loading.value = true
|
||||
const res = await cancelConfirmation(currentRow.value.consultationId)
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('取消确认成功')
|
||||
await loadData()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '取消确认失败')
|
||||
}
|
||||
} else {
|
||||
// 确认会诊
|
||||
if (!formData.value.consultationOpinion.trim()) {
|
||||
ElMessage.warning('请先填写会诊意见')
|
||||
return
|
||||
}
|
||||
if (!formData.value.confirmingPhysician.trim()) {
|
||||
ElMessage.warning('请先填写会诊确认参加医师')
|
||||
return
|
||||
|
||||
loading.value = true
|
||||
const data = {
|
||||
consultationId: formData.value.consultationId,
|
||||
consultationOpinion: formData.value.consultationOpinion,
|
||||
confirmingPhysician: getDoctorName(), // 自动使用当前医生姓名
|
||||
confirmingDeptName: getDoctorDept() // 自动使用当前科室
|
||||
}
|
||||
|
||||
const res = await confirmConsultation(data)
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('会诊确认成功')
|
||||
await loadData()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '会诊确认失败')
|
||||
}
|
||||
}
|
||||
currentRow.value.confirmed = true
|
||||
currentRow.value.confirmingPhysician = formData.value.confirmingPhysician
|
||||
currentRow.value.opinion = formData.value.opinion
|
||||
currentRow.value.confirmDoctor = getDoctorName()
|
||||
currentRow.value.confirmDept = getDoctorDept()
|
||||
formData.value.confirmDoctor = currentRow.value.confirmDoctor
|
||||
formData.value.confirmDept = currentRow.value.confirmDept
|
||||
ElMessage.success('会诊已确认')
|
||||
return
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
console.error('操作失败:', error)
|
||||
ElMessage.error('操作失败')
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
if (currentRow.value.signed) {
|
||||
ElMessage.warning('已签名的会诊无法取消确认')
|
||||
return
|
||||
}
|
||||
currentRow.value.confirmed = false
|
||||
currentRow.value.confirmDoctor = ''
|
||||
currentRow.value.confirmDept = ''
|
||||
formData.value.confirmDoctor = ''
|
||||
formData.value.confirmDept = ''
|
||||
ElMessage.success('已取消确认')
|
||||
}
|
||||
|
||||
const handleSign = () => {
|
||||
const handleSign = async () => {
|
||||
if (!currentRow.value) {
|
||||
return
|
||||
}
|
||||
if (!currentRow.value.confirmed) {
|
||||
ElMessage.warning('请先确认会诊申请')
|
||||
|
||||
// 检查当前医生是否已确认(使用ConsultationStatusEnum:20=已确认,30=已签名)
|
||||
if (!currentRow.value.myInvitedStatus || currentRow.value.myInvitedStatus < 20) {
|
||||
ElMessage.warning('请先确认会诊后再签名')
|
||||
return
|
||||
}
|
||||
currentRow.value.signed = true
|
||||
currentRow.value.signDoctor = getDoctorName()
|
||||
currentRow.value.signTime = formatDateTime()
|
||||
formData.value.signDoctor = currentRow.value.signDoctor
|
||||
formData.value.signTime = currentRow.value.signTime
|
||||
ElMessage.success('签名完成')
|
||||
|
||||
// 检查是否已签名
|
||||
if (currentRow.value.myInvitedStatus >= 30) {
|
||||
ElMessage.warning('您已经签名过了')
|
||||
return
|
||||
}
|
||||
|
||||
// 🎯 移除整体状态检查:只要当前医生已确认就可以签名,不需要等待所有医生都确认
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要签名吗?签名后将无法修改会诊意见。', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
loading.value = true
|
||||
const res = await signConsultation(currentRow.value.consultationId)
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('签名成功')
|
||||
await loadData()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '签名失败')
|
||||
}
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
console.error('签名失败:', error)
|
||||
ElMessage.error('签名失败')
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handlePrint = () => {
|
||||
@@ -343,12 +506,50 @@ const handlePrint = () => {
|
||||
window.print()
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
tableData.value = buildMockRows()
|
||||
currentRow.value = null
|
||||
applyRowToForm(null)
|
||||
const handleRefresh = async () => {
|
||||
await loadData()
|
||||
ElMessage.success('已刷新')
|
||||
}
|
||||
|
||||
const loadData = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await getPendingConfirmationList()
|
||||
|
||||
if (res.code === 200) {
|
||||
tableData.value = res.data || []
|
||||
|
||||
// 如果当前选中的行还在列表中,重新选中
|
||||
if (currentRow.value) {
|
||||
const updatedRow = tableData.value.find(
|
||||
item => item.consultationId === currentRow.value.consultationId
|
||||
)
|
||||
if (updatedRow) {
|
||||
currentRow.value = updatedRow
|
||||
// 重新加载会诊意见
|
||||
await loadConsultationOpinions(updatedRow.consultationId)
|
||||
// 然后应用数据到表单
|
||||
applyRowToForm(updatedRow)
|
||||
} else {
|
||||
currentRow.value = null
|
||||
applyRowToForm(null)
|
||||
opinionList.value = []
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(res.msg || '加载数据失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error)
|
||||
ElMessage.error('加载数据失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -390,13 +591,46 @@ const handleRefresh = () => {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.opinions-container {
|
||||
width: 100%;
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
padding: 10px;
|
||||
background-color: #f9fafb;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.opinion-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.physician-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.opinion-content {
|
||||
padding: 12px;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.opinion-footer {
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.el-timeline {
|
||||
padding-left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user