From 03c8a05b2125f67e6fd2fcfbdb276b8de9d44d31 Mon Sep 17 00:00:00 2001
From: Euni4U <958079825@qq.com>
Date: Thu, 3 Apr 2025 17:27:34 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=90=8D=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/templates/report-template.html | 17 ++++++++
.../reprot-print/components/ReportPreview.vue | 43 +++++--------------
2 files changed, 27 insertions(+), 33 deletions(-)
diff --git a/public/templates/report-template.html b/public/templates/report-template.html
index ef0785e..05e0a42 100644
--- a/public/templates/report-template.html
+++ b/public/templates/report-template.html
@@ -1121,6 +1121,10 @@
+
+
主检医生:
+
![]()
+
温馨提示:本次体检未发现异常的部分,不代表完全没有潜在性疾病,如有疾病或身体不适,要立即就医。
@@ -1151,6 +1155,10 @@
+
+
主检医生:
+
![]()
+
温馨提示:本次体检未发现异常的部分,不代表完全没有潜在性疾病,如有疾病或身体不适,要立即就医。
@@ -1694,6 +1702,9 @@
document.getElementById('summary-page-2').style.display = 'none';
document.getElementById('summary-content-1').textContent = '--';
document.getElementById('summary-tip-1').style.display = '';
+ // 显示第一页的总检医生签名
+ document.getElementById('summary-doctor-name').style.display = '';
+ document.getElementById('summary-doctor-image').style.display = '';
// 更新页码
updatePageNumbers();
return;
@@ -1716,6 +1727,9 @@
document.getElementById('summary-content-1').textContent = summaryText;
document.getElementById('summary-page-2').style.display = 'none';
document.getElementById('summary-tip-1').style.display = '';
+ // 显示第一页的总检医生签名
+ document.getElementById('summary-doctor-name').style.display = '';
+ document.getElementById('summary-doctor-image').style.display = '';
// 更新页码
updatePageNumbers();
@@ -1748,6 +1762,9 @@
document.getElementById('summary-content-2').textContent = secondPageText;
document.getElementById('summary-page-2').style.display = 'block';
document.getElementById('summary-tip-1').style.display = 'none';
+ // 隐藏第一页的总检医生签名
+ document.getElementById('summary-doctor-name').style.display = 'none';
+ document.getElementById('summary-doctor-image').style.display = 'none';
// 更新页码
updatePageNumbers();
diff --git a/src/views/summary/reprot-print/components/ReportPreview.vue b/src/views/summary/reprot-print/components/ReportPreview.vue
index 075d790..b045dc4 100644
--- a/src/views/summary/reprot-print/components/ReportPreview.vue
+++ b/src/views/summary/reprot-print/components/ReportPreview.vue
@@ -128,7 +128,16 @@ const handleIframeLoad = async () => {
if (avatarImg) {
avatarImg.src = 'data:image/jpeg;base64,' + reportData.headPicUrl
}
-
+ // 更新主检医生签名
+ const summaryDoctorImage = doc.getElementById('summary-doctor-image')
+ const summaryDoctorImage2 = doc.getElementById('summary-doctor-image2')
+ if (summaryDoctorImage) {
+ summaryDoctorImage.src = reportData.sign
+ }
+ if (summaryDoctorImage2) {
+ summaryDoctorImage2.src = reportData.sign
+ }
+
// 更新前言中的姓名 - 修复选择器
const prefaceGreeting = doc.querySelector('.preface-greeting .underline')
if (prefaceGreeting) {
@@ -281,7 +290,6 @@ const handleIframeLoad = async () => {
}
if (biochemSummaryContent) {
- console.log(biochemData.analyse)
biochemSummaryContent.textContent = biochemData.analyse || ''
} else {
console.error('找不到生化小结元素')
@@ -437,37 +445,6 @@ const handleIframeLoad = async () => {
}
}
-// 修改等待渲染完成的函数,添加更多检查和日志
-const waitForAllPDFsRendered = () => {
- return new Promise((resolve) => {
- const checkRendering = () => {
- const containers = document.querySelectorAll('.pdf-container')
- let allDone = true
- containers.forEach((container, index) => {
- const imageContainer = container.querySelector('.pdf-image-container')
- const img = imageContainer?.querySelector('img')
- // 更严格的检查条件
- if (
- !imageContainer ||
- !img ||
- !img.complete ||
- imageContainer.style.display !== 'block' ||
- !img.src
- ) {
- allDone = false
- }
- })
-
- if (allDone) {
- resolve(true)
- } else {
- setTimeout(checkRendering, 1000) // 增加检查间隔到1秒
- }
- }
-
- checkRendering()
- })
-}
// 修改打印处理函数
const handlePrint = async () => {