修改检验科小结部分
This commit is contained in:
parent
4f28a5e5a2
commit
2e768d650b
@ -12,7 +12,7 @@
|
||||
<div class="iframe-container">
|
||||
<iframe
|
||||
v-if="dialogVisible"
|
||||
src="\inspect\templates\report-template.html"
|
||||
src="\templates\report-template.html"
|
||||
frameborder="0"
|
||||
style="width: 100%; height: 100%; border: none"
|
||||
@load="handleIframeLoad"
|
||||
@ -182,18 +182,46 @@ const handleIframeLoad = async () => {
|
||||
}
|
||||
|
||||
// 更新超声检查报告
|
||||
const ultrasoundData = reportData.data.find((item) => item.itemName === 'US')
|
||||
const ultrasoundData = reportData.data.find((item) => item.itemName === '超声' || item.itemName === 'US')
|
||||
console.log('超声检查数据:', ultrasoundData)
|
||||
if (ultrasoundData) {
|
||||
const ultrasoundSummary = doc.querySelector('.ultrasound-exam .report-summary')
|
||||
// 更新超声检查报告内容
|
||||
const ultrasoundSummary = doc.querySelector('.report-item.ultrasound-exam .report-summary')
|
||||
if (ultrasoundSummary) {
|
||||
// 解析 analyse 字段(格式:"检查所见:xxx\n检查结果:xxx")
|
||||
const findings = ultrasoundData.analyse?.split('\n')[0]?.replace('检查所见:', '') || ''
|
||||
const conclusion = ultrasoundData.analyse?.split('\n')[1]?.replace('检查结果:', '') || ''
|
||||
const findings = ultrasoundData.analyse.split('\n')[0].replace('检查所见:', '') || ''
|
||||
const conclusion = ultrasoundData.analyse.split('\n')[1].replace('检查结果:', '') || ''
|
||||
|
||||
ultrasoundSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${findings}</p>
|
||||
<p><strong>【所得】</strong><br>${conclusion}</p>
|
||||
`
|
||||
} else {
|
||||
console.error('未找到超声检查小结元素')
|
||||
}
|
||||
|
||||
// 更新超声检查PDF链接
|
||||
if (ultrasoundData.data) {
|
||||
// 为PDF URL添加参数
|
||||
const pdfUrl = ultrasoundData.data + '#toolbar=0&navpanes=0&view=Fit'
|
||||
|
||||
// 更新屏幕显示的iframe
|
||||
const iframeElement = doc.querySelector('.ultrasound-exam .screen-only iframe')
|
||||
if (iframeElement) {
|
||||
console.log('设置超声检查iframe src:', pdfUrl)
|
||||
iframeElement.src = pdfUrl
|
||||
} else {
|
||||
console.error('未找到超声检查iframe元素')
|
||||
}
|
||||
|
||||
// 更新打印用的PDF容器
|
||||
const pdfContainer = doc.querySelector('.ultrasound-exam .print-only.pdf-container')
|
||||
if (pdfContainer) {
|
||||
console.log('设置超声检查PDF容器URL:', pdfUrl)
|
||||
pdfContainer.setAttribute('data-pdf-url', pdfUrl)
|
||||
} else {
|
||||
console.error('未找到超声检查PDF容器')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,27 +229,34 @@ const handleIframeLoad = async () => {
|
||||
// 尿常规
|
||||
const urineData = reportData.data.find((item) => item.itemName === '尿常规')
|
||||
if (urineData) {
|
||||
const urineSummary = doc.querySelector('.report-item:nth-of-type(3) .report-summary p')
|
||||
const urineSummary = doc.querySelector('.report-item:nth-of-type(6) .report-summary p')
|
||||
if (urineSummary) {
|
||||
urineSummary.textContent = urineData.analyse || '暂无小结'
|
||||
}
|
||||
}
|
||||
|
||||
// 生化检查
|
||||
const biochemData = reportData.data.find((item) => item.itemName === '生化检查')
|
||||
// 更新生化检查
|
||||
const biochemData = reportData.data.find((item) => item.itemName === '生化')
|
||||
console.log('生化检查数据:', biochemData)
|
||||
if (biochemData) {
|
||||
const biochemSummary = doc.querySelector('.report-item:nth-of-type(4) .report-summary p')
|
||||
// 改为第7个report-item(原4→7)
|
||||
const biochemSummary = doc.querySelector('.report-item:nth-of-type(7) .report-summary p')
|
||||
if (biochemSummary) {
|
||||
biochemSummary.textContent = biochemData.analyse || '暂无小结'
|
||||
} else {
|
||||
console.error('未找到生化检查小结元素')
|
||||
}
|
||||
}
|
||||
|
||||
// 血常规
|
||||
// 更新血常规
|
||||
const bloodData = reportData.data.find((item) => item.itemName === '血常规')
|
||||
if (bloodData) {
|
||||
const bloodSummary = doc.querySelector('.report-item:nth-of-type(5) .report-summary p')
|
||||
// 改为第8个report-item(原5→8)
|
||||
const bloodSummary = doc.querySelector('.report-item:nth-of-type(8) .report-summary p')
|
||||
if (bloodSummary) {
|
||||
bloodSummary.textContent = bloodData.analyse || '暂无小结'
|
||||
} else {
|
||||
console.error('未找到血常规小结元素')
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,15 +271,18 @@ const handleIframeLoad = async () => {
|
||||
`${age || '--'}岁`
|
||||
})
|
||||
|
||||
// 心电图
|
||||
// 更新心电图
|
||||
const ecgData = reportData.data.find((item) => item.itemName === '心电图')
|
||||
if (ecgData) {
|
||||
const ecgSummary = doc.querySelector('.report-item:last-child .report-summary')
|
||||
// 改为第9个report-item(原last-child→9)
|
||||
const ecgSummary = doc.querySelector('.report-item:nth-of-type(9) .report-summary')
|
||||
if (ecgSummary) {
|
||||
ecgSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${ecgData.examDescription || ''}</p>
|
||||
<p><strong>【所得】</strong><br>${ecgData.analyse || ''}</p>
|
||||
<p><strong>【所见】</strong><br>${ecgData.analyse.split('\n')[0].replace('检查所见:', '') || ''}</p>
|
||||
<p><strong>【所得】</strong><br>${ecgData.analyse.split('\n')[1].replace('检查结果:', '') || ''}</p>
|
||||
`
|
||||
} else {
|
||||
console.error('未找到心电图小结元素')
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user