搜索名称问题
parent
3e0c471877
commit
30d952c795
|
@ -57,7 +57,7 @@
|
||||||
<td class="bbg">风险辨识结果</td>
|
<td class="bbg">风险辨识结果</td>
|
||||||
<td colspan="5">{{ pd.RISK_IDENTIFICATION }}</td>
|
<td colspan="5">{{ pd.RISK_IDENTIFICATION }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr v-if="gasList.length>0">
|
||||||
<td class="bbg" colspan="6">可燃气体分析(运行的生产装置、罐区和具有火灾爆炸危险场所)</td>
|
<td class="bbg" colspan="6">可燃气体分析(运行的生产装置、罐区和具有火灾爆炸危险场所)</td>
|
||||||
</tr>
|
</tr>
|
||||||
<template v-for="(item,index) in gasList">
|
<template v-for="(item,index) in gasList">
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<div>
|
<div>
|
||||||
<div id="printTest" class="app-container print-work">
|
<div id="printTest" class="app-container print-work">
|
||||||
<el-page-header content="审批表详情" class="no-print" @back="goBack"/>
|
<el-page-header content="审批表详情" class="no-print" @back="goBack"/>
|
||||||
<div v-for="pdf in 2" :key="pdf" :name="pdf === 2 ? 'pdf-box' : ''" class="pdf-content">
|
<table class="table-ui">
|
||||||
<table :class="['table-ui','table-ui' + pdf]">
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" style="border: none">
|
<td colspan="6" style="border: none">
|
||||||
<div class="level-title mt-20">
|
<div class="level-title mt-20">
|
||||||
|
@ -12,195 +12,194 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
</thead>
|
||||||
<td class="bbg">申请单位</td>
|
<tr>
|
||||||
<td colspan="2">{{ pd.APPLY_DEPARTMENT_NAME }}</td>
|
<td class="bbg">申请单位</td>
|
||||||
<td class="bbg">作业申请时间</td>
|
<td colspan="2">{{ pd.APPLY_DEPARTMENT_NAME }}</td>
|
||||||
<td colspan="2">{{ pd.CREATTIME }}</td>
|
<td class="bbg">作业申请时间</td>
|
||||||
|
<td colspan="2">{{ pd.CREATTIME }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">作业地点</td>
|
||||||
|
<td colspan="2">{{ pd.WORK_PLACE }}</td>
|
||||||
|
<td class="bbg">作业内容</td>
|
||||||
|
<td colspan="2">{{ pd.WORK_CONTENT }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">电源接入点及许可用电功率</td>
|
||||||
|
<td colspan="2">{{ pd.ALLOW_POWER }}</td>
|
||||||
|
<td class="bbg">工作电压</td>
|
||||||
|
<td colspan="2">{{ pd.WORK_VOLTAGE }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">用电设备名称及额定功率</td>
|
||||||
|
<td>{{ pd.RATED_POWER }}</td>
|
||||||
|
<td class="bbg">监护人</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="pd.GUARDIAN_USER_SIGNER_PATH" style="text-align: right;width: 230px">
|
||||||
|
<span>签字:</span>
|
||||||
|
<img v-viewer :src="config.fileUrl + pd.GUARDIAN_USER_SIGNER_PATH" alt="" width="50" height="50">
|
||||||
|
<span>{{ pd.GUARDIAN_USER_SIGNER_TIME }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="bbg">用电人</td>
|
||||||
|
<td>{{ pd.ELECTRICITY_USER }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">作业人</td>
|
||||||
|
<td colspan="2">{{ pd.WORK_USER }}</td>
|
||||||
|
<td class="bbg">电工证号</td>
|
||||||
|
<td colspan="2">{{ pd.CARD_NO }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">作业负责人</td>
|
||||||
|
<td colspan="2">{{ pd.CONFIRM_USER_NAME }}</td>
|
||||||
|
<td class="bbg">电工证号</td>
|
||||||
|
<td colspan="2">{{ pd.LEADER_CARD_NO }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
||||||
|
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="bbg">风险辨识结果</td>
|
||||||
|
<td colspan="5">{{ pd.RISK_IDENTIFICATION }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="gasList.length>0">
|
||||||
|
<td class="bbg" colspan="6">可燃气体分析(运行的生产装置、罐区和具有火灾爆炸危险场所)</td>
|
||||||
|
</tr>
|
||||||
|
<template v-for="(item,index) in gasList">
|
||||||
|
<tr :key="index">
|
||||||
|
<td class="bbg">分析时间</td>
|
||||||
|
<td colspan="2">{{ item.ANALYZE_TIME }}</td>
|
||||||
|
<td class="bbg">分析点</td>
|
||||||
|
<td colspan="2">{{ item.ANALYZE_PLACE }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr :key="index">
|
||||||
<td class="bbg">作业地点</td>
|
<td class="bbg">可燃气体检测结果</td>
|
||||||
<td colspan="2">{{ pd.WORK_PLACE }}</td>
|
<td colspan="2">{{ item.ANALYZE_RESULT }}</td>
|
||||||
<td class="bbg">作业内容</td>
|
<td class="bbg">分析人</td>
|
||||||
<td colspan="2">{{ pd.WORK_CONTENT }}</td>
|
<td colspan="2">{{ item.ANALYZE_USER }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
</template>
|
||||||
<td class="bbg">电源接入点及许可用电功率</td>
|
<tr>
|
||||||
<td colspan="2">{{ pd.ALLOW_POWER }}</td>
|
<td class="bbg">作业实施时间</td>
|
||||||
<td class="bbg">工作电压</td>
|
<td colspan="5">{{ pd.WORK_START_DATE }}至{{ pd.WORK_END_DATE }}止</td>
|
||||||
<td colspan="2">{{ pd.WORK_VOLTAGE }}</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<td colspan="6">
|
||||||
<td class="bbg">用电设备名称及额定功率</td>
|
<table class="table-ui">
|
||||||
<td>{{ pd.RATED_POWER }}</td>
|
<tr>
|
||||||
<td class="bbg">监护人</td>
|
<td>序号</td>
|
||||||
<td>
|
<td>安全措施</td>
|
||||||
<div v-if="pd.GUARDIAN_USER_SIGNER_PATH" style="text-align: right;width: 230px">
|
<td style="width: 100px;">是否涉及</td>
|
||||||
<span>签字:</span>
|
<td style="width: 100px;">确认人</td>
|
||||||
<img v-viewer :src="config.fileUrl + pd.GUARDIAN_USER_SIGNER_PATH" alt="" width="50" height="50">
|
</tr>
|
||||||
<span>{{ pd.GUARDIAN_USER_SIGNER_TIME }}</span>
|
<tr v-for="(item,index) in measuresList" :key="index">
|
||||||
</div>
|
<td>{{ index + 1 }}</td>
|
||||||
</td>
|
<td>{{ item.PROTECTIVE_MEASURES }}</td>
|
||||||
<td class="bbg">用电人</td>
|
<td>
|
||||||
<td>{{ pd.ELECTRICITY_USER }}</td>
|
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
||||||
</tr>
|
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
||||||
<tr>
|
</td>
|
||||||
<td class="bbg">作业人</td>
|
<td>
|
||||||
<td colspan="2">{{ pd.WORK_USER }}</td>
|
{{ item.CONFIRM_NAME }}
|
||||||
<td class="bbg">电工证号</td>
|
</td>
|
||||||
<td colspan="2">{{ pd.CARD_NO }}</td>
|
</tr>
|
||||||
</tr>
|
<tr v-if="pd.CONFIRM_USER_MEASURES || pd.AUDIT_USER_MEASURES || pd.APPROVE_USER_MEASURES">
|
||||||
<tr>
|
<td>{{ measuresList.length + 1 }}</td>
|
||||||
<td class="bbg">作业负责人</td>
|
<td colspan="3">
|
||||||
<td colspan="2">{{ pd.CONFIRM_USER_NAME }}</td>
|
<div v-if="pd.CONFIRM_USER_MEASURES" style="display: flex;justify-content: space-between;">
|
||||||
<td class="bbg">电工证号</td>
|
<span>其他安全措施:{{ pd.CONFIRM_USER_MEASURES }}</span>
|
||||||
<td colspan="2">{{ pd.LEADER_CARD_NO }}</td>
|
<span>编制人:{{ pd.CONFIRM_USER_NAME }}</span>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div v-if="pd.AUDIT_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
||||||
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
<span>其他安全措施:{{ pd.AUDIT_USER_MEASURES }}</span>
|
||||||
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
<span>编制人:{{ pd.AUDIT_USER_NAME }}</span>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div v-if="pd.APPROVE_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
||||||
<td class="bbg">风险辨识结果</td>
|
<span>其他安全措施:{{ pd.APPROVE_USER_MEASURES }}</span>
|
||||||
<td colspan="5">{{ pd.RISK_IDENTIFICATION }}</td>
|
<span>编制人:{{ pd.APPROVE_USER_NAME }}</span>
|
||||||
</tr>
|
</div>
|
||||||
<tr v-if="gasList.length>0">
|
</td>
|
||||||
<td class="bbg" colspan="6">可燃气体分析(运行的生产装置、罐区和具有火灾爆炸危险场所)</td>
|
</tr>
|
||||||
</tr>
|
</table>
|
||||||
<template v-for="(item,index) in gasList" >
|
</td>
|
||||||
<tr v-if="gasList.length>0" :key="index">
|
</tr>
|
||||||
<td class="bbg">分析时间</td>
|
<tr>
|
||||||
<td colspan="2">{{ item.ANALYZE_TIME }}</td>
|
<td class="bbg">安全交底人</td>
|
||||||
<td class="bbg">分析点</td>
|
<td colspan="10">
|
||||||
<td colspan="2">{{ item.ANALYZE_PLACE }}</td>
|
<div v-if="pd.CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
||||||
</tr>
|
<span>签字:</span>
|
||||||
<tr v-if="gasList.length>0" :key="index">
|
<img v-viewer :src="config.fileUrl + pd.CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<td class="bbg">可燃气体检测结果</td>
|
<span>{{ pd.CONFESS_USER_SIGNER_TIME }}</span>
|
||||||
<td colspan="2">{{ item.ANALYZE_RESULT }}</td>
|
</div>
|
||||||
<td class="bbg">分析人</td>
|
</td>
|
||||||
<td colspan="2">{{ item.ANALYZE_USER }}</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
</template>
|
<td class="bbg">接受交底人</td>
|
||||||
<tr>
|
<td colspan="10">
|
||||||
<td class="bbg">作业实施时间</td>
|
<div v-if="pd.ACCEPT_CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
||||||
<td colspan="5">{{ pd.WORK_START_DATE }}至{{ pd.WORK_END_DATE }}止</td>
|
<span>签字:</span>
|
||||||
</tr>
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<tr>
|
<span>{{ pd.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
||||||
<td colspan="6">
|
</div>
|
||||||
<table class="table-ui">
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td>序号</td>
|
<tr>
|
||||||
<td>安全措施</td>
|
<td colspan="6">
|
||||||
<td style="width: 100px;">是否涉及</td>
|
<div>作业负责人意见:{{ pd.CONFIRM_CONTENT }}</div>
|
||||||
<td style="width: 100px;">确认人</td>
|
<div style="text-align: right">
|
||||||
</tr>
|
<span>签字:</span>
|
||||||
<tr v-for="(item,index) in measuresList" :key="index">
|
<img v-viewer :src="config.fileUrl + pd.CONFIRM_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<td>{{ index + 1 }}</td>
|
<span>{{ pd.CONFIRM_USER_SIGNER_TIME }}</span>
|
||||||
<td>{{ item.PROTECTIVE_MEASURES }}</td>
|
</div>
|
||||||
<td>
|
</td>
|
||||||
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
</tr>
|
||||||
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
<tr>
|
||||||
</td>
|
<td colspan="6">
|
||||||
<td>
|
<div>用电单位意见:{{ pd.AUDIT_CONTENT }}</div>
|
||||||
{{ item.CONFIRM_NAME }}
|
<div style="text-align: right">
|
||||||
</td>
|
<span>签字:</span>
|
||||||
</tr>
|
<img v-viewer :src="config.fileUrl + pd.AUDIT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<tr v-if="pd.CONFIRM_USER_MEASURES || pd.AUDIT_USER_MEASURES || pd.APPROVE_USER_MEASURES">
|
<span>{{ pd.AUDIT_USER_SIGNER_TIME }}</span>
|
||||||
<td>{{ measuresList.length + 1 }}</td>
|
</div>
|
||||||
<td colspan="3">
|
</td>
|
||||||
<div v-if="pd.CONFIRM_USER_MEASURES" style="display: flex;justify-content: space-between;">
|
</tr>
|
||||||
<span>其他安全措施:{{ pd.CONFIRM_USER_MEASURES }}</span>
|
<tr>
|
||||||
<span>编制人:{{ pd.CONFIRM_USER_NAME }}</span>
|
<td colspan="6">
|
||||||
</div>
|
<div>配送电单位意见:{{ pd.APPROVE_CONTENT }}</div>
|
||||||
<div v-if="pd.AUDIT_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
<div style="text-align: right">
|
||||||
<span>其他安全措施:{{ pd.AUDIT_USER_MEASURES }}</span>
|
<span>签字:</span>
|
||||||
<span>编制人:{{ pd.AUDIT_USER_NAME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.APPROVE_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.APPROVE_USER_SIGNER_TIME }}</span>
|
||||||
<div v-if="pd.APPROVE_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
</div>
|
||||||
<span>其他安全措施:{{ pd.APPROVE_USER_MEASURES }}</span>
|
</td>
|
||||||
<span>编制人:{{ pd.APPROVE_USER_NAME }}</span>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</td>
|
<td colspan="6">
|
||||||
</tr>
|
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
||||||
</table>
|
<div style="text-align: right">
|
||||||
</td>
|
<span>签字:</span>
|
||||||
</tr>
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<tr>
|
<span>{{ pd.ACCEPT_USER_SIGNER_TIME }}</span>
|
||||||
<td class="bbg">安全交底人</td>
|
</div>
|
||||||
<td colspan="10">
|
</td>
|
||||||
<div v-if="pd.CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
</tr>
|
||||||
<span>签字:</span>
|
</table>
|
||||||
<img v-viewer :src="config.fileUrl + pd.CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ pd.CONFESS_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="bbg">接受交底人</td>
|
|
||||||
<td colspan="10">
|
|
||||||
<div v-for="item in imgList" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
|
||||||
<span>签字:</span>
|
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ item.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="6">
|
|
||||||
<div>作业负责人意见:{{ pd.CONFIRM_CONTENT }}</div>
|
|
||||||
<div style="text-align: right">
|
|
||||||
<span>签字:</span>
|
|
||||||
<img v-viewer :src="config.fileUrl + pd.CONFIRM_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ pd.CONFIRM_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="6">
|
|
||||||
<div>用电单位意见:{{ pd.AUDIT_CONTENT }}</div>
|
|
||||||
<div style="text-align: right">
|
|
||||||
<span>签字:</span>
|
|
||||||
<img v-viewer :src="config.fileUrl + pd.AUDIT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ pd.AUDIT_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="6">
|
|
||||||
<div>配送电单位意见:{{ pd.APPROVE_CONTENT }}</div>
|
|
||||||
<div style="text-align: right">
|
|
||||||
<span>签字:</span>
|
|
||||||
<img v-viewer :src="config.fileUrl + pd.APPROVE_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ pd.APPROVE_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr v-if="imgList1.length>0">
|
|
||||||
<td colspan="10">
|
|
||||||
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
|
||||||
<div v-for="item in imgList1" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
|
||||||
<span>签字:</span>
|
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
|
||||||
<span>{{ item.ACCEPT_USER_SIGNER_TIME }}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div style="padding-top: 100px"/>
|
|
||||||
<div class="ui-foot">
|
|
||||||
<!-- <el-button v-print="'#printTest'" icon="el-icon-printer" type="primary">打 印</el-button>-->
|
|
||||||
<el-button type="primary" icon="el-icon-printer" @click="handle2PDF">PDF导出</el-button>
|
|
||||||
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div></template>
|
<div style="padding-top: 100px"/>
|
||||||
|
<!-- <div class="ui-height" />-->
|
||||||
|
<div class="ui-foot">
|
||||||
|
<el-button v-print="'#printTest'" icon="el-icon-printer" type="primary">打 印</el-button>
|
||||||
|
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { requestFN } from '@/utils/request'
|
import { requestFN } from '@/utils/request'
|
||||||
import dateformat from '@/utils/dateformat'
|
import dateformat from '@/utils/dateformat'
|
||||||
import JsPDF from 'jspdf'
|
|
||||||
import html2Canvas from 'html2canvas'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -209,8 +208,6 @@ export default {
|
||||||
pd: [], // 存放字段参数
|
pd: [], // 存放字段参数
|
||||||
measuresList: [],
|
measuresList: [],
|
||||||
gasList: [],
|
gasList: [],
|
||||||
imgList: [],
|
|
||||||
imgList1: [],
|
|
||||||
otherProtectiveMeasures: []
|
otherProtectiveMeasures: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -218,85 +215,6 @@ export default {
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handle2PDF() {
|
|
||||||
const loading = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: '正在生成,请稍候...',
|
|
||||||
spinner: 'el-icon-loading',
|
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
|
||||||
})
|
|
||||||
const elements = document.querySelectorAll('div[name="pdf-box"]')
|
|
||||||
console.log(elements)
|
|
||||||
this.html2pdf(this.pd.CHECK_NO + '审批表详情', elements, loading)
|
|
||||||
},
|
|
||||||
|
|
||||||
html2pdf(filename, els, loading) {
|
|
||||||
const flagArr = []
|
|
||||||
for (let i = 0, len = els.length; i < len; i++) {
|
|
||||||
flagArr.push(0)
|
|
||||||
}
|
|
||||||
console.log(flagArr)
|
|
||||||
runself(0)
|
|
||||||
const pdf = new JsPDF('', 'pt', 'a4') // A4纸,纵向
|
|
||||||
function runself(index) {
|
|
||||||
const html = els[index]
|
|
||||||
html2Canvas(html, {
|
|
||||||
allowTaint: true,
|
|
||||||
taintTest: false,
|
|
||||||
logging: false,
|
|
||||||
useCORS: true,
|
|
||||||
scale: 2 // 按比例增加分辨率
|
|
||||||
}).then(canvas => {
|
|
||||||
// eslint-disable-next-line one-var
|
|
||||||
var ctx = canvas.getContext('2d'),
|
|
||||||
a4w = 532.28, a4h = 781.89, // A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277 pt:592.28 * 841.89
|
|
||||||
renderedHeight = 0
|
|
||||||
const allTrs = html.querySelectorAll('tr')
|
|
||||||
while (renderedHeight < canvas.height) {
|
|
||||||
let imgHeight = Math.floor(a4h * canvas.width / a4w) // 按A4显示比例换算一页图像的像素高度
|
|
||||||
for (let i = 0; i < allTrs.length; i++) {
|
|
||||||
const tr = allTrs[i]
|
|
||||||
const trHeight = tr.offsetHeight + tr.offsetTop
|
|
||||||
console.log('offsetHeight:' + tr.offsetHeight + 'offsetTop:' + tr.offsetTop + 'offsetParent:' + tr.offsetParent.offsetTop)
|
|
||||||
if (trHeight * 2 > (imgHeight + renderedHeight)) {
|
|
||||||
const btr = allTrs[i - 1]
|
|
||||||
const btrHeight = btr.offsetHeight + btr.offsetTop
|
|
||||||
console.log('i:' + (i - 1) + 'btrHeight:' + btrHeight)
|
|
||||||
imgHeight = btrHeight * 2 - renderedHeight
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var page = document.createElement('canvas')
|
|
||||||
page.width = canvas.width
|
|
||||||
page.height = Math.min(imgHeight, canvas.height - renderedHeight)// 可能内容不足一页
|
|
||||||
|
|
||||||
// 用getImageData剪裁指定区域,并画到前面创建的canvas对象中
|
|
||||||
page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0)
|
|
||||||
pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 30, 30, a4w, Math.min(a4h, a4w * page.height / page.width)) // 添加图像到页面,保留10mm边距
|
|
||||||
|
|
||||||
renderedHeight += imgHeight
|
|
||||||
if (renderedHeight < canvas.height) {
|
|
||||||
pdf.addPage()// 如果后面还有内容,添加一个空页
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index < els.length - 1) {
|
|
||||||
pdf.addPage()
|
|
||||||
}
|
|
||||||
return 1
|
|
||||||
}).then(item => {
|
|
||||||
flagArr[index] = item
|
|
||||||
if (flagArr.every(f => f === 1)) {
|
|
||||||
pdf.save(filename)
|
|
||||||
}
|
|
||||||
index++
|
|
||||||
if (index < els.length) {
|
|
||||||
runself(index)
|
|
||||||
} else {
|
|
||||||
loading.close()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
validStr(str) {
|
validStr(str) {
|
||||||
if (str != null && str != '' && typeof (str) != 'undefined' && str != 0) { return true }
|
if (str != null && str != '' && typeof (str) != 'undefined' && str != 0) { return true }
|
||||||
return false
|
return false
|
||||||
|
@ -328,10 +246,8 @@ export default {
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.pd = data.pd // 参数map
|
this.pd = data.pd // 参数map
|
||||||
this.imgList = data.imgList
|
|
||||||
this.imgList1 = data.imgList1
|
|
||||||
this.measuresList = data.measuresList // 参数map
|
this.measuresList = data.measuresList // 参数map
|
||||||
this.gasList = data.gasList.length > 0 ? data.gasList : [] // 参数map
|
this.gasList = data.gasList // 参数map
|
||||||
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
||||||
this.pd.AUDIT_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
this.pd.AUDIT_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
||||||
this.pd.APPROVE_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[2]
|
this.pd.APPROVE_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[2]
|
||||||
|
@ -363,26 +279,3 @@ export default {
|
||||||
.bbg
|
.bbg
|
||||||
width: 300px !important
|
width: 300px !important
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
|
||||||
.table-ui td{
|
|
||||||
line-height: unset;
|
|
||||||
}
|
|
||||||
.pdf-content[name=pdf-box]{
|
|
||||||
position: absolute;
|
|
||||||
left: -999999px;
|
|
||||||
.level-title {
|
|
||||||
h1{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.level-code{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
td{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.bbg {
|
|
||||||
width: 200px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<td colspan="6" style="border: none">
|
<td colspan="6" style="border: none">
|
||||||
<div class="level-title mt-20">
|
<div class="level-title mt-20">
|
||||||
<h1>吊装安全作业票</h1>
|
<h1>吊装安全作业票</h1>
|
||||||
<div class="level-code">编号:{{ pd.CHECK_NO }}</div>
|
<div class="level-btns">编号:{{ pd.CHECK_NO }}</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -60,7 +60,6 @@
|
||||||
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
||||||
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr/>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="bbg">风险辨识结果</td>
|
<td class="bbg">风险辨识结果</td>
|
||||||
<td colspan="5">{{ pd.HAZARD_IDENTIFICATION }}</td>
|
<td colspan="5">{{ pd.HAZARD_IDENTIFICATION }}</td>
|
||||||
|
@ -84,7 +83,7 @@
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
||||||
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -128,10 +127,10 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="bbg">接受交底人</td>
|
<td class="bbg">接受交底人</td>
|
||||||
<td colspan="10">
|
<td colspan="10">
|
||||||
<div v-for="item in imgList" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
<div v-if="pd.ACCEPT_CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
||||||
<span>签字:</span>
|
<span>签字:</span>
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<span>{{ item.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
<span>{{ pd.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -175,19 +174,19 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="imgList1.length>0">
|
<tr v-if="pd.ACCEPT_USER_SIGNER_PATH">
|
||||||
<td colspan="10">
|
<td colspan="6">
|
||||||
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
||||||
<div v-for="item in imgList1" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
<div style="text-align: right">
|
||||||
<span>签字:</span>
|
<span>签字:</span>
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
<span>{{ item.ACCEPT_USER_SIGNER_TIME }}</span>
|
<span>{{ pd.ACCEPT_USER_SIGNER_TIME }}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 100px"/>
|
<!-- <div class="ui-height" />-->
|
||||||
<div class="ui-foot">
|
<div class="ui-foot">
|
||||||
<!-- <el-button v-print="'#printTest'" v-if="pd.APPLY_STATUS==4">打 印</el-button>-->
|
<!-- <el-button v-print="'#printTest'" v-if="pd.APPLY_STATUS==4">打 印</el-button>-->
|
||||||
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
||||||
|
@ -205,8 +204,6 @@ export default {
|
||||||
HOISTING_ID: this.$parent.HOISTING_ID, // 主键ID
|
HOISTING_ID: this.$parent.HOISTING_ID, // 主键ID
|
||||||
pd: [], // 存放字段参数
|
pd: [], // 存放字段参数
|
||||||
measuresList: [],
|
measuresList: [],
|
||||||
imgList: [],
|
|
||||||
imgList1: [],
|
|
||||||
otherProtectiveMeasures: []
|
otherProtectiveMeasures: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -272,8 +269,6 @@ export default {
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.pd = data.pd // 参数map
|
this.pd = data.pd // 参数map
|
||||||
this.imgList = data.imgList
|
|
||||||
this.imgList1 = data.imgList1
|
|
||||||
this.measuresList = this.handleStr(data.measuresList) // 参数map
|
this.measuresList = this.handleStr(data.measuresList) // 参数map
|
||||||
this.pd.LEADER_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
this.pd.LEADER_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
||||||
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
||||||
|
@ -304,4 +299,6 @@ export default {
|
||||||
img
|
img
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
|
.app-container
|
||||||
|
margin-bottom: 50px
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<div>
|
<div>
|
||||||
<div id="printTest" class="app-container print-work">
|
<div id="printTest" class="app-container print-work">
|
||||||
<el-page-header content="审批表详情" class="no-print" @back="goBack"/>
|
<el-page-header content="审批表详情" class="no-print" @back="goBack"/>
|
||||||
<div v-for="pdf in 2" :key="pdf" :name="pdf === 2 ? 'pdf-box' : ''" class="pdf-content">
|
<table class="table-ui">
|
||||||
<table :class="['table-ui','table-ui' + pdf]">
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" style="border: none">
|
<td colspan="6" style="border: none">
|
||||||
<div class="level-title mt-20">
|
<div class="level-title mt-20">
|
||||||
|
@ -12,182 +12,182 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
</thead>
|
||||||
<td class="bbg">作业申请单位</td>
|
<tr>
|
||||||
<td>{{ pd.APPLY_DEPARTMENT_NAME }}</td>
|
<td class="bbg">作业申请单位</td>
|
||||||
<td class="bbg">作业单位</td>
|
<td>{{ pd.APPLY_DEPARTMENT_NAME }}</td>
|
||||||
<td>{{ pd.LEADER_DEPARTMENT_NAME }}</td>
|
<td class="bbg">作业单位</td>
|
||||||
<td class="bbg">作业申请时间</td>
|
<td>{{ pd.LEADER_DEPARTMENT_NAME }}</td>
|
||||||
<td>{{ pd.CREATTIME }}</td>
|
<td class="bbg">作业申请时间</td>
|
||||||
</tr>
|
<td>{{ pd.CREATTIME }}</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">吊装地点</td>
|
<tr>
|
||||||
<td>{{ pd.WORK_PLACE }}</td>
|
<td class="bbg">吊装地点</td>
|
||||||
<td class="bbg">吊具名称</td>
|
<td>{{ pd.WORK_PLACE }}</td>
|
||||||
<td>{{ pd.TOOL_NAME }}</td>
|
<td class="bbg">吊具名称</td>
|
||||||
<td class="bbg">吊物内容</td>
|
<td>{{ pd.TOOL_NAME }}</td>
|
||||||
<td>{{ pd.WORK_CONTENT }}</td>
|
<td class="bbg">吊物内容</td>
|
||||||
</tr>
|
<td>{{ pd.WORK_CONTENT }}</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">吊装作业人</td>
|
<tr>
|
||||||
<td>{{ pd.WORK_USER }}</td>
|
<td class="bbg">吊装作业人</td>
|
||||||
<td class="bbg">司索人</td>
|
<td>{{ pd.WORK_USER }}</td>
|
||||||
<td>{{ pd.SISUO_USER }}</td>
|
<td class="bbg">司索人</td>
|
||||||
<td class="bbg">监护人</td>
|
<td>{{ pd.SISUO_USER }}</td>
|
||||||
<td>
|
<td class="bbg">监护人</td>
|
||||||
<div v-if="pd.GUARDIAN_USER_SIGNER_PATH" style="text-align: right">
|
<td>
|
||||||
<span>签字:</span>
|
<div v-if="pd.GUARDIAN_USER_SIGNER_PATH" style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.GUARDIAN_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.GUARDIAN_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.GUARDIAN_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.GUARDIAN_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">指挥人员</td>
|
<tr>
|
||||||
<td>{{ pd.PROJECT_MANAGER }}</td>
|
<td class="bbg">指挥人员</td>
|
||||||
<td class="bbg" colspan="2">吊物质量(t)及作业级别</td>
|
<td>{{ pd.PROJECT_MANAGER }}</td>
|
||||||
<td colspan="2">
|
<td class="bbg" colspan="2">吊物质量(t)及作业级别</td>
|
||||||
<span>{{ pd.PART_WEIGHT }}t</span>
|
<td colspan="2">
|
||||||
<span style="margin-left: 20px;">
|
<span>{{ pd.PART_WEIGHT }}t</span>
|
||||||
{{ pd.WORK_LEVEL == '1' ? '一级作业级别' : '' }}
|
<span style="margin-left: 20px;">
|
||||||
{{ pd.WORK_LEVEL == '2' ? '二级作业级别' : '' }}
|
{{ pd.WORK_LEVEL == '1' ? '一级作业级别' : '' }}
|
||||||
{{ pd.WORK_LEVEL == '3' ? '三级作业级别' : '' }}
|
{{ pd.WORK_LEVEL == '2' ? '二级作业级别' : '' }}
|
||||||
</span>
|
{{ pd.WORK_LEVEL == '3' ? '三级作业级别' : '' }}
|
||||||
</td>
|
</span>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
<tr>
|
||||||
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
<td class="bbg">关联的其他特殊作业及安全作业票编号</td>
|
||||||
</tr>
|
<td colspan="5">{{ pd.SPECIAL_WORK }}</td>
|
||||||
<tr/><tr>
|
</tr>
|
||||||
<td class="bbg">风险辨识结果</td>
|
<tr>
|
||||||
<td colspan="5">{{ pd.HAZARD_IDENTIFICATION }}</td>
|
<td class="bbg">风险辨识结果</td>
|
||||||
</tr>
|
<td colspan="5">{{ pd.HAZARD_IDENTIFICATION }}</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">作业实施时间</td>
|
<tr>
|
||||||
<td colspan="5">{{ pd.WORK_START_DATE }}至{{ pd.WORK_END_DATE }}止</td>
|
<td class="bbg">作业实施时间</td>
|
||||||
</tr>
|
<td colspan="5">{{ pd.WORK_START_DATE }}至{{ pd.WORK_END_DATE }}止</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td colspan="6">
|
<tr>
|
||||||
<table class="table-ui">
|
<td colspan="6">
|
||||||
<tr>
|
<table class="table-ui">
|
||||||
<td>序号</td>
|
<tr>
|
||||||
<td>安全措施</td>
|
<td>序号</td>
|
||||||
<td>是否涉及</td>
|
<td>安全措施</td>
|
||||||
<td>确认人</td>
|
<td>是否涉及</td>
|
||||||
</tr>
|
<td>确认人</td>
|
||||||
<tr v-for="(item,index) in measuresList" :key="index">
|
</tr>
|
||||||
<td>{{ index + 1 }}</td>
|
<tr v-for="(item,index) in measuresList" :key="index">
|
||||||
<td>{{ item.PROTECTIVE_MEASURES }}</td>
|
<td>{{ index + 1 }}</td>
|
||||||
<td>
|
<td>{{ item.PROTECTIVE_MEASURES }}</td>
|
||||||
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
<td>
|
||||||
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
<span v-if="item.STATUS=='1'"><input type="radio" disabled checked>涉 及</span>
|
||||||
</td>
|
<span v-if="item.STATUS=='-1'"><input type="radio" disabled checked>不涉及</span>
|
||||||
<td>
|
</td>
|
||||||
{{ item.CONFIRM_NAME }}
|
<td>
|
||||||
</td>
|
{{ item.CONFIRM_NAME }}
|
||||||
</tr>
|
</td>
|
||||||
<tr v-if="pd.LEADER_USER_MEASURES || pd.CONFIRM_USER_MEASURES || pd.AUDIT_USER_MEASURES || pd.APPROVE_USER_MEASURES">
|
</tr>
|
||||||
<td>{{ measuresList.length + 1 }}</td>
|
<tr v-if="pd.LEADER_USER_MEASURES || pd.CONFIRM_USER_MEASURES || pd.AUDIT_USER_MEASURES || pd.APPROVE_USER_MEASURES">
|
||||||
<td colspan="3">
|
<td>{{ measuresList.length + 1 }}</td>
|
||||||
<div v-if="pd.LEADER_USER_MEASURES" style="display: flex;justify-content: space-between;">
|
<td colspan="2">
|
||||||
<span>其他安全措施:{{ pd.LEADER_USER_MEASURES }}</span>
|
<div v-if="pd.LEADER_USER_MEASURES" style="display: flex;justify-content: space-between;">
|
||||||
<span>编制人:{{ pd.LEADER_USER_NAME }}</span>
|
<span>其他安全措施:{{ pd.LEADER_USER_MEASURES }}</span>
|
||||||
</div>
|
<span>编制人:{{ pd.LEADER_USER_NAME }}</span>
|
||||||
<div v-if="pd.CONSTRUCTION_USER_ID && pd.CONFIRM_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
</div>
|
||||||
<span>其他安全措施:{{ pd.CONFIRM_USER_MEASURES }}</span>
|
<div v-if="pd.CONSTRUCTION_USER_ID && pd.CONFIRM_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
||||||
<span>编制人:{{ pd.CONSTRUCTION_USER_NAME }}</span>
|
<span>其他安全措施:{{ pd.CONFIRM_USER_MEASURES }}</span>
|
||||||
</div>
|
<span>编制人:{{ pd.CONSTRUCTION_USER_NAME }}</span>
|
||||||
<div v-if="pd.AUDIT_USER_ID && pd.AUDIT_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
</div>
|
||||||
<span>其他安全措施:{{ pd.AUDIT_USER_MEASURES }}</span>
|
<div v-if="pd.AUDIT_USER_ID && pd.AUDIT_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
||||||
<span>编制人:{{ pd.AUDIT_USER_NAME }}</span>
|
<span>其他安全措施:{{ pd.AUDIT_USER_MEASURES }}</span>
|
||||||
</div>
|
<span>编制人:{{ pd.AUDIT_USER_NAME }}</span>
|
||||||
<div v-if="pd.APPROVE_USER_ID && pd.APPROVE_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
</div>
|
||||||
<span>其他安全措施:{{ pd.APPROVE_USER_MEASURES }}</span>
|
<div v-if="pd.APPROVE_USER_ID && pd.APPROVE_USER_MEASURES" style="display: flex;justify-content: space-between;margin-top: 10px;">
|
||||||
<span>编制人:{{ pd.APPROVE_USER_NAME }}</span>
|
<span>其他安全措施:{{ pd.APPROVE_USER_MEASURES }}</span>
|
||||||
</div>
|
<span>编制人:{{ pd.APPROVE_USER_NAME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">安全交底人</td>
|
<tr>
|
||||||
<td colspan="10">
|
<td class="bbg">安全交底人</td>
|
||||||
<div v-if="pd.CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
<td colspan="10">
|
||||||
<span>签字:</span>
|
<div v-if="pd.CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.CONFESS_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.CONFESS_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td class="bbg">接受交底人</td>
|
<tr>
|
||||||
<td colspan="10">
|
<td class="bbg">接受交底人</td>
|
||||||
<div v-for="item in imgList" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
<td colspan="10">
|
||||||
<span>签字:</span>
|
<div v-if="pd.ACCEPT_CONFESS_USER_SIGNER_PATH" style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ item.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_CONFESS_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.ACCEPT_CONFESS_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td colspan="6">
|
<tr>
|
||||||
<div>作业指挥意见:{{ pd.LEADER_CONTENT }}</div>
|
<td colspan="6">
|
||||||
<div style="text-align: right">
|
<div>作业指挥意见:{{ pd.LEADER_CONTENT }}</div>
|
||||||
<span>签字:</span>
|
<div style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.LEADER_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.LEADER_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.LEADER_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.LEADER_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr v-if="pd.CONSTRUCTION_USER_ID">
|
</tr>
|
||||||
<td colspan="6">
|
<tr v-if="pd.CONSTRUCTION_USER_ID">
|
||||||
<div>所在单位意见:{{ pd.CONSTRUCTION_CONTENT }}</div>
|
<td colspan="6">
|
||||||
<div style="text-align: right">
|
<div>所在单位意见:{{ pd.CONSTRUCTION_CONTENT }}</div>
|
||||||
<span>签字:</span>
|
<div style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.CONSTRUCTION_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.CONSTRUCTION_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.CONSTRUCTION_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.CONSTRUCTION_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr v-if="pd.AUDIT_USER_ID">
|
</tr>
|
||||||
<td colspan="6">
|
<tr v-if="pd.AUDIT_USER_ID">
|
||||||
<div>审核部门意见:{{ pd.AUDIT_CONTENT }}</div>
|
<td colspan="6">
|
||||||
<div style="text-align: right">
|
<div>审核部门意见:{{ pd.AUDIT_CONTENT }}</div>
|
||||||
<span>签字:</span>
|
<div style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.AUDIT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.AUDIT_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.AUDIT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.AUDIT_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr v-if="pd.APPROVE_USER_ID">
|
</tr>
|
||||||
<td colspan="6">
|
<tr v-if="pd.APPROVE_USER_ID">
|
||||||
<div>审批部门意见:{{ pd.APPROVE_CONTENT }}</div>
|
<td colspan="6">
|
||||||
<div style="text-align: right">
|
<div>审批部门意见:{{ pd.APPROVE_CONTENT }}</div>
|
||||||
<span>签字:</span>
|
<div style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + pd.APPROVE_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ pd.APPROVE_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.APPROVE_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.APPROVE_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
<tr v-if="imgList1.length>0">
|
</tr>
|
||||||
<td colspan="10">
|
<tr>
|
||||||
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
<td colspan="6">
|
||||||
<div v-for="item in imgList1" :key="item.ACCEPT_CONFESS_ID" style="text-align: right">
|
<div>完工验收:{{ pd.ACCEPT_CONTENT }}</div>
|
||||||
<span>签字:</span>
|
<div style="text-align: right">
|
||||||
<img v-viewer :src="config.fileUrl + item.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
<span>签字:</span>
|
||||||
<span>{{ item.ACCEPT_USER_SIGNER_TIME }}</span>
|
<img v-viewer :src="config.fileUrl + pd.ACCEPT_USER_SIGNER_PATH" alt="" width="100" height="100">
|
||||||
</div>
|
<span>{{ pd.ACCEPT_USER_SIGNER_TIME }}</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 100px"/>
|
<div style="padding-top: 100px"/>
|
||||||
|
<!-- <div class="ui-height" />-->
|
||||||
<div class="ui-foot">
|
<div class="ui-foot">
|
||||||
<!-- <el-button v-print="'#printTest'" icon="el-icon-printer" type="primary">打 印</el-button>-->
|
<el-button v-print="'#printTest'" icon="el-icon-printer" type="primary">打 印</el-button>
|
||||||
<el-button type="primary" icon="el-icon-printer" @click="handle2PDF">PDF导出</el-button>
|
|
||||||
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
<el-button icon="el-icon-arrow-left" @click="goBack">返 回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -196,8 +196,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { requestFN } from '@/utils/request'
|
import { requestFN } from '@/utils/request'
|
||||||
import dateformat from '@/utils/dateformat'
|
import dateformat from '@/utils/dateformat'
|
||||||
import JsPDF from 'jspdf'
|
|
||||||
import html2Canvas from 'html2canvas'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -205,8 +203,6 @@ export default {
|
||||||
HOISTING_ID: this.$parent.HOISTING_ID, // 主键ID
|
HOISTING_ID: this.$parent.HOISTING_ID, // 主键ID
|
||||||
pd: [], // 存放字段参数
|
pd: [], // 存放字段参数
|
||||||
measuresList: [],
|
measuresList: [],
|
||||||
imgList: [],
|
|
||||||
imgList1: [],
|
|
||||||
otherProtectiveMeasures: []
|
otherProtectiveMeasures: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -214,85 +210,6 @@ export default {
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handle2PDF() {
|
|
||||||
const loading = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: '正在生成,请稍候...',
|
|
||||||
spinner: 'el-icon-loading',
|
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
|
||||||
})
|
|
||||||
const elements = document.querySelectorAll('div[name="pdf-box"]')
|
|
||||||
console.log(elements)
|
|
||||||
this.html2pdf(this.pd.CHECK_NO + '审批表详情', elements, loading)
|
|
||||||
},
|
|
||||||
|
|
||||||
html2pdf(filename, els, loading) {
|
|
||||||
const flagArr = []
|
|
||||||
for (let i = 0, len = els.length; i < len; i++) {
|
|
||||||
flagArr.push(0)
|
|
||||||
}
|
|
||||||
console.log(flagArr)
|
|
||||||
runself(0)
|
|
||||||
const pdf = new JsPDF('', 'pt', 'a4') // A4纸,纵向
|
|
||||||
function runself(index) {
|
|
||||||
const html = els[index]
|
|
||||||
html2Canvas(html, {
|
|
||||||
allowTaint: true,
|
|
||||||
taintTest: false,
|
|
||||||
logging: false,
|
|
||||||
useCORS: true,
|
|
||||||
scale: 2 // 按比例增加分辨率
|
|
||||||
}).then(canvas => {
|
|
||||||
// eslint-disable-next-line one-var
|
|
||||||
var ctx = canvas.getContext('2d'),
|
|
||||||
a4w = 532.28, a4h = 781.89, // A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277 pt:592.28 * 841.89
|
|
||||||
renderedHeight = 0
|
|
||||||
const allTrs = html.querySelectorAll('tr')
|
|
||||||
while (renderedHeight < canvas.height) {
|
|
||||||
let imgHeight = Math.floor(a4h * canvas.width / a4w) // 按A4显示比例换算一页图像的像素高度
|
|
||||||
for (let i = 0; i < allTrs.length; i++) {
|
|
||||||
const tr = allTrs[i]
|
|
||||||
const trHeight = tr.offsetHeight + tr.offsetTop
|
|
||||||
console.log('offsetHeight:' + tr.offsetHeight + 'offsetTop:' + tr.offsetTop + 'offsetParent:' + tr.offsetParent.offsetTop)
|
|
||||||
if (trHeight * 2 > (imgHeight + renderedHeight)) {
|
|
||||||
const btr = allTrs[i - 1]
|
|
||||||
const btrHeight = btr.offsetHeight + btr.offsetTop
|
|
||||||
console.log('i:' + (i - 1) + 'btrHeight:' + btrHeight)
|
|
||||||
imgHeight = btrHeight * 2 - renderedHeight
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var page = document.createElement('canvas')
|
|
||||||
page.width = canvas.width
|
|
||||||
page.height = Math.min(imgHeight, canvas.height - renderedHeight)// 可能内容不足一页
|
|
||||||
|
|
||||||
// 用getImageData剪裁指定区域,并画到前面创建的canvas对象中
|
|
||||||
page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0)
|
|
||||||
pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 30, 30, a4w, Math.min(a4h, a4w * page.height / page.width)) // 添加图像到页面,保留10mm边距
|
|
||||||
|
|
||||||
renderedHeight += imgHeight
|
|
||||||
if (renderedHeight < canvas.height) {
|
|
||||||
pdf.addPage()// 如果后面还有内容,添加一个空页
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index < els.length - 1) {
|
|
||||||
pdf.addPage()
|
|
||||||
}
|
|
||||||
return 1
|
|
||||||
}).then(item => {
|
|
||||||
flagArr[index] = item
|
|
||||||
if (flagArr.every(f => f === 1)) {
|
|
||||||
pdf.save(filename)
|
|
||||||
}
|
|
||||||
index++
|
|
||||||
if (index < els.length) {
|
|
||||||
runself(index)
|
|
||||||
} else {
|
|
||||||
loading.close()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleStr(measuresList) {
|
handleStr(measuresList) {
|
||||||
for (let i = 0; i < measuresList.length; i++) {
|
for (let i = 0; i < measuresList.length; i++) {
|
||||||
// 将字符串转成数组
|
// 将字符串转成数组
|
||||||
|
@ -351,8 +268,6 @@ export default {
|
||||||
).then((data) => {
|
).then((data) => {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.pd = data.pd // 参数map
|
this.pd = data.pd // 参数map
|
||||||
this.imgList = data.imgList
|
|
||||||
this.imgList1 = data.imgList1
|
|
||||||
this.measuresList = this.handleStr(data.measuresList)// 参数map
|
this.measuresList = this.handleStr(data.measuresList)// 参数map
|
||||||
this.pd.LEADER_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
this.pd.LEADER_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[0]
|
||||||
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
this.pd.CONFIRM_USER_MEASURES = this.pd.OTHER_PROTECTIVE_MEASURES.split(';_;')[1]
|
||||||
|
@ -384,27 +299,3 @@ export default {
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="scss">
|
|
||||||
.table-ui td{
|
|
||||||
line-height: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pdf-content[name=pdf-box]{
|
|
||||||
position: absolute;
|
|
||||||
left: -999999px;
|
|
||||||
.level-title {
|
|
||||||
h1{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.level-code{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
td{
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.bbg {
|
|
||||||
width: 180px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
Loading…
Reference in New Issue