From b99765f7cba95796975ea26f5d8a079d09b29660 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 12 九月 2025 13:41:36 +0800
Subject: [PATCH] 真空热处理炉三保批量导出及打印

---
 src/views/eam/maintenance/modules/EamThirdMaintenanceFurnaceBatchPrintModal.vue |  192 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/eam/maintenance/EamThirdMaintenanceFurnaceList.vue                    |   31 ++++---
 2 files changed, 208 insertions(+), 15 deletions(-)

diff --git a/src/views/eam/maintenance/EamThirdMaintenanceFurnaceList.vue b/src/views/eam/maintenance/EamThirdMaintenanceFurnaceList.vue
index 5387ea4..e71b4d4 100644
--- a/src/views/eam/maintenance/EamThirdMaintenanceFurnaceList.vue
+++ b/src/views/eam/maintenance/EamThirdMaintenanceFurnaceList.vue
@@ -40,21 +40,12 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="handleBatchCollect">
-            <a-icon type="form"/>
-            棰嗗彇
-          </a-menu-item>
-          <a-menu-item key="1" @click="handleBatchAbolish">
-            <a-icon type="delete"/>
-            浣滃簾
-          </a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
-          <a-icon type="down"/>
-        </a-button>
-      </a-dropdown>
+      <a-button @click="handleBatchCollect" type="primary" icon="form" :disabled="selectedRowKeys.length===0">鎵归噺棰嗗彇
+      </a-button>
+      <a-button @click="handleBatchPrint" type="primary" icon="monitor" :disabled="selectedRowKeys.length===0">鎵归噺棰勮
+      </a-button>
+      <a-button @click="handleBatchAbolish" type="primary" icon="delete" :disabled="selectedRowKeys.length===0">鎵归噺浣滃簾
+      </a-button>
     </div>
 
     <!-- table鍖哄煙-begin -->
@@ -109,6 +100,9 @@
     <!--瀹℃壒绐楀彛-->
     <third-maintenance-furnace-approval-modal ref="thirdMaintenanceFurnaceApprovalModal"
                                               :selectShenpiData="selectedRowData"/>
+
+    <!--鎵归噺鎵撳嵃绐楀彛-->
+    <eam-third-maintenance-furnace-batch-print-modal ref="batchPrintModal"/>
   </a-card>
 </template>
 
@@ -119,11 +113,13 @@
   import { getAction, deleteAction } from '@/api/manage'
   import ThirdMaintenanceFurnaceApprovalModal
     from '../../flowable/workflow/thirdMaintenance/ThirdMaintenanceFurnaceApprovalModal'
+  import EamThirdMaintenanceFurnaceBatchPrintModal from './modules/EamThirdMaintenanceFurnaceBatchPrintModal'
 
   export default {
     name: 'EamThirdMaintenanceFurnaceList',
     mixins: [JeecgListMixin],
     components: {
+      EamThirdMaintenanceFurnaceBatchPrintModal,
       ThirdMaintenanceFurnaceApprovalModal,
       LxSearchEquipmentSelect,
       EamThirdMaintenanceFurnaceModal
@@ -333,6 +329,11 @@
         })
       },
 
+      // 鎵归噺鎵撳嵃
+      handleBatchPrint() {
+        this.$refs.batchPrintModal.handlePreview(this.selectedRowKeys.join())
+      },
+
       /**
        * 鐐瑰嚮浣滃簾鏃惰Е鍙�
        * @param id 琛岃褰昳d
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>&nbsp;&nbsp;{{dataItem.operator_dictText}}
+                </div>
+                <br/><br/>
+                <div style="text-align: right">纭浜猴細<i>绗笁鏂圭淮鎶ょ粍闀跨瀛�</i>&nbsp;&nbsp;{{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