<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="5" style="border: none">
|
<div style="text-align: right">{{dataItem.hfCodeB}}</div>
|
</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="5" style="border: none;font-size: 20px">加工设备三级保养验收单</th>
|
</tr>
|
|
<tr>
|
<td>设备类别</td>
|
<td>{{dataItem.equipmentCategory_dictText}}</td>
|
<td>设备编号</td>
|
<td colspan="2">{{dataItem.equipmentCode}}</td>
|
</tr>
|
|
<tr>
|
<td>设备名称</td>
|
<td>{{dataItem.equipmentName}}</td>
|
<td>设备型号</td>
|
<td colspan="2">{{dataItem.equipmentModel}}</td>
|
</tr>
|
|
<tr>
|
<td rowspan="2">保养部位</td>
|
<td rowspan="2">保养内容</td>
|
<td rowspan="2">验收标准</td>
|
<td colspan="2">验收次数</td>
|
</tr>
|
|
<tr>
|
<td>第一次检</td>
|
<td>第二次检</td>
|
</tr>
|
|
<tr v-for="item in dataItem.eamThirdMaintenanceOrderDetailList">
|
<td :rowSpan="item.rowSpan" v-if="!item.rowSpanDis">{{item.itemPart}}</td>
|
<td>{{item.itemName}}</td>
|
<td>{{item.itemDemand}}</td>
|
<td>{{+item.firstInspectResult?'√':'×'}}</td>
|
<td>{{item.secondInspectResult}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="3" style="border: none">
|
<div style="text-align: left">检查人员:{{dataItem.inspectorSignature_dictText}}</div>
|
</td>
|
<td colspan="2" style="border: none">
|
<div style="text-align:right">检查日期:{{dataItem.inspectTime}}</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</template>
|
|
<br v-if="tableType===3"/>
|
|
<template v-if="tableType!==1">
|
<div style="page-break-before:always"></div>
|
|
<table class="import-table" :id="'加工设备三级保养完工移交单-'+dataItem.equipmentCode">
|
<thead>
|
<tr>
|
<td colspan="12" style="border-color: transparent">
|
<div style="text-align: right">{{dataItem.hfCodeA}}</div>
|
</td>
|
</tr>
|
</thead>
|
|
<tbody>
|
<tr style="height: 48px;">
|
<th colspan="12" style="border-color: transparent transparent #000 transparent;font-size: 20px;">
|
加工设备三级保养完工移交单
|
</th>
|
</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.factoryName}}</td>
|
<td colspan="2">保养日期</td>
|
<td colspan="6">{{dataItem.maintenanceDateFormatted}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="12" style="padding: 5px">
|
<div style="text-align: left;">保养前技术状态</div>
|
<div style="text-align: left;">1、设备功能是否齐全:{{+dataItem.fullyFunctional===1?'是(√)否()':'是()否(√)'}}</div>
|
<div style="text-align: left;">
|
2、设备能否正常运转,满足加工要求:{{+dataItem.runningNormally===1?'是(√)否()':'是()否(√)'}}
|
</div>
|
<div style="text-align: left;">3、问题描述:{{dataItem.problemDescription}}</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="12" style="padding: 5px">
|
<div style="text-align: left;">保养内容</div>
|
<div style="text-align: left;">1、按照三级保养规范进行保养。</div>
|
<div style="text-align: left;">2、对整改情况进行描述。</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="12" style="padding: 5px">
|
<div style="text-align: left;">修理更换备件明细:</div>
|
</td>
|
</tr>
|
|
<tr>
|
<td colspan="2">序号</td>
|
<td colspan="2">名称</td>
|
<td colspan="2">型号</td>
|
<td colspan="2">数量</td>
|
<td colspan="4">备注</td>
|
</tr>
|
|
<tr v-for="item in dataItem.eamThirdMaintenanceSpareList">
|
<td colspan="2">{{item.spareCode}}</td>
|
<td colspan="2">{{item.spareName}}</td>
|
<td colspan="2">{{item.spareModel}}</td>
|
<td colspan="2">{{item.spareQuantity}}</td>
|
<td colspan="4">{{item.remark}}</td>
|
</tr>
|
|
<tr>
|
<td colspan="12" style="padding: 5px">
|
<div style="text-align: left;">该设备经三级保养检查后,达到保养规范要求。</div>
|
<br/><br/>
|
<template v-if="handleMethod===1">
|
<div style="text-align: left">
|
<span>操作人员:{{dataItem.operatorSignature_dictText}}</span>
|
<span v-for="item in 30"> </span>
|
<span>维修室主任:{{dataItem.repairManagerSignature_dictText}}</span>
|
</div>
|
<br/><br/>
|
<div style="text-align: left">
|
<span>维修人员:{{dataItem.repairmanSignature_dictText}}</span>
|
<span v-for="item in 30"> </span>
|
<span>设备检验员:{{dataItem.inspectorSignature_dictText}}</span>
|
</div>
|
</template>
|
|
<template v-if="handleMethod===2">
|
<div style="text-align: left">
|
<span style="margin-right: 50%">操作人员:{{dataItem.operatorSignature_dictText}}</span>
|
<span>维修室主任:{{dataItem.repairManagerSignature_dictText}}</span>
|
</div>
|
<br/><br/>
|
<div style="text-align: left">
|
<span style="margin-right: 50%">维修人员:{{dataItem.repairmanSignature_dictText}}</span>
|
<span>设备检验员:{{dataItem.inspectorSignature_dictText}}</span>
|
</div>
|
</template>
|
<br/>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</template>
|
</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" @click="handleMethod = 2" 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,
|
handleMethod: 2,
|
dataSource: [],
|
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) {
|
const dataItem = { ...item1, ...res2.result[i] }
|
that.dataSource.push(dataItem)
|
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
|
}
|
})
|
},
|
|
// 导出到Excel
|
handleExportToExcel() {
|
this.handleMethod = 1
|
this.$nextTick(() => {
|
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>
|