From 7719e6d5057054a80442c7cb2c73fc5a57919330 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 05 Nov 2021 16:38:48 +0800
Subject: [PATCH] 打印更改

---
 src/views/securityGuard/securityGuard.vue |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 2b24fca..5749c1b 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -266,7 +266,7 @@
                                :upload-after="uploadAfter2">
                     </avue-form>
                 </el-dialog>
-                <div style="position: fixed; top: 9999px; width: 100%; height: 100%;">
+                <div style="position: fixed; top: 9999px; width: 100%; height: 100%; ">
                     <div class="certificate_box"
                          id="certificateDom">
                         <div class="security_main"
@@ -1124,19 +1124,26 @@
                 return
             }
             //更新发证时间
-            this.updateUserInfo();
             var printDom = document.getElementById("certificateDom");
-            printDom.style.position = "fixed";
+            printDom.style.position = "absolute";
             printDom.style.top = "-28.5%";
             printDom.style.left = "-23%";
             printDom.style.width = "120%";
             printDom.style.height = "100%";
             printDom.style.fontFamily = "SimSun";
-            this.$Print(this.$refs.certificateBox);
-            printDom.style.position = "relative";
-            printDom.style.left = "0";
-            printDom.style.width = "100%";
-            printDom.style.height = "auto";
+
+            this.$print('#certificateDom', {
+                noPrint: '.noPrint',
+                onStart: () => {
+                    // console.log('打印开始', Date.parse(new Date()));
+                },
+                onEnd: () => {
+                    this.updateUserInfo();
+                    // console.log('打印完成', Date.parse(new Date()));
+                }
+            });
+
+
         },
         getNewTime () {
             var nowTime = new Date()
@@ -1733,7 +1740,7 @@
     align-items: center;
     justify-content: center;
     flex-direction: column;
-    font: bold 18px 'SimSun' !important;
+    font: normal 18px 'SimSuncss' !important;
 }
 .security_main {
     width: 630px;
@@ -1889,7 +1896,6 @@
     top: $downTop + $lineHigeht * 2 -6px;
     left: $centerLeft;
     width: 160px;
-    font: bold 16px 'SimSun' !important;
 }
 // 身份证
 .security_m_r_o_rightcardid {

--
Gitblit v1.9.3