|
<template>
|
<el-dialog
|
:visible.sync="licenseInfoVisible"
|
append-to-body
|
:close-on-click-modal="false"
|
width="60%"
|
>
|
<div id="printMe2">
|
<el-row style="height:130px;margin-left:320px;margin-top:197px">
|
<el-col :span="18">
|
<span style="display: inline-block;font-size: 25px;">{{code}}</span>
|
</el-col>
|
<el-col :span="6">
|
<div style="width: 40%;height: 40%;margin-left:25%;padding-top: 10px" id="qrcode" ref="qrcode"/>
|
</el-col>
|
</el-row>
|
<el-row style="text-align: center;height:35px;font-size: 25px;margin-top:70px">
|
<el-col :span="24">
|
<span style="display: inline-block">{{value}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="height:80px;margin-left:290px;margin-top:30px;">
|
<el-col :span="16" style="font-size: 27px">
|
<span>{{name}}</span>
|
</el-col>
|
<el-col :span="8" style="font-size: 27px">
|
<span>{{mainpersonname}}</span>
|
</el-col>
|
</el-row >
|
<el-row style="height:80px;margin-left:290px;">
|
<el-col :span="16" style="font-size: 27px">
|
<span>{{address}}</span>
|
</el-col>
|
<el-col :span="8" style="font-size: 27px">
|
<span>{{area}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="height:60px;margin-left:290px;">
|
<el-col :span="16" style="font-size: 27px">
|
<span>{{storageaddress}}</span>
|
</el-col>
|
<el-col :span="8" style="font-size: 27px">
|
<span>{{storagearea}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="height:100px;margin-left:290px;">
|
<el-col :span="16" style="font-size: 27px;padding-right: 200px;">
|
<span>{{dealingrange}}</span>
|
</el-col>
|
<el-col :span="8" style="font-size: 27px;margin-top:20px;">
|
<span>{{powder}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="height:80px;margin-left:290px;">
|
<el-col :span="6" style="font-size: 27px">
|
<span>{{effectdate}}</span>
|
</el-col>
|
<el-col :span="10" style="font-size: 27px">
|
<span>{{noeffectdate}}</span>
|
</el-col>
|
<el-col :span="8" style="font-size: 27px;margin-top:38px;">
|
<span>{{issuingunit}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="height:80px;margin-left:290px;">
|
<el-col :span="16" style="font-size: 1px">
|
<span>{{"."}}</span>
|
</el-col>
|
<el-col :span="2" style="font-size: 27px;margin-top: 30px">
|
<span>{{year}}</span>
|
</el-col>
|
<el-col :span="1" style="font-size: 27px;margin-top: 30px;margin-left:40px">
|
<span>{{month}}</span>
|
</el-col>
|
<el-col :span="1" style="font-size: 27px;margin-top: 30px;margin-left:40px">
|
<span>{{day}}</span>
|
</el-col>
|
</el-row>
|
<!-- <el-row style="height:80px;margin-left:1110px;">-->
|
<!-- <el-col :span="3" style="font-size: 25px;margin-top:50px;">-->
|
<!-- <span>{{"xxxx"}}</span>-->
|
<!-- </el-col>-->
|
<!-- <el-col :span="3" style="font-size: 25px;margin-top:50px;margin-left:30px">-->
|
<!-- <span>{{"xx"}}</span>-->
|
<!-- </el-col>-->
|
<!-- <el-col :span="3" style="font-size: 25px;margin-top:50px;">-->
|
<!-- <span>{{"xx"}}</span>-->
|
<!-- </el-col>-->
|
<!-- </el-row>-->
|
</div>
|
<div align="right" style="margin-top:30px;">
|
<el-button type="primary" v-print="printObj1">打印</el-button>
|
</div>
|
|
</el-dialog>
|
</template>
|
|
<script>
|
import QRCode from "qrcodejs2"
|
export default {
|
name: "printForm",
|
data(){
|
return{
|
code:'',
|
name:'',
|
mainpersonname:'',
|
address:'',
|
area:'',
|
storageaddress:'',
|
storagearea:'',
|
dealingrange:'',
|
powder:'',
|
effectdate:'',
|
noeffectdate:'',
|
issuingunit:'',
|
year:'',
|
month:'',
|
day:'',
|
licenseInfoVisible:false,
|
value:'',
|
}
|
},
|
mounted(){
|
this.$nextTick(() => {
|
this.qrcode()
|
})
|
},
|
methods:{
|
show(val){
|
this.licenseInfoVisible = true
|
this.code = val.code
|
this.name =val.name
|
this.mainpersonname = val.mainpersonname
|
this.address = val.address
|
this.area = JSON.parse(val.licenseStorage)[0].area
|
this.storageaddress =val.storageaddress
|
this.storagearea = JSON.parse(val.licenseStorage)[0].storagearea
|
this.dealingrange = val.dealingRangeStr
|
this.powder = JSON.parse(val.licenseStorage)[0].powder
|
this.effectdate = val.effectdate
|
this.noeffectdate = val.noeffectdate
|
this.issuingunit = val.issuingunit
|
this.value = val.licensecode
|
this.year = val.issuingdate.split('-')[0]
|
this.month = val.issuingdate.split('-')[1]
|
this.day= val.issuingdate.split('-')[2]
|
this.$nextTick(() => {
|
this.qrcode()
|
})
|
},
|
qrcode(){
|
if(this.value === ''){
|
|
}else{
|
document.getElementById("qrcode").innerHTML = ""
|
let qrcode = new QRCode('qrcode', {
|
width: 125,
|
height: 125, // 高度
|
text: this.value, // 二维码内容
|
// render: 'canvas' , // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
|
background: '#f0f', // 背景色
|
// foreground: '#ff0' // 前景色
|
|
})
|
}
|
}
|
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|