fix(consultation): 修复会诊确认页面医师显示问题
- 将confirmingPhysicianText字段替换为confirmingPhysician以正确显示参与医师 - 新增displayApplicationTime计算属性以区分新增和编辑时的申请时间显示 - 清理冗余代码并修复格式问题
This commit is contained in:
@@ -136,7 +136,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊确认参加医师">
|
||||
<el-input v-model="formData.confirmingPhysicianText" type="textarea" :rows="3" disabled />
|
||||
<el-input v-model="formData.confirmingPhysician" type="textarea" :rows="3" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="会诊意见" required>
|
||||
@@ -211,7 +211,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="consultationConfirmation">
|
||||
import { computed, ref, onMounted, watch } from 'vue'
|
||||
import { computed, ref, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Check } from '@element-plus/icons-vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
@@ -249,9 +249,8 @@ const formData = ref({
|
||||
consultationPurpose: '',
|
||||
provisionalDiagnosis: '',
|
||||
confirmingPhysician: '',
|
||||
confirmingPhysicianText: '', // 显示所有参与确认的医师
|
||||
consultationOpinion: '',
|
||||
confirmingPhysicianName: '',
|
||||
consultationOpinion: '',
|
||||
confirmingDeptName: '',
|
||||
signature: '',
|
||||
signatureDate: null,
|
||||
@@ -330,7 +329,7 @@ const applyRowToForm = (row) => {
|
||||
consultationPurpose: row.consultationPurpose,
|
||||
provisionalDiagnosis: row.provisionalDiagnosis,
|
||||
confirmingPhysician: row.confirmingPhysician || '',
|
||||
confirmingPhysicianText: '', // 初始化为空,稍后根据opinionList设置
|
||||
confirmingPhysicianName: '',
|
||||
consultationOpinion: '', // 先清空,后面从 opinionList 中获取
|
||||
confirmingPhysicianName: row.confirmingPhysicianName || '',
|
||||
confirmingDeptName: row.confirmingDeptName || '',
|
||||
@@ -345,14 +344,14 @@ const applyRowToForm = (row) => {
|
||||
if (opinionList.value.length > 0) {
|
||||
// 生成所有参与确认医师的文本(格式:科室-医生姓名;科室-医生姓名)
|
||||
const allConfirmingPhysicians = opinionList.value.map(op => `${op.deptName}-${op.physicianName}`).join(';')
|
||||
formData.value.confirmingPhysicianText = allConfirmingPhysicians
|
||||
formData.value.confirmingPhysician = allConfirmingPhysicians // 这个字段显示所有确认的医生
|
||||
|
||||
// 从会诊意见列表中获取当前医生的信息
|
||||
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
|
||||
|
||||
@@ -435,9 +434,9 @@ const handleConfirm = async () => {
|
||||
} else {
|
||||
// 确认会诊
|
||||
if (!formData.value.consultationOpinion.trim()) {
|
||||
ElMessage.warning('请先填写会诊意见')
|
||||
return
|
||||
}
|
||||
ElMessage.warning('请先填写会诊意见')
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
const data = {
|
||||
@@ -560,8 +559,8 @@ const loadData = async () => {
|
||||
// 然后应用数据到表单
|
||||
applyRowToForm(updatedRow)
|
||||
} else {
|
||||
currentRow.value = null
|
||||
applyRowToForm(null)
|
||||
currentRow.value = null
|
||||
applyRowToForm(null)
|
||||
opinionList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请时间:">
|
||||
<el-input v-model="currentTime" disabled />
|
||||
<el-input v-model="displayApplicationTime" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -381,6 +381,17 @@ const selectedRow = ref(null);
|
||||
const currentTime = ref('');
|
||||
let timeTimer = null; // 定时器引用
|
||||
|
||||
// 计算显示的申请时间 - 如果有选中行则显示其申请时间,否则显示当前时间
|
||||
const displayApplicationTime = computed(() => {
|
||||
if (selectedRow.value && selectedRow.value.consultationRequestDate) {
|
||||
// 如果是编辑已有记录,则显示其申请时间(不是动态时间)
|
||||
return selectedRow.value.consultationRequestDate;
|
||||
} else {
|
||||
// 如果是新增记录,则显示当前时间(动态时间)
|
||||
return currentTime.value;
|
||||
}
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
consultationId: '',
|
||||
|
||||
Reference in New Issue
Block a user