From fdd08d56e9d84d2f9578e82c44578d099b29572f Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 12 九月 2025 17:38:24 +0800 Subject: [PATCH] 三保变更批量导出及打印 --- src/views/eam/maintenance/modules/EamThirdMaintenanceFurnaceBatchPrintModal.vue | 192 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 192 insertions(+), 0 deletions(-) diff --git a/src/views/eam/maintenance/modules/EamThirdMaintenanceFurnaceBatchPrintModal.vue b/src/views/eam/maintenance/modules/EamThirdMaintenanceFurnaceBatchPrintModal.vue new file mode 100644 index 0000000..4543e7c --- /dev/null +++ b/src/views/eam/maintenance/modules/EamThirdMaintenanceFurnaceBatchPrintModal.vue @@ -0,0 +1,192 @@ +<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="14" style="border: none"> + <div style="text-align: right">{{dataItem.hfCode}}</div> + </td> + </tr> + </thead> + + <tbody> + <tr style="height: 55px;"> + <td colspan="14">鐪熺┖鐑鐞嗙倝鏁翠綋鎬ц兘妫�娴嬭〃</td> + </tr> + + <tr style="height: 40px"> + <td colspan="4" style="border-right:none"> + <div style="text-align: left">鐢熶骇鍗曚綅锛歿{dataItem.zxfactoryOrgCode_dictText}}</div> + </td> + <td colspan="4" style="border:none"> + <div style="text-align: left">璁惧鍚嶇О锛歿{dataItem.equipmentName}}</div> + </td> + <td colspan="3" style="border:none"> + <div style="text-align: left">璁惧鍨嬪彿锛歿{dataItem.equipmentModel}}</div> + </td> + <td colspan="3" style="border-left:none"> + <div style="text-align: left">缁熶竴缂栫爜锛歿{dataItem.equipmentCode}}</div> + </td> + </tr> + + <tr style="height: 80px"> + <td colspan="3">鍘嬬缉绌烘皵鍘嬪姏锛圡Pa锛�</td> + <td colspan="2">鏋侀檺鐪熺┖锛圥a锛�</td> + <td colspan="2">娉勬紡鐜囷紙Pa/h锛�</td> + <td colspan="2">鍑�鍖栧鐞�</td> + <td colspan="3">鐐夋俯鍧囧寑鎬ф娴�</td> + <td colspan="2">鍔犵儹鍔熺巼娴嬭瘯</td> + </tr> + + <tr style="height: 100px"> + <td colspan="3">{{dataItem.compressedAirPressureValue}}</td> + <td colspan="2">{{dataItem.ultimateVacuumValue}}</td> + <td colspan="2">{{dataItem.leakRate}}</td> + <td colspan="2">{{dataItem.purificationTreatment}}</td> + <td colspan="3">{{dataItem.furnaceTemperatureUniformityTesting}}</td> + <td colspan="2">{{dataItem.heatingPowerTest}}</td> + </tr> + + <tr> + <td colspan="14" style="padding: 20px 100px;border: none"> + <div style="text-align: right"> + 鑳藉惁婊¤冻鍔犲伐闇�姹傦細{{dataItem.processingRequirementsFlag==='1'?'鑳斤紙鈭氾級鍚︼紙锛�':'鑳斤紙锛夊惁锛堚垰锛�'}} + </div> + <br/><br/> + <div style="text-align: right">鎵ц浜猴細<i>绗笁鏂圭淮鎶や汉鍛樼瀛�</i> {{dataItem.operator_dictText}} + </div> + <br/><br/> + <div style="text-align: right">纭浜猴細<i>绗笁鏂圭淮鎶ょ粍闀跨瀛�</i> {{dataItem.confirmUser_dictText}} + </div> + <br/><br/> + <div style="text-align: right">纭鏃堕棿锛歿{dataItem.confirmTime}}</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: 'EamThirdMaintenanceFurnaceBatchPrintModal', + data() { + return { + visible: false, + spinning: false, + dataSource: [], + url: { + list: '/eam/eamThirdMaintenanceFurnace/batchExport' + } + } + }, + methods: { + /** + * 鎵归噺棰勮 + * @param ids String 涓婚〉闈㈠垪琛ㄥ嬀閫塱ds + */ + 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 + }) + }, + + // 瀵煎嚭鍒癊xcel + handleExportToExcel() { + document.querySelectorAll('table.import-table').forEach(element => { + console.log('element', element.id) + $(element).table2excel({ + exclude: '.noExl', + name: 'Excel Document Name', + filename: '鐪熺┖鐑鐞嗙倝鏁翠綋鎬ц兘妫�娴嬭〃-' + element.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 { + writing-mode: vertical-lr; + letter-spacing: 5px; + padding: 5px 0; + } + } +</style> \ No newline at end of file -- Gitblit v1.9.3