From c3bb35b20d6e076f73a1cad50fd6b9b94ca399a7 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 06 一月 2025 16:15:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/onlineEducation/classCertManage/index.vue |   72 +++++++++++++++++++++++++++++++----
 1 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/src/views/onlineEducation/classCertManage/index.vue b/src/views/onlineEducation/classCertManage/index.vue
index 851b40b..495bcdc 100644
--- a/src/views/onlineEducation/classCertManage/index.vue
+++ b/src/views/onlineEducation/classCertManage/index.vue
@@ -25,6 +25,7 @@
         style="margin-left: 30px;"
       >
       </el-date-picker>
+      <el-input size="small" style="margin-left: 30px;width: 200px" v-model="queryParams.idcard" placeholder="请输入身份证号"></el-input>
       <el-select v-model="queryParams.institutionName"  size="small" style="margin-left: 40px;" placeholder="请选择平台">
         <el-option
           v-for="item in platformList"
@@ -69,7 +70,7 @@
         <template #default="scope">
           <el-button size="mini" type="text" style="color: #1890ff" @click="viewPic(scope.row)">查看</el-button>
           <el-button size="mini" type="text" style="color: #1890ff" @click="downloadByBlob(scope.row)">下载</el-button>
-          <el-button size="mini" type="text" style="color: #1890ff">打印</el-button>
+          <el-button size="mini" type="text" style="color: #1890ff" @click="print(scope.row)">打印</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -92,10 +93,26 @@
         </el-image>
       </div>
     </el-dialog>
+    <el-dialog
+      :visible.sync="printDialog"
+      width="500px"
+      :before-close="handlePrintClose">
+      <div style="display: flex;flex-direction: column;align-items: flex-end">
+        <el-button type="primary" style="margin-bottom: 5px" v-print="'#printPic'">打印</el-button>
+      </div>
+      <div style="display: flex;justify-content: center" ref="printPic" id="printPic">
+        <el-image
+          style="width: 85%; height: auto;margin-top: 10px"
+          :src="printUrl"
+          >
+        </el-image>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+
 import { listBatch, listQuestion } from '@/api/onlineEducation/student'
 import { listPlatSelect } from '@/api/onlineEducation/plat'
 import moment from 'moment/moment'
@@ -120,6 +137,7 @@
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        idcard: '',
         institutionName: '',
         startTime: '',
         endTime: '',
@@ -128,17 +146,34 @@
       trainOrgList: [],
       jsonData: [],
       json_fields: {
-        ID: "id",
-        姓名: "name",
-        身份证号: "idcard",
-        推送平台: "institutionName",
-        所属机构: "trainOrgName",
-        批次: "batchName",
-        证书生成时间: "certTime",
+        'ID': {
+          field: 'id',
+          callback: value => {
+            return '&nbsp;'+value
+          }
+        },
+        '姓名': "name",
+        '身份证号': {
+          field: 'idcard',
+          callback: value => {
+            return '&nbsp;'+value
+          }
+        },
+        '推送平台': "institutionName",
+        '所属机构': {
+          field: 'trainOrgName',
+          callback: value => {
+            return '&nbsp;'+value
+          }
+        },
+        '批次': "batchName",
+        '证书生成时间': "certTime",
       },
       picDialog: false,
       viewUrl: '',
-      srcList: []
+      srcList: [],
+      printDialog: false,
+      printUrl: '',
     };
   },
   created() {
@@ -209,6 +244,7 @@
         pageNum: 1,
         pageSize: 10,
         institutionName: '',
+        idcard: '',
         startTime: '',
         endTime: '',
         trainOrgName: ''
@@ -225,6 +261,15 @@
       this.viewUrl = ''
       // this.srcList = []
       this.picDialog = false
+    },
+    handlePrintClose() {
+      this.printUrl = ''
+      this.printDialog = false
+    },
+    print(val){
+      this.printUrl = val.certUrl
+
+      this.printDialog = true
     },
     downloadByBlob(val) {
       let image = new Image()
@@ -254,3 +299,12 @@
   }
 };
 </script>
+<style media="printPic" scoped>
+@page {
+  margin: 0; /* this affects the margin in the printer settings */
+  display: block;
+  width: 100%;
+  overflow: hidden;
+}
+
+</style>

--
Gitblit v1.9.2