From c28d08def0b232fd1d4b76915418d7c1da37a953 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 05 Nov 2021 13:35:40 +0800
Subject: [PATCH] 打印证件修改

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

diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 9eb85e9..f1260e2 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -1,5 +1,6 @@
 <template>
     <el-row :class="{ securityGuard: isSecurity }">
+
         <el-col :span="0"
                 style="display: none">
             <div class="box">
@@ -265,6 +266,11 @@
                                :upload-after="uploadAfter2">
                     </avue-form>
                 </el-dialog>
+                <div style="position: fixed; left: 99999999px; width: 100%; height: 100%;">
+                    <certificate
+                                 ref="certificate"
+                                 :data="certificateObj"></certificate>
+                </div>
             </basic-container>
         </el-col>
     </el-row>
@@ -294,6 +300,7 @@
 import { getToken } from "@/util/auth";
 import { securityFormPageColumn } from "./data";
 import { mapState } from "vuex";
+import certificate from "./certificate.vue";
 
 export default {
     data () {
@@ -377,9 +384,8 @@
                 callback();
             }
         };
-        console.log(this.userInfo, 123);
-
         return {
+            certificateObj: { title: "我是头部标题", },
             securityid: "",
             excelBox1: false,
             excelBox2: false,
@@ -977,6 +983,7 @@
             },
         };
     },
+    components: { certificate },
     watch: {
         "form.tenantId" () {
             if (this.form.tenantId !== "" && this.initFlag) {
@@ -1030,7 +1037,6 @@
         if (!website.tenantMode) {
             this.initData(website.tenantId);
         }
-        console.log(this.search, 111);
         this.search["status"] = 1;
         this.deptIds = this.userInfo.dept_id;
     },
@@ -1059,7 +1065,6 @@
 
         //行点击事件
         rowClick (row) {
-            // console.log(row, 111);
             this.$router.push({
                 path: "/securityGuardDetail",
                 query: { row: JSON.stringify(row) },
@@ -1067,14 +1072,15 @@
         },
         //行点击事件
         certificateClick (row) {
-            // console.log(row, 111);
-            this.$router.push({
-                path: "/certificateOfPrint",
-                query: { row: JSON.stringify(row) },
-            });
+            if (row) {
+                for (var k in row) {
+                    this.certificateObj[k] = row[k];
+                }
+
+                this.$refs.certificate.Print();
+            }
         },
         rowClickSelf (row) {
-            console.log(row, "baoan");
             this.$router.push({
                 path: "/securityUnitChild",
                 query: { fromSecunityGuardId: row },
@@ -1123,7 +1129,6 @@
             })
                 .then(() => {
                     let cho = this.choiceList;
-                    console.log(this.choiceList, 14521);
                     let str = "";
                     for (let k in cho) {
                         str += cho[k].id;
@@ -1131,7 +1136,6 @@
                             str += ",";
                         }
                     }
-                    console.log(str, 1132);
                     const data = {
                         ids: str,
                         createUser: this.userInfo.user_id
@@ -1232,7 +1236,6 @@
             );
         },
         rowDellook (row) {
-            // console.log(row.reasonForLeav);
             this.$alert(
                 row.reasonForLeav == "" ? "未填写" : row.reasonForLeav,
                 "离职原因",
@@ -1249,10 +1252,8 @@
                 inputErrorMessage: "",
             })
                 .then(({ value }) => {
-                    console.log(value);
                     row.reasonForLeav = value;
                     row.status = "2";
-                    // console.log(update);
                     // return;
                     update(row).then((res) => {
                         this.$message({

--
Gitblit v1.9.3