<template>
<a-modal title=""
:width="1000"
v-model="visible"
:maskClosable="false"
:closable="false"
okText="返回">
<div v-for="(item,index) of printDoubleData"
:key="index"
:id="'content'+ index"
class="contentt">
<!-- <div class="prinLeft">
<div class="leftContent">
<div class="leftContentLeft">應(yīng)急管理部政治部監(jiān)制</div>
<div class="leftContentRight">
<div></div>
<div class="contRightB">政府專職消防員證</div>
<div class="contRightC">中華人民共和國(guó)應(yīng)急管理部</div>
</div>
</div>
</div> -->
<div class="prinRight">
<div class="rightNumLeft">
<div class="photoDiv">
<img class="photo"
:src="item.certificatePhoto"
alt="">
</div>
<div style="margin-left:15.83px">
<div class="rightTitle">
<span>編</span><span style="margin-left:30px;">號(hào)</span><span>粵政消</span> <span style="margin:0 8px;">字第</span><span>{{item.certificateNumber}}</span> <span style="margin-left:3px;">號(hào)</span>
</div>
<div class="rightTitle">
<span>發(fā)證機(jī)關(guān)</span><span style="margin-left:15px">廣東省消防救援總隊(duì)</span>
</div>
<div class="rightTitle">
<span>發(fā)證日期</span><span style="margin:0 10px;">{{item.BeginYear}}</span>年<span style="margin:0 10px;">{{item.BeginMonth}}</span>月<span style="margin:0 10px;">{{item.BeginDo}}</span>日
</div>
<div class="rightTitles">
<span>有效期至</span><span style="margin:0 10px;">{{item.EndYear}}</span>年<span style="margin:0 10px;">{{item.EndMonth}}</span>月<span style="margin:0 10px;">{{item.EndDo}}</span>日
</div>
</div>
</div>
<div class="rightTabRight">
<table border="1"
style="width:223px;height:318px;margin:0 auto">
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">姓<br />名</th>
<td colspan="7"
style="height:14.29%;">{{item.certificateName}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">出生<br />年月</th>
<td colspan="3"
style="height:14.29%;">{{item.birthDate}}</td>
<th colspan="1"
style="height:14.29%;width:25px">性<br />別</th>
<td colspan="2"
style="height:14.29%;">{{item.sex==1?'女':'男'}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">籍<br />貫</th>
<td colspan="7"
style="height:14.29%;">{{item.nativePlace}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">民<br />族</th>
<td colspan="7"
style="height:14.29%;">{{item.ethnic}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">身份<br />證號(hào)</th>
<td colspan="7"
style="height:14.29%;">{{item.identityCardNumber}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">單<br />位</th>
<td colspan="7"
style="height:14.29%;">{{item.deptName}}</td>
</tr>
<tr align="center">
<th colspan="1"
style="height:14.29%;width: 40px;">職<br />務(wù)</th>
<td colspan="7"
style="height:14.29%;">{{item.personnelType==1?'消防文員':item.personnelType==2?'消防文員':'企業(yè)專職'}}</td>
</tr>
</table>
</div>
</div>
</div>
<div slot="footer"
style="text-align:center">
<a-button style="background-color:#fafafa"
@click="back">
返回
</a-button>
<a-button type="primary"
@click="handlePrint">
打印
</a-button>
</div>
</a-modal>
</template>
<script>
const styleSheet = `<style>
.content {width: 522px;height: 385px;}
.prinRight {width: 519.7px;height: 384.2px;display: flex;justify-content: space-between;align-items: center;position: relative;font-family: STFangsong;}
.rightNumLeft {width: 50%;height: 100%;margin-left:12.5px;display: flex;flex-direction: column;justify-content: center;}
.photoDiv {width: 94.15px;height: 131.81px;text-align: center;margin-left:96px;margin-bottom: 12.5px;}
.photo {width: 100%;height: 100%;}
.rightTitle {margin: 14.5px 0;width: 100%;text-align: left;font-size: 15px;font-family: STFangsong;}
.rightTitles {margin: 0 0;width: 100%;text-align: left;font-size: 15px;font-family: STFangsong;}
.rightTabRight {width: 50%;height:100%;display: flex;align-items: center;}
th,td {margin: 0;padding: 0;}table {*border-style: solid;*border-color: #333;*border-width: 1px 0 0 1px;font-size: 13px;border-collapse: collapse;}
table td,table th {font-family: STFangsong;border-width: 1px;*border-width: 0 1px 1px 0;border-style: solid;border-color: #333;box-sizing: border-box;text-justify: inter-ideograph;}
table th {text-align: center;}
table td {color: #000;font-weight: bold;font-size: 17px;}
.border0 {padding: 0;*border-width: 0;}
.border0 table {margin-left: -1px;border-style: hidden;*border-style: solid;border-width: 0;}</style>`
// 公共配置
import COMMON from '@/utils/mixins/common' // 混入公共組件配置
import cloneDeep from 'lodash.clonedeep'
import moment from 'moment'
import { getAllTreeList } from '@/api/common'
import { getSelectOneDetails } from '@/api/smartManagement/smart-data-standing-book/smart-station-important-diary'
import config from '../config'
export default {
mixins: [COMMON],
data() {
return {
treeFilter: [],
...config,
visible: false,
printDoubleData: [],
form: {}
}
},
created() {
// this.loadDeptList()
},
methods: {
moment,
handlePrint() {
//打印
var newWin = window.open('') //新打開一個(gè)空窗口
this.printDoubleData.map((item, i) => {
var imageToPrint = document.getElementById('content' + i) //獲取需要打印的內(nèi)容
newWin.document.write(imageToPrint.outerHTML) //將需要打印的內(nèi)容添加進(jìn)新的窗口
})
newWin.document.head.innerHTML = styleSheet //給打印的內(nèi)容加上樣式
newWin.document.close() //在IE瀏覽器中使用必須添加這一句
newWin.focus() //在IE瀏覽器中使用必須添加這一句
setTimeout(function () {
newWin.print() //打印
console.log('開始打印')
newWin.close() //關(guān)閉窗口
}, 100)
},
deptid(record) {
const result = this.findIndexArray(JSON.parse(JSON.stringify(this.treeFilter)), record)
return result ? result.title : ''
},
findIndexArray(data, current) {
var result = ''
if (!data) {
// return; 中斷執(zhí)行
return
}
for (var i in data) {
var item = data[i]
if (item.id == current) {
result = item
break
} else if (item.childrens && item.childrens.length > 0 && !result) {
result = this.findIndexArray(item.childrens, current)
}
}
return result
},
info(record) {
//單個(gè)打印
this.printDoubleData = []
console.log('record: ', record)
const params = {}
params.certificateNumber = record.certificateNumber //編號(hào)
params.BeginYear = moment(record.certificateBegin).format('YYYY') //有效年
params.BeginMonth = moment(record.certificateBegin).format('MM') //有效月
params.BeginDo = moment(record.certificateBegin).format('Do').split('日')[0] //有效日
params.EndYear = moment(record.certificateEnd).format('YYYY') //有效至年
params.EndMonth = moment(record.certificateEnd).format('MM') //有效至月
params.EndDo = moment(record.certificateEnd).format('Do').split('日')[0] //有效至日
params.certificateName = record.certificateName //姓名
params.certificatePhoto = record.certificatePhoto //證件照
params.birthDate = record.birthDate //出生年月
params.sex = record.sex //性別
params.nativePlace = record.nativePlace //籍貫
params.ethnic = record.ethnic //民族
params.identityCardNumber = record.identityCardNumber //身份證號(hào)
params.deptName = record.deptName //單位
params.personnelType = record.personnelType //職務(wù)
this.printDoubleData.push(params)
this.visible = true
},
back() {
this.visible = false
}
}
}
</script>
<style lang="less" scoped>
.photo {
width: 30px;
height: 30px;
}
</style>
<style scoped lang="less">
.contentt {
width: 520px;
height: 385px;
margin: auto;
// display: none;
.prinRight {
width: 519.7px;
height: 384.2px;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: #e2f4d2;
position: relative;
font-family: STFangsong;
.rightNumLeft {
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
.photoDiv {
width: 94.15px;
height: 131.81px;
background-color: white;
text-align: center;
margin-bottom: 12.5px;
margin-left: 75.32px;
.photo {
width: 100%;
height: 100%;
// display: inline-block;
// font-size: 11px;
// -webkit-writing-mode: vertical-lr;
// writing-mode: vertical-lr;
}
}
.rightTitle {
margin: 14.5px 0;
width: 100%;
font-family: STFangsong;
text-align: left;
font-size: 15px;
}
.rightTitles {
margin: 5px 0;
width: 100%;
text-align: left;
font-size: 15px;
font-family: STFangsong;
}
}
.rightTabRight {
width: 50%;
height: 100%;
display: flex;
align-items: center;
}
}
}
th,
td {
margin: 0;
padding: 0;
}
table {
*border-style: solid;
*border-color: #333;
*border-width: 1px 0 0 1px;
font-size: 13px;
border-collapse: collapse;
}
table td,
table th {
border-width: 1px;
*border-width: 0 1px 1px 0;
border-style: solid;
border-color: #333;
// background-color: #e2f4d2;
box-sizing: border-box;
text-justify: inter-ideograph;
}
table th {
// background-color: #dedede;
text-align: center;
font-size: 13px;
}
table td {
color: #000;
font-weight: bold;
font-size: 17px;
}
.border0 {
padding: 0;
*border-width: 0;
}
.border0 table {
margin-left: -1px;
margin-left: 0\9;
border-style: hidden;
*border-style: solid;
border-width: 0;
}
</style>
頁面證件打印
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 照片標(biāo)準(zhǔn)尺寸、規(guī)格(英寸/厘米/像素) 對(duì)照表:編號(hào)規(guī)格尺寸/英寸像素11 寸2.5cm3.5cm413pix29...
- 在最新的MVC4+EasyUI的Web開發(fā)框架里面,我整合了關(guān)于網(wǎng)購運(yùn)單處理的一個(gè)模塊,其中整合了客戶導(dǎo)單、運(yùn)單合...
- 一鍵制作證件照批量排版打印PSD服裝模板PS插件 下載鏈接:http://www.mo-yu.com/thread...
- 需要在樣式文件中添加以下代碼 @media print { @page { size: 1108px 1...
- {padding: 0px;margin: 0px;font-style: normal;list-style-t...