汇总页面样式

This commit is contained in:
Euni4U 2025-03-19 10:02:30 +08:00
parent ceb1376b67
commit f112df95c7
2 changed files with 92 additions and 4 deletions

View File

@ -745,10 +745,42 @@
<span>填充值</span>
</div>
</div>
<div class="paragraph-group">
<p id="summary-year" style="white-space: pre-wrap;">
<span class="year-value"">
</p>
<div class="report-content">
<h2 style="text-align: center; margin-bottom: 30px;">检查结果汇总</h2>
<table class="exam-table">
<tbody>
<tr>
<td width="20%" style="font-weight: bold;">【一般检查】</td>
<td id="general-exam-summary">--</td>
</tr>
<tr>
<td style="font-weight: bold;">【超声】</td>
<td id="ultrasound-summary">
<div>检查所见:<span>--</span></div>
<div>检查结果:<span>--</span></div>
</td>
</tr>
<tr>
<td style="font-weight: bold;">【心电图】</td>
<td id="ecg-summary">
<div>检查所见:<span>--</span></div>
<div>检查结果:<span>--</span></div>
</td>
</tr>
<tr>
<td style="font-weight: bold;">【血常规】</td>
<td id="blood-summary">--</td>
</tr>
<tr>
<td style="font-weight: bold;">【尿常规】</td>
<td id="urine-summary">--</td>
</tr>
<tr>
<td style="font-weight: bold;">【生化】</td>
<td id="biochem-summary">--</td>
</tr>
</tbody>
</table>
</div>
<div class="report-footer">
<p class="report-footer-text">定期体检,尊享健康</p>

View File

@ -113,6 +113,7 @@ const handleIframeLoad = async () => {
//
const phoneContent = doc.querySelector('.person_detail:nth-child(5) .person_content')
if (phoneContent) phoneContent.textContent = reportData.phone || '--'
console.log('已更新联系电话:', reportData.phone)
//
const examDateContent = doc.querySelector('.person_detail:nth-child(6) .person_content')
@ -296,6 +297,61 @@ const handleIframeLoad = async () => {
summaryElement.textContent = reportData.summaryResult || '--'
}
//
//
const generalExamSummary = doc.getElementById('general-exam-summary')
if (generalExamSummary) {
//
const firstGeneralItem = reportData.data.find(item =>
item.itemName === '身高' || item.itemName === '体温' || item.itemName === '体重'
)
generalExamSummary.textContent = firstGeneralItem?.analyse || '--'
}
//
const ultrasoundSummary = doc.getElementById('ultrasound-summary')
if (ultrasoundSummary && ultrasoundData) {
const findings = ultrasoundData.analyse?.split('\n')[0]?.replace('检查所见:', '') || '--'
const conclusion = ultrasoundData.analyse?.split('\n')[1]?.replace('检查结果:', '') || '--'
ultrasoundSummary.innerHTML = `
<div>检查所见<span>${findings}</span></div>
<div>检查结果<span>${conclusion}</span></div>
`
}
//
const ecgSummary = doc.getElementById('ecg-summary')
if (ecgSummary && ecgData) {
const findings = ecgData.analyse?.split('\n')[0]?.replace('检查所见:', '') || '--'
const conclusion = ecgData.analyse?.split('\n')[1]?.replace('检查结果:', '') || '--'
ecgSummary.innerHTML = `
<div>检查所见<span>${findings}</span></div>
<div>检查结果<span>${conclusion}</span></div>
`
}
//
const bloodSummary = doc.getElementById('blood-summary')
if (bloodSummary) {
bloodSummary.textContent = bloodData?.analyse || '--'
}
// 尿
const urineSummary = doc.getElementById('urine-summary')
if (urineSummary) {
urineSummary.textContent = urineData?.analyse || '--'
}
//
const biochemSummary = doc.getElementById('biochem-summary')
if (biochemSummary) {
biochemSummary.textContent = biochemData?.analyse || '--'
}
// PDF
reportData.data.forEach((item) => {
if (item.data) {