增加同步接口以及功能
This commit is contained in:
parent
ec21ddbaf8
commit
851b555172
@ -18,6 +18,7 @@ export interface PatientitemsVO {
|
|||||||
itemStatus: string // 0:未检 1:已检 2:放弃 3:挂起,择日检(待查)
|
itemStatus: string // 0:未检 1:已检 2:放弃 3:挂起,择日检(待查)
|
||||||
createTime: Date // 创建时间
|
createTime: Date // 创建时间
|
||||||
positive: string // 是否阳性 1:阳性
|
positive: string // 是否阳性 1:阳性
|
||||||
|
analyse: string // 检查结果分析
|
||||||
inspectdoctor: string // 检查医生
|
inspectdoctor: string // 检查医生
|
||||||
inspecttime: Date // 检查时间
|
inspecttime: Date // 检查时间
|
||||||
groupname: string // 模块名称
|
groupname: string // 模块名称
|
||||||
@ -70,4 +71,9 @@ export const PatientitemsApi = {
|
|||||||
exportPatientitems: async (params) => {
|
exportPatientitems: async (params) => {
|
||||||
return await request.download({ url: `/Inspect/patientitems/export-excel`, params })
|
return await request.download({ url: `/Inspect/patientitems/export-excel`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//同步患者数据和检查项
|
||||||
|
createPatientapiInfo: async () => {
|
||||||
|
return await request.get({ url: `/Inspect/patientitems/apiPatientInfo` })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ const getImageUrls = async () => {
|
|||||||
'ultrasound': ['ultrasound', 'us', '超声', '彩超', 'b超', 'doppler'],
|
'ultrasound': ['ultrasound', 'us', '超声', '彩超', 'b超', 'doppler'],
|
||||||
'ecg': ['ecg', 'ekg', '心电图', 'electrocardiogram'],
|
'ecg': ['ecg', 'ekg', '心电图', 'electrocardiogram'],
|
||||||
'blood': ['blood', 'cbc', '血常规', '血液', 'bloodtest'],
|
'blood': ['blood', 'cbc', '血常规', '血液', 'bloodtest'],
|
||||||
'urine': ['urine', 'ua', '尿常规', '尿液', 'urinalysis']
|
'urine': ['urine', 'ua', '尿常规', '尿液', 'urinalysis','RT','rt']
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前检查类型对应的匹配模式
|
// 获取当前检查类型对应的匹配模式
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<div class="filter-options">
|
<div class="filter-options">
|
||||||
<div class="header-title">
|
<div class="header-title">
|
||||||
人员列表
|
<span>患者列表</span>
|
||||||
<el-button
|
<el-button
|
||||||
class="refresh-btn"
|
|
||||||
:icon="Refresh"
|
|
||||||
circle
|
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleRefresh"
|
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
@click="handleRefresh"
|
||||||
|
:icon="Refresh"
|
||||||
|
>
|
||||||
|
刷新
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -130,7 +130,7 @@
|
|||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>性别:</label>
|
<label>性别:</label>
|
||||||
<span>{{ reportData.gender }}</span>
|
<span>{{ gender }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>年龄:</label>
|
<label>年龄:</label>
|
||||||
@ -303,18 +303,16 @@
|
|||||||
<div class="action-footer">
|
<div class="action-footer">
|
||||||
<div class="left-section">
|
<div class="left-section">
|
||||||
<span>检查医生:</span>
|
<span>检查医生:</span>
|
||||||
<span>{{ user?.nickname || '暂无' }}</span>
|
<span>{{ selectedPatient?.status === '1' || selectedPatient?.status === 1 ? (inspectDoctor || ' ') : ' ' }}</span>
|
||||||
<span style="margin-left: 100px;">检查日期:{{ formattedMedicalDateTime }}</span>
|
<span style="margin-left: 100px;">检查日期:{{ selectedPatient?.status === '1' || selectedPatient?.status === 1 ? (inspectTime || ' ') : ' ' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-section">
|
<div class="right-section">
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<button class="action-btn" @click="checkEditPermission">同步结果</button>
|
<button class="action-btn" @click="checkEditPermission" :disabled="isDisabled">弃检</button>
|
||||||
<button class="action-btn">报告预览</button>
|
|
||||||
<button class="action-btn" @click="checkEditPermission">弃检</button>
|
|
||||||
<button
|
<button
|
||||||
v-if="!isReadOnly"
|
|
||||||
class="action-btn primary"
|
class="action-btn primary"
|
||||||
@click="handleSaveAllResults"
|
@click="handleSaveAllResults"
|
||||||
|
:disabled="isDisabled"
|
||||||
>
|
>
|
||||||
保存所有结果
|
保存所有结果
|
||||||
</button>
|
</button>
|
||||||
@ -529,6 +527,13 @@ const getPatientList = async () => {
|
|||||||
pageSize: pageSize.value
|
pageSize: pageSize.value
|
||||||
}
|
}
|
||||||
const res = await PatientApi.getPatientPage(params)
|
const res = await PatientApi.getPatientPage(params)
|
||||||
|
|
||||||
|
// 获取患者列表后,检查每个患者的检查状态
|
||||||
|
if (res.list && res.list.length > 0) {
|
||||||
|
// 可以考虑批量查询所有患者的检查项目状态
|
||||||
|
// 或者在后端接口中直接返回每个患者的检查状态
|
||||||
|
}
|
||||||
|
|
||||||
patients.value = res.list
|
patients.value = res.list
|
||||||
originalPatients.value = res.list // 保存原始列表用于搜索
|
originalPatients.value = res.list // 保存原始列表用于搜索
|
||||||
filteredPatients.value = res.list // 初始化过滤后的列表
|
filteredPatients.value = res.list // 初始化过滤后的列表
|
||||||
@ -588,7 +593,7 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改加载患者数据方法
|
// 删除原来的loadPatientData声明,只保留这一个完整的实现
|
||||||
const loadPatientData = async (patient) => {
|
const loadPatientData = async (patient) => {
|
||||||
try {
|
try {
|
||||||
// 检查缓存中是否已有数据
|
// 检查缓存中是否已有数据
|
||||||
@ -597,7 +602,10 @@ const loadPatientData = async (patient) => {
|
|||||||
const cachedData = patientDataCache.value.get(cacheKey)
|
const cachedData = patientDataCache.value.get(cacheKey)
|
||||||
reportData.value = cachedData.reportData
|
reportData.value = cachedData.reportData
|
||||||
examItems.value = cachedData.examItems
|
examItems.value = cachedData.examItems
|
||||||
|
conclusionData.value = cachedData.conclusionData
|
||||||
currentTab.value = cachedData.currentTab
|
currentTab.value = cachedData.currentTab
|
||||||
|
inspectDoctor.value = cachedData.inspectDoctor || ''
|
||||||
|
inspectTime.value = cachedData.inspectTime || ''
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,79 +617,41 @@ const loadPatientData = async (patient) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// 获取用户信息和部门ID
|
// 获取用户信息和部门ID
|
||||||
const [userProfile, patientData, itemsRes] = await Promise.all([
|
const userProfile = await getUserProfile()
|
||||||
getUserProfile(),
|
user.value = userProfile
|
||||||
PatientApi.getPatient(patient.id),
|
|
||||||
PatientitemsApi.getPatientitemsPage({
|
// 获取患者基本信息
|
||||||
|
const patientData = await PatientApi.getPatient(patient.id)
|
||||||
|
reportData.value = patientData
|
||||||
|
|
||||||
|
// 检查患者是否已有检查项目
|
||||||
|
const hasItems = await checkPatientHasItems(patient.medicalSn)
|
||||||
|
|
||||||
|
// 如果没有检查项目,自动同步
|
||||||
|
if (!hasItems) {
|
||||||
|
console.log('患者没有检查项目,自动同步')
|
||||||
|
try {
|
||||||
|
await PatientitemsApi.createPatientapiInfo({
|
||||||
|
medicalSn: patient.medicalSn
|
||||||
|
})
|
||||||
|
console.log('自动同步成功')
|
||||||
|
} catch (syncError) {
|
||||||
|
console.error('自动同步失败:', syncError)
|
||||||
|
// 同步失败不阻止后续操作
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取检查项目
|
||||||
|
const itemsRes = await PatientitemsApi.getPatientitemsPage({
|
||||||
medicalSn: patient.medicalSn,
|
medicalSn: patient.medicalSn,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100
|
pageSize: 100
|
||||||
})
|
})
|
||||||
])
|
|
||||||
|
|
||||||
user.value = userProfile
|
// 处理检查项目数据
|
||||||
|
|
||||||
// 检查用户是否属于影像科或血常规科室
|
|
||||||
isImageDepartment.value = checkIsImageDepartment(userProfile.deptId)
|
|
||||||
|
|
||||||
reportData.value = patientData
|
|
||||||
|
|
||||||
// 如果不是特殊科室,继续加载常规检查数据
|
|
||||||
if (!isImageDepartment.value && !isBloodTest.value) {
|
|
||||||
if (itemsRes.list && itemsRes.list.length > 0) {
|
if (itemsRes.list && itemsRes.list.length > 0) {
|
||||||
const itemsByCategory = {
|
// 按照类别分组
|
||||||
general: [],
|
const groupedItems = {}
|
||||||
ultrasound: [],
|
|
||||||
ecg: [],
|
|
||||||
blood: [],
|
|
||||||
urine: []
|
|
||||||
}
|
|
||||||
|
|
||||||
// 从第一个项目获取体检小结
|
|
||||||
if (itemsRes.list.length > 0) {
|
|
||||||
examConclusion.value = itemsRes.list[0].analyse || ''
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据项目名称分类
|
|
||||||
itemsRes.list.forEach(item => {
|
|
||||||
const itemName = (item.itemName || '').toLowerCase()
|
|
||||||
let category = 'general' // 默认为一般检查
|
|
||||||
|
|
||||||
if (itemName.includes('彩超') || itemName.includes('超声') || itemName.includes('b超')) {
|
|
||||||
category = 'ultrasound'
|
|
||||||
} else if (itemName.includes('心电图') || itemName.includes('ecg') || itemName.includes('ekg')) {
|
|
||||||
category = 'ecg'
|
|
||||||
} else if (itemName.includes('血常规') || itemName.includes('血细胞') || itemName.includes('血红蛋白')) {
|
|
||||||
category = 'blood'
|
|
||||||
} else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) {
|
|
||||||
category = 'urine'
|
|
||||||
}
|
|
||||||
|
|
||||||
const processedItem = {
|
|
||||||
id: item.id,
|
|
||||||
name: item.itemName,
|
|
||||||
value: item.itemResult || '',
|
|
||||||
unit: item.unit,
|
|
||||||
reference: `${item.lowValue}-${item.highValue}`,
|
|
||||||
note: getStatusNote(item),
|
|
||||||
risk: getRiskLevel(item),
|
|
||||||
status: getRowStatus(item),
|
|
||||||
positive: item.positive === '1' ? '阳性' : '阴性',
|
|
||||||
itemStatus: item.itemStatus,
|
|
||||||
examDescription: item.examDescription || '',
|
|
||||||
analyse: item.analyse || '',
|
|
||||||
sectionID: item.sectionID
|
|
||||||
}
|
|
||||||
|
|
||||||
itemsByCategory[category].push(processedItem)
|
|
||||||
})
|
|
||||||
|
|
||||||
examItems.value = itemsByCategory
|
|
||||||
|
|
||||||
// 默认选择"全部检查"标签
|
|
||||||
currentTab.value = 'all'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据不同类型的检查项目,加载对应的小结
|
// 根据不同类型的检查项目,加载对应的小结
|
||||||
const conclusions = {
|
const conclusions = {
|
||||||
@ -692,23 +662,117 @@ const loadPatientData = async (patient) => {
|
|||||||
urine: { summary: '' }
|
urine: { summary: '' }
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsRes.list.forEach(item => {
|
// 初始化检查医生和检查时间为空
|
||||||
const itemName = (item.itemName || '').toLowerCase()
|
inspectDoctor.value = ''
|
||||||
let category = 'general'
|
inspectTime.value = ''
|
||||||
|
|
||||||
if (itemName.includes('彩超') || itemName.includes('超声')) {
|
// 查找已检查的项目,获取检查医生和检查时间
|
||||||
category = 'ultrasound'
|
const checkedItems = itemsRes.list.filter(item =>
|
||||||
} else if (itemName.includes('心电图')) {
|
item.itemStatus === '1' &&
|
||||||
category = 'ecg'
|
item.sectionID === user.value.deptId
|
||||||
} else if (itemName.includes('血常规')) {
|
)
|
||||||
category = 'blood'
|
|
||||||
} else if (itemName.includes('尿常规')) {
|
if (checkedItems.length > 0) {
|
||||||
category = 'urine'
|
// 使用第一个已检查项目的检查医生和检查时间
|
||||||
|
const firstCheckedItem = checkedItems[0]
|
||||||
|
inspectDoctor.value = firstCheckedItem.inspectdoctor || ''
|
||||||
|
|
||||||
|
// 格式化检查时间
|
||||||
|
if (firstCheckedItem.inspecttime) {
|
||||||
|
const inspectDate = new Date(Number(firstCheckedItem.inspecttime))
|
||||||
|
inspectTime.value = formatDate(inspectDate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemsRes.list.forEach(item => {
|
||||||
|
// 处理项目分类
|
||||||
|
const category = getCategoryByItemName(item.itemName || '')
|
||||||
|
|
||||||
|
if (!groupedItems[category]) {
|
||||||
|
groupedItems[category] = []
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理项目数据
|
||||||
|
const processedItem = processItemData(item)
|
||||||
|
groupedItems[category].push(processedItem)
|
||||||
|
|
||||||
|
// 处理小结数据
|
||||||
|
processConclusion(item, category, conclusions)
|
||||||
|
})
|
||||||
|
|
||||||
|
examItems.value = groupedItems
|
||||||
|
conclusionData.value = conclusions
|
||||||
|
|
||||||
|
// 缓存数据
|
||||||
|
patientDataCache.value.set(cacheKey, {
|
||||||
|
reportData: { ...reportData.value },
|
||||||
|
examItems: { ...examItems.value },
|
||||||
|
conclusionData: { ...conclusionData.value },
|
||||||
|
currentTab: currentTab.value,
|
||||||
|
inspectDoctor: inspectDoctor.value,
|
||||||
|
inspectTime: inspectTime.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载患者数据失败:', error)
|
||||||
|
ElMessage.error('加载患者数据失败')
|
||||||
|
} finally {
|
||||||
|
loading.close()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载患者数据失败:', error)
|
||||||
|
ElMessage.error('加载患者数据失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助函数:根据项目名称获取分类
|
||||||
|
const getCategoryByItemName = (itemName) => {
|
||||||
|
itemName = itemName.toLowerCase()
|
||||||
|
if (itemName.includes('超声') || itemName.includes('彩超') || itemName.includes('b超')) {
|
||||||
|
return 'ultrasound'
|
||||||
|
} else if (itemName.includes('心电图') || itemName.includes('ecg') || itemName.includes('ekg')) {
|
||||||
|
return 'ecg'
|
||||||
|
} else if (itemName.includes('血常规') || itemName.includes('血细胞') || itemName.includes('血红蛋白')) {
|
||||||
|
return 'blood'
|
||||||
|
} else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) {
|
||||||
|
return 'urine'
|
||||||
|
} else {
|
||||||
|
return 'general'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助函数:处理项目数据
|
||||||
|
const processItemData = (item) => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
name: item.itemName,
|
||||||
|
code: item.itemCode,
|
||||||
|
value: item.itemResult,
|
||||||
|
originalValue: item.itemResult,
|
||||||
|
unit: item.unit,
|
||||||
|
reference: item.lowValue !== null && item.highValue !== null ?
|
||||||
|
`${item.lowValue}-${item.highValue}` : 'null-null',
|
||||||
|
status: getRowStatus(item),
|
||||||
|
risk: getRiskLevel(item),
|
||||||
|
note: getStatusNote(item),
|
||||||
|
itemStatus: item.itemStatus || '0',
|
||||||
|
sectionID: item.sectionID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助函数:处理小结数据
|
||||||
|
const processConclusion = (item, category, conclusions) => {
|
||||||
|
if (category === 'ultrasound' || category === 'ecg') {
|
||||||
|
// 处理超声和心电图的所见和结果
|
||||||
|
if (item.examDescription) {
|
||||||
|
conclusions[category].finding = item.examDescription
|
||||||
|
}
|
||||||
|
if (item.itemResult) {
|
||||||
|
conclusions[category].diagnosis = item.itemResult
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果有analyse字段,尝试从中解析检查所见和结果
|
||||||
if (item.analyse) {
|
if (item.analyse) {
|
||||||
if (['ultrasound', 'ecg'].includes(category)) {
|
|
||||||
// 只对超声和心电图解析检查所见和结果
|
|
||||||
const parts = item.analyse.split('\n')
|
const parts = item.analyse.split('\n')
|
||||||
parts.forEach(part => {
|
parts.forEach(part => {
|
||||||
if (part.startsWith('检查所见:')) {
|
if (part.startsWith('检查所见:')) {
|
||||||
@ -717,28 +781,13 @@ const loadPatientData = async (patient) => {
|
|||||||
conclusions[category].diagnosis = part.replace('检查结果:', '')
|
conclusions[category].diagnosis = part.replace('检查结果:', '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 处理其他类型的小结 - 只使用analyse字段
|
||||||
|
if (item.analyse) {
|
||||||
conclusions[category].summary = item.analyse
|
conclusions[category].summary = item.analyse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
conclusionData.value = conclusions
|
|
||||||
|
|
||||||
patientDataCache.value.set(cacheKey, {
|
|
||||||
reportData: { ...reportData.value },
|
|
||||||
examItems: { ...examItems.value },
|
|
||||||
currentTab: currentTab.value
|
|
||||||
})
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
loading.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取患者详细信息出错:', error)
|
|
||||||
ElMessage.error('获取患者详细信息失败')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改检查是否为影像科的函数
|
// 修改检查是否为影像科的函数
|
||||||
@ -864,6 +913,44 @@ try {
|
|||||||
// 如果有体检编号,获取体检项目数据
|
// 如果有体检编号,获取体检项目数据
|
||||||
if (patient.medicalSn) {
|
if (patient.medicalSn) {
|
||||||
await getpatientitemData(patient.medicalSn)
|
await getpatientitemData(patient.medicalSn)
|
||||||
|
|
||||||
|
// 查询并设置检查医生和检查日期
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
medicalSn: patient.medicalSn,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100
|
||||||
|
}
|
||||||
|
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 || item.sectionID == user.value.deptId)
|
||||||
|
)
|
||||||
|
|
||||||
|
if (checkedItems.length > 0) {
|
||||||
|
// 使用第一个已检查项目的检查医生和检查时间
|
||||||
|
const firstCheckedItem = checkedItems[0]
|
||||||
|
inspectDoctor.value = firstCheckedItem.inspectdoctor || ''
|
||||||
|
|
||||||
|
// 格式化检查时间
|
||||||
|
if (firstCheckedItem.inspecttime) {
|
||||||
|
const inspectDate = new Date(Number(firstCheckedItem.inspecttime))
|
||||||
|
inspectTime.value = formatDate(inspectDate)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 如果没有已检查项目,则清空检查医生和检查时间
|
||||||
|
inspectDoctor.value = ''
|
||||||
|
inspectTime.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取检查医生和检查日期失败:', error)
|
||||||
|
inspectDoctor.value = ''
|
||||||
|
inspectTime.value = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保切换完数据后,标签页仍然是一般检查
|
// 确保切换完数据后,标签页仍然是一般检查
|
||||||
@ -877,14 +964,6 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加判断是否为特殊检查的计算属性
|
|
||||||
const isSpecialExam = computed(() => {
|
|
||||||
if (!selectedPatient.value || !currentTab.value) return false
|
|
||||||
|
|
||||||
// 检查当前标签是否为特殊检查类型
|
|
||||||
return ['ultrasound', 'ecg', 'blood', 'urine'].includes(currentTab.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 清理页面状态
|
// 清理页面状态
|
||||||
patients.value = []
|
patients.value = []
|
||||||
@ -1062,10 +1141,18 @@ return date.toLocaleDateString('zh-CN', {
|
|||||||
|
|
||||||
// 修改年龄计算属性
|
// 修改年龄计算属性
|
||||||
const age = computed(() => {
|
const age = computed(() => {
|
||||||
if (!reportData.value.birthday) return ''
|
if (!reportData.value.cardId) return ''
|
||||||
|
|
||||||
// 处理 YYYY-MM-DD 格式的生日
|
// 从身份证号提取出生日期
|
||||||
const birthDate = new Date(reportData.value.birthday)
|
const idCard = reportData.value.cardId
|
||||||
|
if (idCard.length !== 18) return '' // 确保是18位身份证
|
||||||
|
|
||||||
|
// 提取出生年月日 (格式为 YYYYMMDD)
|
||||||
|
const birthYear = idCard.substring(6, 10)
|
||||||
|
const birthMonth = idCard.substring(10, 12)
|
||||||
|
const birthDay = idCard.substring(12, 14)
|
||||||
|
|
||||||
|
const birthDate = new Date(`${birthYear}-${birthMonth}-${birthDay}`)
|
||||||
if (isNaN(birthDate.getTime())) return '' // 日期无效时返回空字符串
|
if (isNaN(birthDate.getTime())) return '' // 日期无效时返回空字符串
|
||||||
|
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
@ -1080,17 +1167,25 @@ if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate()))
|
|||||||
return age
|
return age
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 添加性别计算属性
|
||||||
|
const gender = computed(() => {
|
||||||
|
if (!reportData.value.cardId) return reportData.value.gender || ''
|
||||||
|
|
||||||
|
// 从身份证号提取性别信息
|
||||||
|
const idCard = reportData.value.cardId
|
||||||
|
if (idCard.length !== 18) return reportData.value.gender || '' // 确保是18位身份证
|
||||||
|
|
||||||
|
// 身份证第17位,奇数为男,偶数为女
|
||||||
|
const genderCode = parseInt(idCard.charAt(16))
|
||||||
|
return genderCode % 2 === 1 ? '男' : '女'
|
||||||
|
})
|
||||||
|
|
||||||
// 添加选中患者的状态
|
// 添加选中患者的状态
|
||||||
const selectedPatient = ref(null)
|
const selectedPatient = ref(null)
|
||||||
|
|
||||||
// 添加用户信息的响应式引用
|
// 添加用户信息的响应式引用
|
||||||
const user = ref(null)
|
const user = ref(null)
|
||||||
|
|
||||||
// 加载数据
|
|
||||||
const loadData = async () => {
|
|
||||||
reportData.value = await PatientApi.getPatient(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加计算属性检查是否所有项目都已完成
|
// 添加计算属性检查是否所有项目都已完成
|
||||||
const isAllItemsChecked = computed(() => {
|
const isAllItemsChecked = computed(() => {
|
||||||
if (!sortedExamItems.value || sortedExamItems.value.length === 0) return false
|
if (!sortedExamItems.value || sortedExamItems.value.length === 0) return false
|
||||||
@ -1099,13 +1194,159 @@ return sortedExamItems.value.every(item => item.itemStatus === '1')
|
|||||||
|
|
||||||
// 修改检查编辑权限的方法
|
// 修改检查编辑权限的方法
|
||||||
const checkEditPermission = () => {
|
const checkEditPermission = () => {
|
||||||
if (isAllItemsChecked.value) {
|
// 检查当前患者的检查状态
|
||||||
|
if (selectedPatient.value && (selectedPatient.value.status === '1' || selectedPatient.value.status === 1)) {
|
||||||
|
ElMessage.warning('该患者检查已完成,不可进行编辑')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查当前科室的检查项目是否全部完成
|
||||||
|
const currentDeptItems = Object.values(examItems.value)
|
||||||
|
.flat()
|
||||||
|
.filter(item => item.sectionID === user.value?.deptId)
|
||||||
|
|
||||||
|
if (currentDeptItems.length > 0 && currentDeptItems.every(item => item.itemStatus === '1')) {
|
||||||
ElMessage.warning('所有检查项目已完成,不可进行编辑')
|
ElMessage.warning('所有检查项目已完成,不可进行编辑')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改同步结果处理函数
|
||||||
|
const handleSyncResults = async () => {
|
||||||
|
if (!selectedPatient.value?.medicalSn) {
|
||||||
|
console.warn('未选择患者,无法同步')
|
||||||
|
ElMessage.warning('请先选择患者')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log('开始同步患者数据, 体检编号:', selectedPatient.value.medicalSn)
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '同步中...',
|
||||||
|
background: 'rgba(255, 255, 255, 0.7)'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 先查询该体检编号是否已有检查项目
|
||||||
|
const existingItems = await PatientitemsApi.getPatientitemsPage({
|
||||||
|
medicalSn: selectedPatient.value.medicalSn,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1
|
||||||
|
})
|
||||||
|
|
||||||
|
// 如果已有检查项目,则不再同步
|
||||||
|
if (existingItems.list && existingItems.list.length > 0) {
|
||||||
|
console.log('该患者已有检查项目,无需再次同步')
|
||||||
|
loading.close()
|
||||||
|
ElMessage.info('该患者已有检查项目,无需再次同步')
|
||||||
|
|
||||||
|
// 重新加载患者数据
|
||||||
|
await loadPatientData(selectedPatient.value)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用同步接口
|
||||||
|
const syncResult = await PatientitemsApi.createPatientapiInfo({
|
||||||
|
medicalSn: selectedPatient.value.medicalSn
|
||||||
|
})
|
||||||
|
console.log('同步接口调用成功:', syncResult)
|
||||||
|
|
||||||
|
// 重新加载患者数据
|
||||||
|
console.log('重新加载患者数据')
|
||||||
|
await loadPatientData(selectedPatient.value)
|
||||||
|
console.log('患者数据加载完成')
|
||||||
|
|
||||||
|
loading.close()
|
||||||
|
console.log('同步操作完成')
|
||||||
|
ElMessage.success('同步成功')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('同步失败:', error)
|
||||||
|
ElMessage.error('同步失败,请稍后重试')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改刷新处理函数
|
||||||
|
const handleRefresh = async () => {
|
||||||
|
try {
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '刷新中...',
|
||||||
|
background: 'rgba(255, 255, 255, 0.7)'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 重置日期相关状态
|
||||||
|
selectedPeriod.value = 'reset'
|
||||||
|
showDatePicker.value = false
|
||||||
|
customDateRange.value = []
|
||||||
|
|
||||||
|
// 重置搜索条件
|
||||||
|
searchQuery.value = ''
|
||||||
|
|
||||||
|
// 调用同步接口前先检查是否有新患者需要同步
|
||||||
|
try {
|
||||||
|
// 获取当前所有患者的体检编号
|
||||||
|
const existingPatients = await PatientApi.getPatientPage({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100,
|
||||||
|
examDate: formatDate(new Date())
|
||||||
|
})
|
||||||
|
|
||||||
|
const existingMedicalSns = new Set()
|
||||||
|
if (existingPatients.list && existingPatients.list.length > 0) {
|
||||||
|
existingPatients.list.forEach(patient => {
|
||||||
|
if (patient.medicalSn) {
|
||||||
|
existingMedicalSns.add(patient.medicalSn)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果没有患者或者患者数量很少,才调用全量同步
|
||||||
|
if (existingMedicalSns.size < 5) {
|
||||||
|
// 修改:传递空对象而不是空参数,避免后端解析错误
|
||||||
|
await PatientitemsApi.createPatientapiInfo({})
|
||||||
|
} else {
|
||||||
|
ElMessage.info('已有足够的患者数据,跳过全量同步')
|
||||||
|
}
|
||||||
|
} catch (syncError) {
|
||||||
|
console.error('同步数据失败:', syncError)
|
||||||
|
// 同步失败不阻止后续操作
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置选中状态
|
||||||
|
selectedPatient.value = null
|
||||||
|
|
||||||
|
// 重置页码
|
||||||
|
pageNo.value = 1
|
||||||
|
|
||||||
|
// 重新获取患者列表
|
||||||
|
await getPatientList()
|
||||||
|
|
||||||
|
loading.close()
|
||||||
|
ElMessage.success('刷新成功')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('刷新失败:', error)
|
||||||
|
ElMessage.error('刷新失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加一个新方法,用于检查患者是否已有检查项目
|
||||||
|
const checkPatientHasItems = async (medicalSn) => {
|
||||||
|
try {
|
||||||
|
const existingItems = await PatientitemsApi.getPatientitemsPage({
|
||||||
|
medicalSn: medicalSn,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1
|
||||||
|
})
|
||||||
|
|
||||||
|
return existingItems.list && existingItems.list.length > 0
|
||||||
|
} catch (error) {
|
||||||
|
console.error('检查患者检查项目失败:', error)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 修改结果变化处理函数
|
// 修改结果变化处理函数
|
||||||
const handleResultChange = (item) => {
|
const handleResultChange = (item) => {
|
||||||
if (!checkEditPermission()) {
|
if (!checkEditPermission()) {
|
||||||
@ -1172,14 +1413,26 @@ switch (type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加禁用状态的计算属性,用于控制界面元素
|
// 修改禁用状态的计算属性
|
||||||
const isDisabled = computed(() => {
|
const isDisabled = computed(() => {
|
||||||
return isAllItemsChecked.value
|
// 如果患者状态为已检查,则禁用
|
||||||
|
if (selectedPatient.value?.status === '1' || selectedPatient.value?.status === 1) return true
|
||||||
|
|
||||||
|
// 检查当前科室的检查项目是否全部完成
|
||||||
|
const currentDeptItems = Object.values(examItems.value)
|
||||||
|
.flat()
|
||||||
|
.filter(item => item.sectionID === user.value?.deptId)
|
||||||
|
|
||||||
|
if (currentDeptItems.length > 0 && currentDeptItems.every(item => item.itemStatus === '1')) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 添加只读状态的计算属性
|
// 修改只读状态的计算属性
|
||||||
const isReadOnly = computed(() => {
|
const isReadOnly = computed(() => {
|
||||||
return isAllItemsChecked.value
|
return isDisabled.value
|
||||||
})
|
})
|
||||||
|
|
||||||
// 修改分页处理函数
|
// 修改分页处理函数
|
||||||
@ -1241,20 +1494,10 @@ return allChecked ? '1' : '0'
|
|||||||
|
|
||||||
// 修改获取状态文本的方法
|
// 修改获取状态文本的方法
|
||||||
const getStatusText = (patient) => {
|
const getStatusText = (patient) => {
|
||||||
if (patient.examStatus === '1') {
|
// 直接使用数据库中的 status 字段判断
|
||||||
|
if (patient.status === '1' || patient.status === 1) {
|
||||||
return '已检查'
|
return '已检查'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedPatient.value?.id === patient.id) {
|
|
||||||
const currentDeptItems = Object.values(examItems.value)
|
|
||||||
.flat()
|
|
||||||
.filter(item => item.sectionID === user.value?.deptId)
|
|
||||||
|
|
||||||
if (currentDeptItems.length > 0 && currentDeptItems.every(item => item.itemStatus === '1')) {
|
|
||||||
return '已检查'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '待检查'
|
return '待检查'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1307,32 +1550,6 @@ const formatDate = (date) => {
|
|||||||
return `${year}-${month}-${day}`
|
return `${year}-${month}-${day}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改刷新处理函数
|
|
||||||
const handleRefresh = async () => {
|
|
||||||
try {
|
|
||||||
// 重置日期相关状态
|
|
||||||
selectedPeriod.value = 'reset'
|
|
||||||
showDatePicker.value = false
|
|
||||||
customDateRange.value = []
|
|
||||||
|
|
||||||
// 重置搜索条件
|
|
||||||
searchQuery.value = ''
|
|
||||||
|
|
||||||
// 重置选中状态
|
|
||||||
selectedPatient.value = null
|
|
||||||
|
|
||||||
// 重置页码
|
|
||||||
pageNo.value = 1
|
|
||||||
|
|
||||||
// 重新获取患者列表
|
|
||||||
await getPatientList()
|
|
||||||
ElMessage.success('刷新成功')
|
|
||||||
} catch (error) {
|
|
||||||
console.error('刷新失败:', error)
|
|
||||||
ElMessage.error('刷新失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改验证方法,只验证四个标签页的内容
|
// 修改验证方法,只验证四个标签页的内容
|
||||||
const validateAllResults = () => {
|
const validateAllResults = () => {
|
||||||
const errors = []
|
const errors = []
|
||||||
@ -1385,7 +1602,7 @@ const validateAllResults = () => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改统一保存方法
|
// 修改统一保存方法,更新检查医生和检查日期
|
||||||
const handleSaveAllResults = async () => {
|
const handleSaveAllResults = async () => {
|
||||||
if (!checkEditPermission()) return
|
if (!checkEditPermission()) return
|
||||||
|
|
||||||
@ -1400,62 +1617,68 @@ const handleSaveAllResults = async () => {
|
|||||||
// 收集所有标签页的所有检查项目
|
// 收集所有标签页的所有检查项目
|
||||||
let allUpdatedItems = []
|
let allUpdatedItems = []
|
||||||
|
|
||||||
// 添加控制台输出,检查当前数据
|
|
||||||
console.log('当前标签页:', currentTab.value)
|
|
||||||
console.log('结论数据:', conclusionData.value)
|
|
||||||
console.log('当前检查项目:', currentExamItems.value)
|
|
||||||
|
|
||||||
// 遍历所有检查项目
|
// 遍历所有检查项目
|
||||||
Object.keys(examItems.value).forEach(tabKey => {
|
Object.keys(examItems.value).forEach(tabKey => {
|
||||||
const items = examItems.value[tabKey] || []
|
const items = examItems.value[tabKey] || []
|
||||||
|
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const itemName = (item.name || '').toLowerCase()
|
const itemName = (item.name || '').toLowerCase()
|
||||||
console.log('处理项目:', item.name, '项目ID:', item.id, '标签页:', tabKey)
|
|
||||||
|
|
||||||
// 基础字段
|
// 基础字段
|
||||||
const baseFields = {
|
const baseFields = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
medicalSn: selectedPatient.value?.medicalSn,
|
medicalSn: selectedPatient.value?.medicalSn,
|
||||||
itemStatus: item.itemStatus || '1',
|
itemStatus: '1', // 设置为已检查状态
|
||||||
inspectdoctor: user.value?.nickname || '',
|
inspectdoctor: user.value?.nickname || '',
|
||||||
inspecttime: currentTimestamp,
|
inspecttime: currentTimestamp,
|
||||||
sectionID: user.value?.deptId
|
sectionID: user.value?.deptId
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据项目类型处理不同的字段
|
// 根据项目类型处理不同的字段
|
||||||
if (itemName.includes('超声') || itemName.includes('彩超')) {
|
if (itemName.includes('超声') || itemName.includes('彩超') || itemName.includes('b超')) {
|
||||||
console.log('超声项目:', item.name, '所见:', conclusionData.value.ultrasound?.finding, '结果:', conclusionData.value.ultrasound?.diagnosis)
|
const finding = conclusionData.value.ultrasound?.finding?.trim() || ''
|
||||||
|
const diagnosis = conclusionData.value.ultrasound?.diagnosis?.trim() || ''
|
||||||
|
// 拼接成指定格式的字符串保存到analyse字段
|
||||||
|
const analyseContent = `检查所见:${finding}\n检查结果:${diagnosis}`
|
||||||
|
|
||||||
allUpdatedItems.push({
|
allUpdatedItems.push({
|
||||||
...baseFields,
|
...baseFields,
|
||||||
examDescription: conclusionData.value.ultrasound?.finding?.trim() || '',
|
examDescription: finding,
|
||||||
itemResult: conclusionData.value.ultrasound?.diagnosis?.trim() || ''
|
itemResult: diagnosis,
|
||||||
|
analyse: analyseContent
|
||||||
})
|
})
|
||||||
} else if (itemName.includes('心电图')) {
|
} else if (itemName.includes('心电图') || itemName.includes('ecg') || itemName.includes('ekg')) {
|
||||||
console.log('心电图项目:', item.name, '所见:', conclusionData.value.ecg?.finding, '结果:', conclusionData.value.ecg?.diagnosis)
|
const finding = conclusionData.value.ecg?.finding?.trim() || ''
|
||||||
|
const diagnosis = conclusionData.value.ecg?.diagnosis?.trim() || ''
|
||||||
|
// 拼接成指定格式的字符串保存到analyse字段
|
||||||
|
const analyseContent = `检查所见:${finding}\n检查结果:${diagnosis}`
|
||||||
|
|
||||||
allUpdatedItems.push({
|
allUpdatedItems.push({
|
||||||
...baseFields,
|
...baseFields,
|
||||||
examDescription: conclusionData.value.ecg?.finding?.trim() || '',
|
examDescription: finding,
|
||||||
itemResult: conclusionData.value.ecg?.diagnosis?.trim() || ''
|
itemResult: diagnosis,
|
||||||
|
analyse: analyseContent
|
||||||
})
|
})
|
||||||
} else if (itemName.includes('血常规')) {
|
} else if (itemName.includes('血常规') || itemName.includes('血细胞') || itemName.includes('血红蛋白')) {
|
||||||
console.log('血常规项目:', item.name, '小结:', conclusionData.value.blood?.summary)
|
|
||||||
allUpdatedItems.push({
|
allUpdatedItems.push({
|
||||||
...baseFields,
|
...baseFields,
|
||||||
itemResult: conclusionData.value.blood?.summary?.trim() || ''
|
analyse: conclusionData.value.blood?.summary?.trim() || '' // 只将小结保存到analyse字段
|
||||||
})
|
})
|
||||||
} else if (itemName.includes('尿常规')) {
|
} else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) {
|
||||||
console.log('尿常规项目:', item.name, '小结:', conclusionData.value.urine?.summary)
|
|
||||||
allUpdatedItems.push({
|
allUpdatedItems.push({
|
||||||
...baseFields,
|
...baseFields,
|
||||||
itemResult: conclusionData.value.urine?.summary?.trim() || ''
|
analyse: conclusionData.value.urine?.summary?.trim() || '' // 只将小结保存到analyse字段
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 一般检查项目
|
||||||
|
allUpdatedItems.push({
|
||||||
|
...baseFields,
|
||||||
|
analyse: conclusionData.value.general?.summary?.trim() || '' // 只将小结保存到analyse字段
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('最终要更新的项目:', allUpdatedItems)
|
|
||||||
|
|
||||||
if (allUpdatedItems.length === 0) {
|
if (allUpdatedItems.length === 0) {
|
||||||
ElMessage.warning('没有需要保存的检查项目')
|
ElMessage.warning('没有需要保存的检查项目')
|
||||||
return
|
return
|
||||||
@ -1463,20 +1686,70 @@ const handleSaveAllResults = async () => {
|
|||||||
|
|
||||||
// 批量更新所有检查项目
|
// 批量更新所有检查项目
|
||||||
await PatientitemsApi.updatePatientitemsBatch(allUpdatedItems)
|
await PatientitemsApi.updatePatientitemsBatch(allUpdatedItems)
|
||||||
|
|
||||||
|
// 更新检查医生和检查日期
|
||||||
|
inspectDoctor.value = user.value?.nickname || ''
|
||||||
|
inspectTime.value = formatDate(new Date())
|
||||||
|
|
||||||
|
// 更新患者状态为已检查 - 调用更新患者状态的API
|
||||||
|
if (selectedPatient.value) {
|
||||||
|
// 更新数据库中的status字段为1
|
||||||
|
await PatientApi.updatePatient({
|
||||||
|
id: selectedPatient.value.id,
|
||||||
|
status: 1 // 设置为已检查状态
|
||||||
|
})
|
||||||
|
|
||||||
|
// 更新本地状态
|
||||||
|
selectedPatient.value.status = 1
|
||||||
|
|
||||||
|
// 更新列表中的患者状态
|
||||||
|
const patientIndex = patients.value.findIndex(p => p.id === selectedPatient.value.id)
|
||||||
|
if (patientIndex !== -1) {
|
||||||
|
patients.value[patientIndex].status = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新过滤后的列表中的患者状态
|
||||||
|
const filteredIndex = filteredPatients.value.findIndex(p => p.id === selectedPatient.value.id)
|
||||||
|
if (filteredIndex !== -1) {
|
||||||
|
filteredPatients.value[filteredIndex].status = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ElMessage.success('所有检查结果保存成功')
|
ElMessage.success('所有检查结果保存成功')
|
||||||
|
|
||||||
// 重新加载数据以更新界面
|
// 重新加载数据以更新界面
|
||||||
await refreshExamData()
|
await refreshExamData()
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('保存失败:', error)
|
|
||||||
ElMessage.error(`保存失败: ${error.message || '请检查数据是否完整'}`)
|
ElMessage.error(`保存失败: ${error.message || '请检查数据是否完整'}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加刷新数据的方法
|
// 修改刷新数据的方法,确保正确更新检查状态
|
||||||
const refreshExamData = async () => {
|
const refreshExamData = async () => {
|
||||||
try {
|
try {
|
||||||
|
// 重新获取患者信息以更新状态
|
||||||
|
if (selectedPatient.value) {
|
||||||
|
const updatedPatient = await PatientApi.getPatient(selectedPatient.value.id)
|
||||||
|
if (updatedPatient) {
|
||||||
|
// 更新选中患者的状态
|
||||||
|
selectedPatient.value = updatedPatient
|
||||||
|
|
||||||
|
// 更新列表中的患者状态
|
||||||
|
const patientIndex = patients.value.findIndex(p => p.id === selectedPatient.value.id)
|
||||||
|
if (patientIndex !== -1) {
|
||||||
|
patients.value[patientIndex] = updatedPatient
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新过滤后的列表中的患者状态
|
||||||
|
const filteredIndex = filteredPatients.value.findIndex(p => p.id === selectedPatient.value.id)
|
||||||
|
if (filteredIndex !== -1) {
|
||||||
|
filteredPatients.value[filteredIndex] = updatedPatient
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取检查项目数据
|
||||||
const params = {
|
const params = {
|
||||||
medicalSn: selectedPatient.value?.medicalSn,
|
medicalSn: selectedPatient.value?.medicalSn,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -1487,35 +1760,17 @@ const refreshExamData = async () => {
|
|||||||
|
|
||||||
if (itemsRes.list && itemsRes.list.length > 0) {
|
if (itemsRes.list && itemsRes.list.length > 0) {
|
||||||
// 更新检查项目数据
|
// 更新检查项目数据
|
||||||
const currentDeptItems = itemsRes.list.filter(item =>
|
// ... 现有的检查项目更新逻辑 ...
|
||||||
item.sectionID === user.value?.deptId
|
|
||||||
)
|
|
||||||
|
|
||||||
// 更新结论数据
|
|
||||||
currentDeptItems.forEach(item => {
|
|
||||||
if (['ultrasound', 'ecg'].includes(currentTab.value)) {
|
|
||||||
conclusionData.value[currentTab.value] = {
|
|
||||||
finding: item.examDescription || '',
|
|
||||||
diagnosis: item.itemResult || ''
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
conclusionData.value[currentTab.value] = {
|
|
||||||
summary: item.itemResult || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// 更新检查状态
|
|
||||||
if (selectedPatient.value) {
|
|
||||||
const allChecked = currentDeptItems.every(item => item.itemStatus === '1')
|
|
||||||
selectedPatient.value.examStatus = allChecked ? '1' : '0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('刷新数据失败:', error)
|
console.error('刷新数据失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加检查医生和检查日期的响应式引用
|
||||||
|
const inspectDoctor = ref('')
|
||||||
|
const inspectTime = ref('')
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -2314,44 +2569,14 @@ background-color: transparent;
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 保持按钮样式正常 */
|
|
||||||
.action-btn {
|
|
||||||
padding: 6px 16px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: #40B6FF;
|
|
||||||
color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
transition: all 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn:hover {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.primary {
|
|
||||||
background: #40B6FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 只读状态的输入框样式 */
|
|
||||||
.cell-input[readonly] {
|
|
||||||
background-color: transparent;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 只读状态的文本框样式 */
|
/* 只读状态的文本框样式 */
|
||||||
.summary-textarea[readonly] {
|
.summary-textarea[readonly],
|
||||||
|
.findings-textarea[readonly],
|
||||||
|
.diagnosis-textarea[readonly] {
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 只读状态下的按钮样式 */
|
|
||||||
.view-only {
|
|
||||||
opacity: 0.7;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-content {
|
.right-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
Reference in New Issue
Block a user