修改报告

This commit is contained in:
lxd 2025-03-17 18:02:47 +08:00
parent 588aae3c00
commit 0a860f7418
2 changed files with 68 additions and 19 deletions

View File

@ -553,7 +553,11 @@
<div class="report-container">
<!-- 添加首页 -->
<div class="report-item" style="width: 800px;height: 1123px;margin:0 auto;position: relative;">
<div class="report-title">体检编号:--</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>体检编号:--</span>
</div>
</div>
<div class="repott_concent">
<div class="repott_concent_area">
<div class="repott_concent_title">健康</div>
@ -593,10 +597,15 @@
<div class="page-number" >第1页</div>
</div>
</div>
<p> </p>
</br>
<!-- 前言 -->
<div class="report-item" style="width: 800px;height: 1123px;margin:0 auto;position: relative;">
<div class="report-title">前言</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>前言</span>
<span>填充值</span>
</div>
</div>
<div class="repott_concent">
<div class="content">
<p class="greeting">尊敬的<span class="underline">________</span>先生/女士:</p>
@ -615,13 +624,13 @@
<div class="footer">
<p class="hospital-name" style="text-align: right;">乌兰察布第四医院</p>
<p class="slogan" style="text-align: right;">定期体检,尊享健康</p>
<p class="slogan" style="text-align: right;">定期体检,尊享健康</p>
</div>
</div>
</div>
<div class="report-footer">
<p class="report-footer-text">体检是健康的定投。</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第2页</div>
@ -630,7 +639,12 @@
<p> </p>
<!-- 一般检查部分 -->
<div class="report-item general-exam">
<div class="report-title">一般检查</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>一般检查</span>
<span>填充值</span>
</div>
</div>
<div class="report-content">
<table class="exam-table">
<thead>
@ -680,7 +694,7 @@
<p>--</p>
</div>
<div class="report-footer">
<p class="report-footer-text">体检是健康的定投。</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第3页</div>
@ -688,7 +702,12 @@
<!-- 超声检查报告 -->
<div class="report-item ultrasound-exam">
<div class="report-title">超声检查报告</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>超声检查报告</span>
<span class="report-number">填充值</span>
</div>
</div>
<div class="report-content">
<!-- 屏幕查看时显示PDF -->
<div class="screen-only">
@ -713,7 +732,7 @@
</p>
</div>
<div class="report-footer">
<p class="report-footer-text">体检是健康的定投。</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第4页</div>
@ -721,7 +740,12 @@
<!-- 尿常规检查报告 -->
<div class="report-item">
<div class="report-title">尿常规检查报告</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>尿常规检查报告</span>
<span class="report-number">填充值</span>
</div>
</div>
<div class="report-content">
<!-- 屏幕查看时显示PDF -->
<div class="screen-only">
@ -740,7 +764,7 @@
<p>--</p>
</div>
<div class="report-footer">
<p class="report-footer-text">定期体检,尊享健康</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第5页</div>
@ -748,7 +772,12 @@
<!-- 生化检查报告 -->
<div class="report-item">
<div class="report-title">生化检查报告</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>生化检查报告</span>
<span class="report-number">填充值</span>
</div>
</div>
<div class="report-content">
<!-- 屏幕查看时显示PDF -->
<div class="screen-only">
@ -767,7 +796,7 @@
<p>--</p>
</div>
<div class="report-footer">
<p class="report-footer-text">定期体检,尊享健康</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第6页</div>
@ -775,7 +804,12 @@
<!-- 血常规检查报告 -->
<div class="report-item">
<div class="report-title">血常规检查报告</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>血常规检查报告</span>
<span class="report-number">填充值</span>
</div>
</div>
<div class="report-content">
<!-- 屏幕查看时显示PDF -->
<div class="screen-only">
@ -794,7 +828,7 @@
<p>--</p>
</div>
<div class="report-footer">
<p class="report-footer-text">定期体检,尊享健康</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第7页</div>
@ -802,7 +836,12 @@
<!-- 心电图检查报告 -->
<div class="report-item">
<div class="report-title">心电图检查报告</div>
<div class="report-title">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>心电图检查报告</span>
<span class="report-number">填充值</span>
</div>
</div>
<div class="report-content">
<img src="" alt="心电图检查">
</div>
@ -815,7 +854,7 @@
</p>
</div>
<div class="report-footer">
<p class="report-footer-text">定期体检,尊享健康</p>
<p class="report-footer-text">定期体检,尊享健康</p>
</div>
<!-- 添加页码 -->
<div class="page-number">第8页</div>

View File

@ -212,6 +212,16 @@ const handleIframeLoad = async () => {
}
}
// span
const reportTitles = doc.querySelectorAll('.report-title > div > span:nth-child(2)');
//
reportTitles.forEach(span => {
span.textContent = `体检编号:${reportData.medicalSn || '--'}`+`姓名:${reportData.pName || '--'}`;
});
//
const ecgData = reportData.data.find(item => item.type === 'ecg');
if (ecgData) {
@ -251,9 +261,8 @@ const handleIframeLoad = async () => {
if (reportTitle) {
const reportSection = Array.from(doc.querySelectorAll('.report-item')).find(section => {
const titleElement = section.querySelector('.report-title');
return titleElement && titleElement.textContent.trim() === reportTitle;
return titleElement && titleElement.textContent?.trim().includes(reportTitle);
});
if (reportSection) {
// PDF URL
const pdfUrl = item.data + '#toolbar=0&navpanes=0&view=Fit';
@ -282,6 +291,7 @@ const handleIframeLoad = async () => {
}
}
const handlePrint = () => {
const iframe = document.querySelector('iframe')
if (iframe && iframe.contentWindow) {