From 786881b9f47cb841e7607e2b95555f8ab49f5eaa Mon Sep 17 00:00:00 2001 From: liuzhipeng <1747191978@qq.com> Date: Mon, 7 Apr 2025 00:00:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E4=BC=B0=E6=8A=A5=E5=91=8A=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=94=B9=E4=B8=BA=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/medicalFile/index.vue | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/acupuncture-前台/src/views/medicalFile/index.vue b/acupuncture-前台/src/views/medicalFile/index.vue index 9de52891..b576c716 100644 --- a/acupuncture-前台/src/views/medicalFile/index.vue +++ b/acupuncture-前台/src/views/medicalFile/index.vue @@ -610,6 +610,12 @@ + @@ -631,6 +637,9 @@ export default { dicts: ["sys_normal_disable", "sys_user_sex"], data() { return { + reportPath: "", + + timestamp: "", qzUrl: process.env.VUE_APP_API_QZURL, // 二维码路径 userInfo: {}, // 受教育程度,年限 @@ -1096,9 +1105,21 @@ export default { }, // 评估报告单 handleReport(row) { - exportTreatmentPg({ treatmentId: row.id }).then((res) => { - window.open(`${process.env.VUE_APP_API_QZURL}${res.data}`); - }); + try { + this.timestamp = new Date().getTime(); + exportTreatmentPg({ treatmentId: row.id }).then((res) => { + this.reportPath = `${process.env.VUE_APP_API_QZURL}${res.data}`; + var iframe = document.getElementById( + "codePartIframe" + this.timestamp + ); + iframe.onload = () => { + iframe.contentWindow.print(); + }; + // window.open(`${process.env.VUE_APP_API_QZURL}${res.data}`); + }); + } catch (error) { + console.log("error: ", error); + } }, /** 提交审核 */ handleExamine(row, _status) {