<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" :id="dataItem.equipmentCode">
|
<thead>
|
<tr>
|
<td colspan="12" style="border: none">
|
<div style="text-align: right">{{dataItem.hfCode}}</div>
|
</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="12" style="border: none;font-size: 20px">产品质量隐患确认表</th>
|
</tr>
|
|
<tr>
|
<td colspan="6" style="border: none;padding-left: 20px">
|
<div style="text-align: left">使用单位:{{dataItem.factoryName}}</div>
|
</td>
|
<td colspan="6" style="border: none;padding-right: 20px">
|
<div style="text-align: right">
|
{{dataItem.confirmTime.split('-')[0]}} 年 {{dataItem.confirmTime.split('-')[1]}} 月
|
{{dataItem.confirmTime.split('-')[2]}} 日
|
</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="2">设备名称</td>
|
<td colspan="2">{{dataItem.equipmentName}}</td>
|
<td colspan="2">设备型号</td>
|
<td colspan="2">{{dataItem.equipmentModel}}</td>
|
<td colspan="2">统一编号</td>
|
<td colspan="2">{{dataItem.equipmentCode}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="2">加工零件号</td>
|
<td colspan="2">{{dataItem.processingPart}}</td>
|
<td colspan="2">批次号</td>
|
<td colspan="2">{{dataItem.batchNumber}}</td>
|
<td colspan="2">件数</td>
|
<td colspan="2">{{dataItem.quantity}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="2" style="text-align: left;padding: 5px">设备故障现象描述</td>
|
<td colspan="10" style="text-align: left;padding: 5px">
|
<div style="text-align: left" v-html="dataItem.faultDescription.replace(/\n/g,'<br/>')"></div>
|
<br/><br/>
|
<div style="text-align: right;padding-right: 20px">操作人员签字:{{dataItem.confirmer_dictText}}</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="2" style="text-align: left;padding: 5px">设备故障对产品质量影响分析</td>
|
<td colspan="10" style="padding: 5px">
|
<div style="text-align: left">产品损失情况:{{+dataItem.technologistResult===1?'是(√)否()':'是()否(√)'}}</div>
|
<div style="text-align: left">产品损失质量影响分析:</div>
|
<div style="text-align: left" v-html="dataItem.qualityAnalysis.replace(/\n/g,'<br/>')"></div>
|
<br/><br/>
|
<div style="text-align: right;padding-right: 20px">主管工艺签字:{{dataItem.technologist_dictText}}</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="12" style="padding: 5px">
|
<div style="text-align:left;">{{dataItem.deputyDepartmentComment}}</div>
|
<br/><br/>
|
<div style="text-align: right;padding-right: 20px">签字(副部级以上领导):{{dataItem.deputyDepartment_dictText}}
|
</div>
|
<br/>
|
<div style="text-align: right;padding-right: 20px">
|
{{dataItem.deputyDepartmentTime.split('-')[0]}} 年 {{dataItem.deputyDepartmentTime.split('-')[1]}} 月
|
{{dataItem.deputyDepartmentTime.split('-')[2]}} 日
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</a-spin>
|
|
<template slot="footer">
|
<a-button @click="handleCancel">关闭</a-button>
|
<a-button type="primary" @click="handleImport">导出</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: 'EamProductHazardsBatchPrintModal',
|
data() {
|
return {
|
visible: false,
|
spinning: false,
|
dataSource: [
|
{
|
hfCode: 'HF-16548ASDSADA',
|
equipmentName: '手打十点多',
|
equipmentModel: '6500P',
|
equipmentCode: '2125400',
|
factoryName: '燃机厂',
|
maintenanceDateFormatted: '2025年5月20日'
|
|
}
|
],
|
url: {
|
list: '/eam/eamReportProductHazards/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
|
handleImport() {
|
document.querySelectorAll('table.import-table').forEach(item => {
|
$(item).table2excel({
|
exclude: '.noExl',
|
name: 'Excel Document Name',
|
filename: '产品质量隐患确认表-' + item.id,
|
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>
|