样式以及逻辑BUG修复
This commit is contained in:
parent
bf92e61236
commit
63a168ba69
@ -394,65 +394,6 @@ const loadPatientData = async (patient) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改检查类型变化的监听器
|
||||
watch(
|
||||
() => props.examType,
|
||||
async (newType, oldType) => {
|
||||
console.log(`[All.vue] examType 变化: 从 ${oldType} 到 ${newType}`)
|
||||
|
||||
if (!newType) return
|
||||
|
||||
// 如果新旧类型相同,不执行任何操作
|
||||
if (newType === oldType) return
|
||||
|
||||
// 无论如何都清空当前数据
|
||||
mediaFiles.value = []
|
||||
imageUrls.value = []
|
||||
|
||||
if (reportData.value.medicalSn) {
|
||||
// 显示加载中
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '加载中...',
|
||||
background: 'rgba(255, 255, 255, 0.7)'
|
||||
})
|
||||
|
||||
try {
|
||||
console.log(`[All.vue] 重新获取 ${newType} 类型的影像数据`)
|
||||
// 重新获取影像数据
|
||||
await getImageUrls()
|
||||
console.log(`[All.vue] 获取到 ${mediaFiles.value.length} 个媒体文件`)
|
||||
} finally {
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: false }
|
||||
)
|
||||
|
||||
// 修改患者变化的监听器
|
||||
watch(
|
||||
() => props.patient,
|
||||
(newPatient) => {
|
||||
console.log(`[All.vue] 患者变化: ${newPatient?.pname}, ID: ${newPatient?.id}`)
|
||||
|
||||
if (newPatient) {
|
||||
// 保存当前检查类型
|
||||
const currentExamType = props.examType
|
||||
console.log(`[All.vue] 当前检查类型: ${currentExamType}`)
|
||||
|
||||
loadPatientData(newPatient).then(() => {
|
||||
// 如果有检查类型,确保加载对应类型的影像数据
|
||||
if (currentExamType && reportData.value.medicalSn) {
|
||||
console.log(`[All.vue] 加载 ${currentExamType} 类型的影像数据`)
|
||||
getImageUrls()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
// 修改组件挂载时的逻辑
|
||||
onMounted(async () => {
|
||||
if (props.patient) {
|
||||
@ -473,6 +414,41 @@ onMounted(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
// 添加 watch 监听 examType 变化
|
||||
watch(
|
||||
() => props.examType,
|
||||
async (newExamType, oldExamType) => {
|
||||
if (newExamType !== oldExamType && props.patient && reportData.value.medicalSn) {
|
||||
// 清空当前数据
|
||||
mediaFiles.value = []
|
||||
imageUrls.value = []
|
||||
|
||||
// 重新获取影像数据
|
||||
await getImageUrls()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// 添加 watch 监听 patient 变化
|
||||
watch(
|
||||
() => props.patient,
|
||||
async (newPatient, oldPatient) => {
|
||||
if (newPatient && (!oldPatient || newPatient.id !== oldPatient.id)) {
|
||||
// 清空当前数据
|
||||
mediaFiles.value = []
|
||||
imageUrls.value = []
|
||||
|
||||
// 加载患者数据和检查项目
|
||||
await loadPatientData(newPatient)
|
||||
|
||||
// 在加载完患者数据后,手动获取影像数据
|
||||
if (props.examType && reportData.value.medicalSn) {
|
||||
await getImageUrls()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// 添加获取检查类型标题的方法
|
||||
const getExamTypeTitle = () => {
|
||||
const typeMap = {
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
size="small"
|
||||
@click="handleSync"
|
||||
:icon="RefreshRight"
|
||||
:disabled="isExamCompleted"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
@ -279,9 +280,28 @@
|
||||
<!-- 底部操作栏 -->
|
||||
<div class="action-footer">
|
||||
<div class="left-section">
|
||||
<span>检查医生:</span>
|
||||
<span>{{ selectedPatient?.status === '1' || selectedPatient?.status === 1 ? (inspectDoctor || ' ') : ' ' }}</span>
|
||||
<span style="margin-left: 100px;">检查日期:{{ selectedPatient?.status === '1' || selectedPatient?.status === 1 ? (inspectTime || ' ') : ' ' }}</span>
|
||||
<div class="doctor-select-container">
|
||||
<span>检查医生:</span>
|
||||
<!-- 根据检查状态显示不同内容 -->
|
||||
<template v-if="isExamCompleted">
|
||||
<span>{{ inspectDoctor }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- 修改选择控件 -->
|
||||
<el-select v-model="inspectDoctor" placeholder="请选择检查医生" :disabled="isDisabled" class="doctor-select">
|
||||
<el-option
|
||||
v-for="item in getStrDictOptions('doctor_unit')"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="`${item.label}|${item.value}`"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
<div class="date-container">
|
||||
<span>检查日期:</span>
|
||||
<span>{{ inspectTime || formatDate(new Date()) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div class="action-buttons">
|
||||
@ -310,6 +330,9 @@ import { getUserProfile } from '@/api/system/user/profile'
|
||||
import ExamImages from './Exam_images.vue'
|
||||
import { ArrowDown, Refresh, RefreshRight } from '@element-plus/icons-vue'
|
||||
import All from './All.vue' // 导入All组件用于超声、心电图等
|
||||
import { PacsDataApi } from '@/api/inspect/inspectpacsdata' // 导入PacsDataApi
|
||||
import { getStrDictOptions } from '@/utils/dict'//导入字典
|
||||
|
||||
|
||||
const dialogTitle = ref('体检报告')
|
||||
const { t } = useI18n() // 国际化
|
||||
@ -533,14 +556,8 @@ const getpatientitemData = async (medicalSn) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改 loadPatientData 函数,确保它不会修改 currentTab
|
||||
// 修改 loadPatientData 函数,确保正确加载已检查患者的医生和日期
|
||||
const loadPatientData = async (patient) => {
|
||||
console.log(`[loadPatientData] 开始加载患者数据: ${patient.pname}, ID: ${patient.id}`)
|
||||
console.log(`[loadPatientData] 加载前的当前标签: ${currentTab.value}`)
|
||||
|
||||
// 保存当前标签,以便在加载完成后恢复
|
||||
//const savedTab = currentTab.value
|
||||
|
||||
try {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
@ -557,6 +574,13 @@ const loadPatientData = async (patient) => {
|
||||
const patientData = await PatientApi.getPatient(patient.id)
|
||||
reportData.value = patientData
|
||||
|
||||
// 重置检查医生和日期
|
||||
inspectDoctor.value = ''
|
||||
inspectTime.value = ''
|
||||
|
||||
// 检查患者状态,如果已检查则设置检查完成状态为true
|
||||
isExamCompleted.value = patient.status === '1' || patient.status === 1
|
||||
|
||||
// 获取检查项目
|
||||
const itemsRes = await PatientitemsApi.getPatientitemsPage({
|
||||
medicalSn: patient.medicalSn,
|
||||
@ -579,20 +603,17 @@ const loadPatientData = async (patient) => {
|
||||
biochemical: { summary: '' }
|
||||
}
|
||||
|
||||
// 初始化检查医生和检查时间为空
|
||||
inspectDoctor.value = ''
|
||||
inspectTime.value = ''
|
||||
|
||||
// 查找已检查的项目,获取检查医生和检查时间
|
||||
const checkedItems = itemsRes.list.filter(item =>
|
||||
item.itemStatus === '1' &&
|
||||
item.sectionID === user.value.deptId
|
||||
)
|
||||
// 查找已检查的项目,获取检查医生和日期
|
||||
const checkedItems = itemsRes.list.filter(item => item.itemStatus === '1')
|
||||
|
||||
if (checkedItems.length > 0) {
|
||||
// 使用第一个已检查项目的检查医生和检查时间
|
||||
// 使用第一个已检查项目的检查医生和日期
|
||||
const firstCheckedItem = checkedItems[0]
|
||||
inspectDoctor.value = firstCheckedItem.inspectdoctor || ''
|
||||
|
||||
// 设置检查医生
|
||||
if (firstCheckedItem.inspectdoctor) {
|
||||
inspectDoctor.value = firstCheckedItem.inspectdoctor
|
||||
}
|
||||
|
||||
// 格式化检查时间
|
||||
if (firstCheckedItem.inspecttime) {
|
||||
@ -625,35 +646,32 @@ const loadPatientData = async (patient) => {
|
||||
ElMessage.error('加载患者数据失败')
|
||||
} finally {
|
||||
loading.close()
|
||||
|
||||
// 确保当前标签保持不变
|
||||
// if (currentTab.value !== savedTab) {
|
||||
// console.log(`[loadPatientData] 恢复标签: 从 ${currentTab.value} 到 ${savedTab}`)
|
||||
// currentTab.value = savedTab
|
||||
// }
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载患者数据失败:', error)
|
||||
ElMessage.error('加载患者数据失败')
|
||||
}
|
||||
|
||||
// 在加载完成后记录当前标签
|
||||
console.log(`[loadPatientData] 加载完成后的当前标签: ${currentTab.value}`)
|
||||
}
|
||||
|
||||
// 修改 handlePatientSelect 函数,避免重置标签
|
||||
// 修改 handlePatientSelect 函数,确保正确设置检查完成状态
|
||||
const handlePatientSelect = async (patient) => {
|
||||
try {
|
||||
// 清理当前数据
|
||||
examConclusion.value = ''
|
||||
examItems.value = {}
|
||||
|
||||
// 设置选中患者
|
||||
selectedPatient.value = patient
|
||||
// 重新加载患者数据,但不改变当前标签
|
||||
console.log(`[handlePatientSelect] 开始加载患者数据`)
|
||||
|
||||
// 重置检查医生和日期
|
||||
inspectDoctor.value = ''
|
||||
inspectTime.value = ''
|
||||
|
||||
// 根据患者状态设置检查完成状态
|
||||
isExamCompleted.value = patient.status === '1' || patient.status === 1
|
||||
|
||||
await loadPatientData(patient)
|
||||
console.log(`[handlePatientSelect] 患者数据加载完成`)
|
||||
currentTab.value='general'
|
||||
currentTab.value = 'general'
|
||||
} catch (error) {
|
||||
console.error('[handlePatientSelect] 切换患者失败:', error)
|
||||
message.error('切换患者失败')
|
||||
@ -1027,40 +1045,126 @@ const handleSync = async () => {
|
||||
throw new Error('未选择患者或体检编号为空')
|
||||
}
|
||||
|
||||
const medicalSn = selectedPatient.value.medicalSn
|
||||
// 保存当前选中的患者,以便在同步后恢复选中状态
|
||||
const currentSelectedPatient = { ...selectedPatient.value }
|
||||
const medicalSn = currentSelectedPatient.medicalSn
|
||||
|
||||
// 定义需要同步的类型
|
||||
const types = ['XCG', 'NCG', 'SHQX','ECG','YBJC']
|
||||
const types = ['XCG', 'NCG', 'SHQX', 'ECG', 'YBJC']
|
||||
|
||||
// 并行请求所有报告(包括检验报告和超声报告)
|
||||
const syncPromises = [
|
||||
// 检验报告请求
|
||||
...types.map(type =>
|
||||
// 首先检查每种类型是否已存在数据
|
||||
const existingDataPromises = types.map(type =>
|
||||
PacsDataApi.getPacsDataPage({
|
||||
code: medicalSn,
|
||||
type: type,
|
||||
pageNo: 1,
|
||||
pageSize: 1
|
||||
}).catch(error => {
|
||||
console.warn(`检查${type}数据是否存在时出错:`, error)
|
||||
return { list: [] }
|
||||
})
|
||||
)
|
||||
|
||||
// 检查超声数据是否存在
|
||||
const usExistingData = await PacsDataApi.getPacsDataPage({
|
||||
code: medicalSn,
|
||||
type: 'US',
|
||||
pageNo: 1,
|
||||
pageSize: 1
|
||||
}).catch(error => {
|
||||
console.warn('检查超声数据是否存在时出错:', error)
|
||||
return { list: [] }
|
||||
})
|
||||
|
||||
// 检查心电图数据是否存在
|
||||
const ecgExistingData = await PacsDataApi.getPacsDataPage({
|
||||
code: medicalSn,
|
||||
type: 'ECG',
|
||||
pageNo: 1,
|
||||
pageSize: 1
|
||||
}).catch(error => {
|
||||
console.warn('检查心电图数据是否存在时出错:', error)
|
||||
return { list: [] }
|
||||
})
|
||||
|
||||
// 获取所有类型的现有数据结果
|
||||
const existingDataResults = await Promise.all(existingDataPromises)
|
||||
|
||||
// 确定哪些类型需要同步
|
||||
const typesToSync = []
|
||||
existingDataResults.forEach((result, index) => {
|
||||
const type = types[index]
|
||||
// 如果没有数据或数据为空,则需要同步
|
||||
const needsSync = !result.list || result.list.length === 0 ||
|
||||
(result.list[0] && (!result.list[0].data || result.list[0].data === ''))
|
||||
if (needsSync) {
|
||||
typesToSync.push(type)
|
||||
} else {
|
||||
console.log(`${type}数据已存在且不为空,跳过同步`)
|
||||
}
|
||||
})
|
||||
|
||||
// 检查超声数据是否需要同步
|
||||
const needsSyncUS = !usExistingData.list || usExistingData.list.length === 0 ||
|
||||
(usExistingData.list[0] && (!usExistingData.list[0].data || usExistingData.list[0].data === ''))
|
||||
|
||||
// 检查心电图数据是否需要同步
|
||||
const needsSyncECG = !ecgExistingData.list || ecgExistingData.list.length === 0 ||
|
||||
(ecgExistingData.list[0] && (!ecgExistingData.list[0].data || ecgExistingData.list[0].data === ''))
|
||||
|
||||
// 准备同步请求
|
||||
const syncPromises = []
|
||||
|
||||
// 添加需要同步的检验报告请求
|
||||
typesToSync.forEach(type => {
|
||||
syncPromises.push(
|
||||
PatientApi.getReportTj(medicalSn, type)
|
||||
.catch(error => {
|
||||
console.warn(`获取${type}报告失败:`, error)
|
||||
return null
|
||||
})
|
||||
),
|
||||
// 超声报告请求
|
||||
PatientApi.getUSTj(medicalSn)
|
||||
.catch(error => {
|
||||
console.warn('获取超声报告失败:', error)
|
||||
return null
|
||||
}),
|
||||
// 心电报告请求
|
||||
PatientApi.GetApiEcgInfo(medicalSn)
|
||||
)
|
||||
})
|
||||
|
||||
// 如果需要,添加超声报告请求
|
||||
if (needsSyncUS) {
|
||||
syncPromises.push(
|
||||
PatientApi.getUSTj(medicalSn)
|
||||
.catch(error => {
|
||||
console.warn('获取心电报告失败:', error)
|
||||
console.warn('获取超声报告失败:', error)
|
||||
return null
|
||||
}),
|
||||
// 一般检查报告请求
|
||||
PatientApi.GetApiYbjcInfo(medicalSn, selectedPatient.value?.cardId)//测试一般检查
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// 如果需要,添加心电图报告请求
|
||||
if (needsSyncECG) {
|
||||
syncPromises.push(
|
||||
PatientApi.GetApiEcgInfo(medicalSn)
|
||||
.catch(error => {
|
||||
console.warn('获取心电图报告失败:', error)
|
||||
return null
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
// 如果需要,添加一般检查报告请求
|
||||
if (typesToSync.includes('YBJC')) {
|
||||
syncPromises.push(
|
||||
PatientApi.GetApiYbjcInfo(medicalSn, currentSelectedPatient.cardId)
|
||||
.catch(error => {
|
||||
console.warn('获取一般检查报告失败:', error)
|
||||
return null
|
||||
})
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
// 如果没有需要同步的项目,直接返回
|
||||
if (syncPromises.length === 0) {
|
||||
loading.close()
|
||||
ElMessage.info('所有报告数据已存在,无需同步')
|
||||
return
|
||||
}
|
||||
|
||||
const results = await Promise.all(syncPromises)
|
||||
|
||||
@ -1071,66 +1175,24 @@ const handleSync = async () => {
|
||||
}
|
||||
|
||||
// 处理同步结果
|
||||
results.forEach((result, index) => {
|
||||
let successCount = 0
|
||||
results.forEach(result => {
|
||||
if (result) {
|
||||
if (index < types.length) {
|
||||
// 处理检验报告结果
|
||||
const type = types[index]
|
||||
switch (type) {
|
||||
case 'XCG':
|
||||
console.log('血常规报告同步成功')
|
||||
break
|
||||
case 'NCG':
|
||||
console.log('尿常规报告同步成功')
|
||||
break
|
||||
case 'SHQX':
|
||||
console.log('生化报告同步成功')
|
||||
break
|
||||
case 'ECG':
|
||||
console.log('心电报告同步成功')
|
||||
break
|
||||
}
|
||||
} else {
|
||||
// 处理超声报告结果
|
||||
console.log('超声报告同步成功')
|
||||
}
|
||||
successCount++
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 等待一小段时间确保后端数据同步完成
|
||||
await new Promise(resolve => setTimeout(resolve, 1000))
|
||||
|
||||
// 获取最新的患者列表
|
||||
const today = new Date()
|
||||
const todayStart = new Date(today.setHours(0, 0, 0, 0))
|
||||
const todayEnd = new Date(today.setHours(23, 59, 59, 999))
|
||||
|
||||
const params = {
|
||||
pageNo: pageNo.value,
|
||||
pageSize: pageSize.value,
|
||||
medicalDateTime: [
|
||||
`${formatDate(todayStart)} 00:00:00`,
|
||||
`${formatDate(todayEnd)} 23:59:59`
|
||||
]
|
||||
}
|
||||
|
||||
const res = await PatientApi.getPatientPage(params)
|
||||
|
||||
// 更新列表数据
|
||||
patients.value = res.list
|
||||
originalPatients.value = res.list
|
||||
total.value = res.total
|
||||
|
||||
// 清除缓存
|
||||
patientDataCache.value.clear()
|
||||
|
||||
// 如果当前有选中的患者,重新加载其数据
|
||||
if (selectedPatient.value) {
|
||||
await loadPatientData(selectedPatient.value)
|
||||
}
|
||||
// 重新加载当前患者的数据,但不清空左侧列表
|
||||
await loadPatientData(currentSelectedPatient)
|
||||
|
||||
loading.close()
|
||||
ElMessage.success('同步成功')
|
||||
ElMessage.success(`同步成功,共同步了${successCount}个报告`)
|
||||
} catch (error) {
|
||||
loading.close()
|
||||
console.error('同步数据失败:', error)
|
||||
@ -1473,6 +1535,13 @@ const handleSaveAllResults = async () => {
|
||||
const userProfile = await getUserProfile()
|
||||
user.value = userProfile
|
||||
const currentTimestamp = Date.now()
|
||||
const currentDate = formatDate(new Date())
|
||||
|
||||
// 获取选择的医生信息
|
||||
let doctorName = inspectDoctor.value
|
||||
if (doctorName && doctorName.includes('|')) {
|
||||
doctorName = doctorName.split('|')[0] // 只取医生姓名部分
|
||||
}
|
||||
|
||||
// 收集所有标签页的所有检查项目
|
||||
let allUpdatedItems = []
|
||||
@ -1489,9 +1558,10 @@ const handleSaveAllResults = async () => {
|
||||
id: item.id,
|
||||
medicalSn: selectedPatient.value?.medicalSn,
|
||||
itemStatus: '1', // 设置为已检查状态
|
||||
inspectdoctor: user.value?.nickname || '',
|
||||
inspecttime: currentTimestamp,
|
||||
sectionID: user.value?.deptId
|
||||
inspectdoctor: doctorName || user.value?.nickname || '',
|
||||
inspecttime: currentTimestamp, // 使用当前时间戳
|
||||
sectionID: user.value?.deptId,
|
||||
itemResult: item.value || '' // 添加检查结果值
|
||||
}
|
||||
|
||||
// 根据项目类型处理不同的字段
|
||||
@ -1523,27 +1593,27 @@ const handleSaveAllResults = async () => {
|
||||
allUpdatedItems.push({
|
||||
...baseFields,
|
||||
analyse: conclusionData.value.blood?.summary?.trim() || '', // 只将小结保存到analyse字段
|
||||
itemResult: conclusionData.value.blood?.summary?.trim() || '' // 同时更新itemResult字段
|
||||
itemResult: item.value || conclusionData.value.blood?.summary?.trim() || '' // 保留原始检查结果值
|
||||
})
|
||||
} else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) {
|
||||
allUpdatedItems.push({
|
||||
...baseFields,
|
||||
analyse: conclusionData.value.urine?.summary?.trim() || '', // 只将小结保存到analyse字段
|
||||
itemResult: conclusionData.value.urine?.summary?.trim() || '' // 同时更新itemResult字段
|
||||
itemResult: item.value || conclusionData.value.urine?.summary?.trim() || '' // 保留原始检查结果值
|
||||
})
|
||||
} else if (itemName.includes('生化') || itemName.includes('肝功能') || itemName.includes('肾功能') ||
|
||||
itemName.includes('血脂') || itemName.includes('血糖') || itemName.includes('电解质')) {
|
||||
allUpdatedItems.push({
|
||||
...baseFields,
|
||||
analyse: conclusionData.value.biochemical?.summary?.trim() || '', // 只将小结保存到analyse字段
|
||||
itemResult: conclusionData.value.biochemical?.summary?.trim() || '' // 同时更新itemResult字段
|
||||
itemResult: item.value || conclusionData.value.biochemical?.summary?.trim() || '' // 保留原始检查结果值
|
||||
})
|
||||
} else {
|
||||
// 一般检查项目
|
||||
allUpdatedItems.push({
|
||||
...baseFields,
|
||||
analyse: conclusionData.value.general?.summary?.trim() || '', // 只将小结保存到analyse字段
|
||||
itemResult: conclusionData.value.general?.summary?.trim() || '' // 同时更新itemResult字段
|
||||
itemResult: item.value || conclusionData.value.general?.summary?.trim() || '' // 保留原始检查结果值
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -1558,8 +1628,7 @@ const handleSaveAllResults = async () => {
|
||||
await PatientitemsApi.updatePatientitemsBatch(allUpdatedItems)
|
||||
|
||||
// 更新检查医生和检查日期
|
||||
inspectDoctor.value = user.value?.nickname || ''
|
||||
inspectTime.value = formatDate(new Date())
|
||||
inspectTime.value = currentDate
|
||||
|
||||
// 更新患者状态为已检查 - 调用更新患者状态的API
|
||||
if (selectedPatient.value) {
|
||||
@ -1567,7 +1636,7 @@ const handleSaveAllResults = async () => {
|
||||
await PatientApi.updatePatient({
|
||||
id: selectedPatient.value.id,
|
||||
status: 1, // 设置为已检查状态
|
||||
medicalDateTime: currentTimestamp // 更新体检日期为当前时间戳
|
||||
medicalDateTime: currentTimestamp // 更新体检日期为当前时间
|
||||
})
|
||||
|
||||
// 更新本地状态
|
||||
@ -1599,7 +1668,7 @@ const handleSaveAllResults = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改刷新数据的方法,确保正确更新检查状态
|
||||
// 修改 refreshExamData 函数,确保正确更新检查状态和医生信息
|
||||
const refreshExamData = async () => {
|
||||
try {
|
||||
// 重新获取患者信息以更新状态
|
||||
@ -1633,8 +1702,30 @@ const refreshExamData = async () => {
|
||||
const itemsRes = await PatientitemsApi.getPatientitemsPage(params)
|
||||
|
||||
if (itemsRes.list && itemsRes.list.length > 0) {
|
||||
// 更新检查项目数据
|
||||
// ... 现有的检查项目更新逻辑 ...
|
||||
// 查找已检查的项目,获取检查医生
|
||||
const checkedItems = itemsRes.list.filter(item =>
|
||||
item.itemStatus === '1' &&
|
||||
item.sectionID === user.value.deptId
|
||||
)
|
||||
|
||||
if (checkedItems.length > 0) {
|
||||
// 使用第一个已检查项目的检查医生
|
||||
const firstCheckedItem = checkedItems[0]
|
||||
|
||||
// 设置检查医生
|
||||
if (firstCheckedItem.inspectdoctor) {
|
||||
inspectDoctor.value = firstCheckedItem.inspectdoctor
|
||||
|
||||
// 更新检查状态为已完成,这样就不会显示选择控件
|
||||
isExamCompleted.value = true
|
||||
}
|
||||
|
||||
// 格式化检查时间
|
||||
if (firstCheckedItem.inspecttime) {
|
||||
const inspectDate = new Date(Number(firstCheckedItem.inspecttime))
|
||||
inspectTime.value = formatDate(inspectDate)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('刷新数据失败:', error)
|
||||
@ -1644,6 +1735,7 @@ const refreshExamData = async () => {
|
||||
// 添加检查医生和检查日期的响应式引用
|
||||
const inspectDoctor = ref('')
|
||||
const inspectTime = ref('')
|
||||
// 不再需要 inspectDate 变量,直接使用当前日期
|
||||
|
||||
// 添加特殊检查类型的计算属性
|
||||
const isSpecialExam = computed(() => {
|
||||
@ -1683,25 +1775,28 @@ const handleStatusFilterChange = (value) => {
|
||||
selectedPatient.value = null
|
||||
}
|
||||
|
||||
// 添加一个监听器来跟踪 currentTab 的变化
|
||||
watch(currentTab, (newTab, oldTab) => {
|
||||
console.log(`[watch] currentTab 变化: 从 ${oldTab} 到 ${newTab}`)
|
||||
}, { immediate: true })
|
||||
// 添加检查是否已完成的响应式引用
|
||||
const isExamCompleted = ref(false)
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.medical-report {
|
||||
display: flex;
|
||||
height: 83vh;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
height: calc(100vh - 120px); /* 使用视口高度减去头部和其他元素的高度 */
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.patient-list {
|
||||
width: 280px;
|
||||
background: #fff;
|
||||
border-right: 1px solid #e6e6e6;
|
||||
width: 280px;
|
||||
min-width: 250px; /* 设置最小宽度 */
|
||||
background: #fff;
|
||||
border-right: 1px solid #e6e6e6;
|
||||
display: flex;
|
||||
flex-direction: column; /* 确保子元素垂直排列 */
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.list-header {
|
||||
@ -1805,11 +1900,13 @@ border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.report-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
overflow: auto; /* 添加滚动条 */
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
@ -1858,11 +1955,10 @@ border-left-color: #409EFF;
|
||||
}
|
||||
|
||||
.basic-info {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
padding: 10px;
|
||||
background: #F8F9FA;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0; /* 防止基本信息区域被压缩 */
|
||||
}
|
||||
|
||||
.photo-box {
|
||||
@ -1974,13 +2070,14 @@ flex: 1;
|
||||
}
|
||||
|
||||
.result-table {
|
||||
margin: 2px 0;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
height: 366px; /* 固定高度,与Charge.vue保持一致 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
flex: 1;
|
||||
overflow: auto; /* 使表格可滚动 */
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
min-height: 200px; /* 设置最小高度 */
|
||||
}
|
||||
|
||||
/* 表头样式 */
|
||||
@ -2053,10 +2150,11 @@ background: #f5f7fa;
|
||||
|
||||
/* 修改体检小结样式 */
|
||||
.summary-section {
|
||||
margin-top: 20px;
|
||||
padding: 20px;
|
||||
margin-top: 15px;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0; /* 防止被压缩 */
|
||||
}
|
||||
|
||||
.section-title {
|
||||
@ -2070,7 +2168,7 @@ border-left: 4px solid #409eff;
|
||||
|
||||
.summary-textarea {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
height: 100px; /* 减小高度 */
|
||||
padding: 12px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
@ -2091,7 +2189,7 @@ cursor: not-allowed;
|
||||
}
|
||||
|
||||
.action-footer {
|
||||
position: absolute;
|
||||
position: sticky; /* 改为粘性定位 */
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
@ -2102,12 +2200,14 @@ padding: 10px 20px;
|
||||
background: #fff;
|
||||
border-top: 1px solid #ebeef5;
|
||||
z-index: 10;
|
||||
flex-shrink: 0; /* 防止被压缩 */
|
||||
}
|
||||
|
||||
.left-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
flex-wrap: nowrap; /* 防止换行 */
|
||||
}
|
||||
|
||||
.signature {
|
||||
@ -2205,7 +2305,7 @@ flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.list-content {
|
||||
height: calc(100% - 180px);
|
||||
flex: 1; /* 让列表内容区域占据剩余空间 */
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
display: flex;
|
||||
@ -2304,9 +2404,11 @@ background: #fff;
|
||||
|
||||
/* 确保图片展示组件能够正确填充空间 */
|
||||
:deep(.exam-images) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* 美化滚动条样式 */
|
||||
@ -2502,7 +2604,6 @@ cursor: not-allowed;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.tabs-container {
|
||||
@ -2544,29 +2645,17 @@ cursor: not-allowed;
|
||||
.findings-diagnosis-container {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin: 15px 0;
|
||||
margin-top: 15px;
|
||||
flex-shrink: 0; /* 防止被压缩 */
|
||||
}
|
||||
|
||||
.findings-section,
|
||||
.diagnosis-section {
|
||||
.findings-section, .diagnosis-section {
|
||||
flex: 1;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
margin-bottom: 15px;
|
||||
padding-left: 10px;
|
||||
border-left: 4px solid #409eff;
|
||||
}
|
||||
|
||||
.findings-textarea,
|
||||
.diagnosis-textarea {
|
||||
.findings-textarea, .diagnosis-textarea {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
padding: 12px;
|
||||
@ -2630,4 +2719,67 @@ cursor: not-allowed;
|
||||
:deep(.el-radio__label) {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 添加媒体查询,适应不同屏幕尺寸 */
|
||||
@media screen and (max-width: 1366px) {
|
||||
.findings-diagnosis-container {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.findings-textarea, .diagnosis-textarea, .summary-textarea {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.exam-tabs {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1024px) {
|
||||
.patient-list {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 添加这些新样式 */
|
||||
.doctor-select-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.doctor-select {
|
||||
margin-left: 8px;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.date-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 修改左侧区域样式 */
|
||||
.left-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
flex-wrap: nowrap; /* 防止换行 */
|
||||
}
|
||||
|
||||
/* 确保 el-select 不会被挤压 */
|
||||
:deep(.el-select) {
|
||||
width: auto;
|
||||
min-width: 180px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user