zhouwx
昨天 4fe6c5ac4bc2b7fa9c9c71bb52d9df3e8b13bd7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<template>
  <div class="form-container">
      <div class="certContent" @click="getPdf()">
        <div class="certNo">{{info.companyName}}</div>
        <div class="main-content">
          {{info.name}}
        </div>
        <div class="name-content">
          {{info.stuName}}
        </div>
        <div class="num-content">
          {{info.number}}
        </div>
        <div class="dep-content">
          {{info.companyName}}
        </div>
      </div>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs, onMounted, nextTick} from 'vue'
import {ElMessage, ElMessageBox} from "element-plus"
import htmlToPdf from '@/utils/htmlToPdf';
import { useRoute } from 'vue-router'
const { proxy } = getCurrentInstance();
const route = useRoute();
const data = reactive({
  info: {}
})
const {info} = toRefs(data)
onMounted(()=>{
  if(route.query.type == 'inter'){
    data.info.name = route.query.paperName
    data.info.stuName = route.query.personName
    data.info.number = route.query.certifity
    data.info.companyName = route.query.companyName
  }else {
    data.info = route.query
  }
  console.log(' data.info', data.info)
  nextTick(()=>{
    getPdf()
  })
})
 
function getPdf() {
  let title = data.info.stuName + '_' + data.info.name + '合格证书'
  htmlToPdf(title);
}
 
onMounted(()=>{
 
})
</script>
 
<style scoped lang="scss">
@font-face {
  font-family: "fangzhengKT";
  src: url("@/assets/styles/font/fangzhengKT.ttf");
  font-style: normal;
  font-weight: normal;
}
.form-container{
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
 
  .certContent{
    width: calc(1920px * 0.8);
    height: calc(1280px * 0.8);
    background: url("@/assets/images/certBg.jpg") no-repeat center;
    background-size: contain;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 420px 300px 120px;
    color: #333;
    position: relative;
 
    .certNo{
      position: absolute;
      top: 230px;
      font-size: 1.3rem;
      font-weight: 600;
      color: rgb(10,38,140);
      font-family: 'fangzhengKT';
    }
 
    .main-content{
      position: absolute;
      top: 365px;
      font-size: 1.3rem;
      font-weight: 600;
      color: rgb(10,38,140);
      font-family: 'fangzhengKT';
    }
    .name-content{
      position: absolute;
      top: 566px;
      font-size: 1.0rem;
      font-weight: 600;
      font-family: 'fangzhengKT';
      left: 715px;
    }
    .num-content{
      position: absolute;
      top: 628px;
      font-size: 1.0rem;
      font-weight: 600;
      font-family: 'fangzhengKT';
      left: 715px;
    }
    .dep-content{
      position: absolute;
      top: 688px;
      font-size: 1.0rem;
      font-weight: 600;
      font-family: 'fangzhengKT';
      left: 715px;
    }
 
  }
}
</style>