From 2b7c9ff5c65e94b63f92b707398cfbbdb1117d76 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 05 Nov 2021 15:57:29 +0800
Subject: [PATCH] 打印更改
---
src/views/securityGuard/securityGuard.vue | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 2b24fca..f7728ed 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()
--
Gitblit v1.9.3