|
<template>
|
<el-dialog
|
v-model="licenseInfoVisible"
|
append-to-body
|
:close-on-click-modal="false"
|
width="60%"
|
>
|
<div id="printMe2">
|
<el-row>
|
<el-col :span="8" style="margin-top:660px;margin-left: 180px">
|
<el-row >
|
<el-col :span="24">
|
{{name}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 45px">
|
<el-col :span="24">
|
{{address}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 45px">
|
<el-col :span="24">
|
{{storageaddress}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 48px">
|
<el-col :span="24" style="padding-right: 100px;">
|
{{dealingrange}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 48px">
|
<el-col :span="12">
|
{{effectdate}}
|
</el-col>
|
<el-col :span="8">
|
{{noeffectdate}}
|
</el-col>
|
</el-row>
|
</el-col>
|
<el-col :span="8" style="margin-top: 385px;">
|
<el-row>
|
<el-col :span="10">
|
<el-row>
|
<el-col :span="24">
|
<span>{{value}}</span>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 17px;margin-left: 5px">
|
<el-col :span="24">
|
<span>{{code}}</span>
|
</el-col>
|
</el-row>
|
</el-col>
|
<el-col :span="12">
|
<div style="width:20px;height:20px;" class="qrcode" id="qrcode" ref="qrcode"/>
|
</el-col>
|
</el-row>
|
|
<el-row style="margin-top: 92px;margin-left: 100px">
|
<el-col :span="12">
|
{{mainpersonname}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 48px;margin-left: 100px">
|
<el-col :span="12">
|
{{area}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 48px;margin-left: 100px">
|
<el-col :span="12">
|
{{storagearea}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 48px;margin-left: 100px">
|
<el-col :span="12">
|
{{powder}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 150px;margin-left: 100px">
|
<el-col :span="12">
|
{{issuingunit}}
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 30px;margin-left: 100px">
|
<el-col :span="2" >
|
<span>{{year}}</span>
|
</el-col>
|
<el-col :span="1" style="margin-left:60px">
|
<span>{{month}}</span>
|
</el-col>
|
<el-col :span="1" style="margin-left:40px">
|
<span>{{day}}</span>
|
</el-col>
|
</el-row>
|
</el-col>
|
</el-row>
|
</div>
|
<div align="right" style="margin-top:30px;">
|
<el-button type="primary" v-print="printObj2">打印</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,
|
printObj2:{
|
id:'printMe1',
|
extraHead:'<meta http-equiv="Content-Language" content="zh-cn"/>'
|
},
|
value:'',
|
}
|
},
|
mounted(){
|
this.$nextTick(() => {
|
this.qrcode()
|
})
|
},
|
methods:{
|
show(val){
|
this.code = val.code
|
this.licenseInfoVisible = true
|
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: 100,
|
height: 100, // 高度
|
text: this.value, // 二维码内容
|
// render: 'canvas' , // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
|
background: '#f0f', // 背景色
|
// foreground: '#ff0' // 前景色
|
})
|
}
|
}
|
|
}
|
}
|
</script>
|
|
<style scoped>
|
</style>
|