<template>
|
<j-modal title="预览(仅可预览已完成工单)" :width="948" :visible="visible" switchFullscreen centered
|
:mask-closable="false" @cancel="handleCancel" cancelText="关闭">
|
<a-spin :spinning="spinning" style="height: 100%">
|
<div id="dataTable">
|
|
<div v-for="dataItem in dataSource" class="table-container">
|
<div style="page-break-before:always"></div>
|
|
<table class="import-table">
|
<thead>
|
<tr>
|
<td colspan="10" style="border: none;">
|
<div style="text-align: right">{{dataItem.hfCode}}</div>
|
</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="10" style="border: none;font-size: 20px">“三不放过的原则”分析表</th>
|
</tr>
|
|
<tr>
|
<th colspan="10" style="border: none;font-size: 20px;">
|
<div style="text-align: left">“三不放过的原则”分析:</div>
|
<div style="text-align: left">1、事故原因分析不清不放过。</div>
|
<div style="text-align: left">2、责任者和群众未受到教育不放过。</div>
|
<div style="text-align: left">3、没有防范措施不放过。</div>
|
</th>
|
</tr>
|
|
<tr style="height: 35px">
|
<td colspan="10">
|
<div style="text-align: left">事故原因分析:{{dataItem.causeAnalysis}}</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="10" style="padding: 5px">
|
<div style="text-align: left">
|
是否对操作者及相关责任人进行培训教育:{{+dataItem.isTrainingEducation===1?'是(√)否()':'是()否(√)'}}
|
</div>
|
<div style="text-align: left">培训形式:{{dataItem.trainingFormat}}</div>
|
<div style="text-align: left">培训内容包括:</div>
|
<div style="text-align: left" v-html="dataItem.trainingContent.replace(/\n/g,'<br/>')"></div>
|
<template v-for="item in 5-dataItem.trainingContent.split('\n').length"><br/></template>
|
<div style="text-align: left">接受培训人员签字:{{dataItem.trainingUser_dictText}}</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="10" style="padding: 5px">
|
<div style="text-align: left">目前已实施()预计实施()的预防措施</div>
|
<div style="text-align: left" v-html="dataItem.preventionMeasures.replace(/\n/g,'<br/>')"></div>
|
<template v-for="item in 5-dataItem.preventionMeasures.split('\n').length"><br/></template>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="5" style="border: none">
|
<div style="text-align: left">填写人:{{dataItem.createBy_dictText}}</div>
|
</td>
|
<td colspan="5" style="border: none">
|
<div style="text-align: right">单位领导:{{dataItem.unitLeader_dictText}}</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</a-spin>
|
|
<template slot="footer">
|
<a-button @click="handleCancel">关闭</a-button>
|
<a-button type="primary" @click="handleExportToExcel">导出</a-button>
|
<a-button type="primary" v-print="'#dataTable'">打印</a-button>
|
</template>
|
</j-modal>
|
</template>
|
|
<script>
|
import { getAction } from '@/api/manage'
|
import $ from 'jquery'
|
import '@/components/table2excel/table2excel'
|
|
export default {
|
name: 'EamThreeNoSpareAnalysisBatchPrintModal',
|
data() {
|
return {
|
visible: false,
|
spinning: false,
|
dataSource: [],
|
url: {
|
list: '/eam/eamReportThreeNoSpare/batchExport'
|
}
|
}
|
},
|
methods: {
|
/**
|
* 批量预览
|
* @param ids String 主页面列表勾选ids
|
*/
|
handlePreview(ids) {
|
this.visible = true
|
this.spinning = true
|
this.dataSource = []
|
const that = this
|
getAction(this.url.list, { ids })
|
.then(res => {
|
if (res.success) that.dataSource = res.result
|
})
|
.finally(() => {
|
that.spinning = false
|
})
|
},
|
|
// 导出到Excel
|
handleExportToExcel() {
|
document.querySelectorAll('table.import-table').forEach(item => {
|
$(item).table2excel({
|
exclude: '.noExl',
|
name: 'Excel Document Name',
|
filename: '“三不放过的原则”分析表-',
|
exclude_img: true,
|
fileext: '.xls',
|
exclude_links: true,
|
exclude_inputs: false
|
})
|
})
|
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
if (this.$refs.form) this.$refs.form.clearValidate()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
/deep/ .ant-modal {
|
height: 90%;
|
overflow: hidden;
|
|
.ant-modal-content {
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
overflow: hidden;
|
|
::-webkit-scrollbar {
|
width: 8px;
|
height: 8px;
|
}
|
|
.ant-modal-body {
|
flex: 1;
|
overflow: auto;
|
}
|
}
|
}
|
|
.table-container:not(:last-child) {
|
margin-bottom: 20px;
|
}
|
|
table {
|
width: 100%;
|
text-align: center;
|
table-layout: fixed;
|
|
td, th {
|
border: 1px solid #000;
|
}
|
|
td.vertical-display {
|
transform: rotate(360deg);
|
writing-mode: vertical-lr;
|
letter-spacing: 5px;
|
padding: 10px 0;
|
}
|
}
|
</style>
|