<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">
|
|
<template v-if="tableType!==2">
|
<div style="page-break-before:always"></div>
|
|
<table class="import-table" :id="'加工设备三级保养验收单-'+dataItem.equipmentCode">
|
<thead>
|
<tr>
|
<td colspan="18" style="border: none;text-align: right">{{dataItem.hfCodeB}}</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="18" style="border: none;font-size: 20px">加工设备三级保养验收单</th>
|
</tr>
|
|
<tr>
|
<td colspan="3">设备类别</td>
|
<td colspan="6">{{dataItem.equipmentCategory_dictText}}</td>
|
|
<td colspan="3">设备编号</td>
|
<td colspan="6">{{dataItem.equipmentCode}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="3">设备名称</td>
|
<td colspan="6">{{dataItem.equipmentName}}</td>
|
|
<td colspan="3">设备型号</td>
|
<td colspan="6">{{dataItem.equipmentModel}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="3" rowspan="2">保养部位</td>
|
<td colspan="6" rowspan="2">保养内容</td>
|
<td colspan="3" rowspan="2">验收标准</td>
|
<td colspan="6">验收次数</td>
|
</tr>
|
|
<tr>
|
<td colspan="3">第一次检</td>
|
<td colspan="3">第二次检</td>
|
</tr>
|
|
<tr v-for="item in dataItem.eamThirdMaintenanceOrderDetailList">
|
<td colspan="3" :rowSpan="item.rowSpan" v-show="!item.rowSpanDis">{{item.itemPart}}</td>
|
<td colspan="6">{{item.itemName}}</td>
|
<td colspan="3">{{item.itemDemand}}</td>
|
<td colspan="3">{{+item.firstInspectResult?'√':'×'}}</td>
|
<td colspan="3">{{item.secondInspectResult}}</td>
|
</tr>
|
</tbody>
|
</table>
|
|
<div style="display:flex;justify-content: space-between; margin-top: 5px;padding: 0 20px">
|
<div>检查人员:{{dataItem.inspectorSignature_dictText}}</div>
|
<div>检查日期:{{dataItem.inspectTime}}</div>
|
</div>
|
</template>
|
|
<template v-if="tableType!==1">
|
<div style="page-break-before:always"></div>
|
|
<table class="import-table" :id="'加工设备三级保养完工移交单-'+dataItem.equipmentCode">
|
<thead>
|
<tr>
|
<td colspan="18" style="border: none;text-align: right">{{dataItem.hfCodeA}}</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="18" style="border: none;font-size: 20px">加工设备三级保养完工移交单</th>
|
</tr>
|
|
<tr>
|
<td colspan="3">设备名称</td>
|
<td colspan="3">{{dataItem.equipmentName}}</td>
|
<td colspan="3">设备型号</td>
|
<td colspan="3">{{dataItem.equipmentModel}}</td>
|
<td colspan="3">统一编号</td>
|
<td colspan="3">{{dataItem.equipmentCode}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="3">使用单位</td>
|
<td colspan="3">{{dataItem.factoryName}}</td>
|
<td colspan="3">保养日期</td>
|
<td colspan="9">{{dataItem.maintenanceDateFormatted}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="18" style="text-align: left;padding: 5px">
|
保养前技术状态<br/>
|
1、设备功能是否齐全:{{+dataItem.fullyFunctional===1?'是(√)否()':'是()否(√)'}}<br/>
|
2、设备能否正常运转,满足加工要求:{{+dataItem.runningNormally===1?'是(√)否()':'是()否(√)'}}<br/>
|
3、问题描述:{{dataItem.problemDescription}}
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="18" style="text-align: left;padding: 5px">
|
保养内容<br/>
|
1、按照三级保养规范进行保养。<br/>
|
2、对整改情况进行描述。
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="18" style="text-align: left;padding: 5px">
|
修理更换备件明细:
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="3">序号</td>
|
<td colspan="3">名称</td>
|
<td colspan="3">型号</td>
|
<td colspan="3">数量</td>
|
<td colspan="6">备注</td>
|
</tr>
|
|
<tr v-for="item in dataItem.eamThirdMaintenanceSpareList">
|
<td colspan="3">{{item.spareCode}}</td>
|
<td colspan="3">{{item.spareName}}</td>
|
<td colspan="3">{{item.spareModel}}</td>
|
<td colspan="3">{{item.spareQuantity}}</td>
|
<td colspan="6">{{item.remark}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="18" style="text-align: left;padding: 5px">
|
该设备经三级保养检查后,达到保养规范要求。
|
<br/><br/><br/>
|
<div style="display: flex;justify-content: space-between">
|
<div>操作人员:{{dataItem.operatorSignature_dictText}}</div>
|
<div>维修室主任:{{dataItem.repairManagerSignature_dictText}}</div>
|
<br/><br/><br/>
|
</div>
|
|
|
<div style="display: flex;justify-content: space-between">
|
<div>维修人员:{{dataItem.repairmanSignature_dictText}}</div>
|
<div>设备检验员:{{dataItem.inspectorSignature_dictText}}</div>
|
<br/>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</template>
|
</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: 'EamThirdMaintenanceOrderBatchPrintModal',
|
data() {
|
return {
|
visible: false,
|
spinning: false,
|
tableType: null,
|
dataSource: [
|
{
|
hfCode: 'HF-16548ASDSADA',
|
equipmentName: '手打十点多',
|
equipmentModel: '6500P',
|
equipmentCode: '2125400',
|
factoryName: '燃机厂',
|
maintenanceDateFormatted: '2025年5月20日'
|
|
}
|
],
|
url: {
|
list1: '/eam/thirdMaintenanceOrder/batchExportCheck',
|
list2: '/eam/thirdMaintenanceOrder/batchExport'
|
}
|
}
|
},
|
methods: {
|
/**
|
* 批量预览
|
* @param type String 展示类型
|
* @param ids String 主页面列表勾选ids
|
*/
|
handlePreview(type, ids) {
|
this.visible = true
|
this.spinning = true
|
this.dataSource = []
|
this.tableType = type
|
if (type === 3) {
|
this.displayAllTableType(ids)
|
return
|
}
|
const that = this
|
getAction(this.url['list' + type], { ids })
|
.then(res => {
|
if (res.success) {
|
that.dataSource = res.result
|
that.combineCell()
|
}
|
})
|
.finally(() => {
|
that.spinning = false
|
})
|
},
|
|
displayAllTableType(ids) {
|
const that = this
|
getAction(this.url.list1, { ids })
|
.then(res1 => {
|
if (res1.success) {
|
getAction(this.url.list2, { ids })
|
.then(res2 => {
|
if (res2.success) {
|
res1.result.forEach(item1 => {
|
for (let i = 0; i < res2.result.length; i++) {
|
if (item1.id === res2.result[i].id) {
|
console.log('res2', res2.result)
|
const dataItem = { ...item1, ...res2.result[i] }
|
that.dataSource.push(dataItem)
|
console.log('item1', item1)
|
break
|
}
|
}
|
})
|
that.combineCell()
|
}
|
})
|
.finally(() => {
|
that.spinning = false
|
})
|
}
|
})
|
|
},
|
|
// 合并
|
combineCell() {
|
this.dataSource.forEach(item => {
|
let list = item.eamThirdMaintenanceOrderDetailList
|
let k = 0
|
while (k < list.length) {
|
list[k]['rowSpan'] = 1
|
list[k]['rowSpanDis'] = false
|
for (var i = k + 1; i <= list.length - 1; i++) {
|
if (list[k]['itemPart'] === list[i]['itemPart'] && list[k]['itemPart'] !== '') {
|
list[k]['rowSpan']++
|
list[k]['rowSpanDis'] = false
|
list[i]['rowSpan'] = 1
|
list[i]['rowSpanDis'] = true
|
} else {
|
break
|
}
|
}
|
k = i
|
}
|
})
|
console.log('dataSource', this.dataSource)
|
},
|
|
handleImport() {
|
document.querySelectorAll('table.import-table').forEach(item => {
|
console.log('item', 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>
|