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/EamThirdMaintenanceChangeBatchPrintModal.vue |  215 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/maintenance/modules/EamThirdMaintenanceChangeBatchPrintModal.vue b/src/views/eam/maintenance/modules/EamThirdMaintenanceChangeBatchPrintModal.vue
new file mode 100644
index 0000000..62c446a
--- /dev/null
+++ b/src/views/eam/maintenance/modules/EamThirdMaintenanceChangeBatchPrintModal.vue
@@ -0,0 +1,215 @@
+<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.zxfactoryOrgCode_dictText}}</div>
+              </td>
+              <td colspan="6" style="border: none;padding-right: 20px">
+                <div style="text-align: right">
+                  {{dataItem.applyDate.split('-')[0]}} 骞� {{dataItem.applyDate.split('-')[1]}} 鏈�
+                  {{dataItem.applyDate.split('-')[2]}} 鏃�
+                </div>
+              </td>
+            </tr>
+
+            <tr style="height: 40px;">
+              <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 style="height: 40px;">
+              <td colspan="2">鍘熻鍒掓椂闂�</td>
+              <td colspan="2">{{dataItem.oldPlanDate}}</td>
+              <td colspan="2">鐢宠寤朵繚鏃堕棿</td>
+              <td colspan="2">{{dataItem.deferredMaintenanceDate}}</td>
+              <td colspan="2">璁惧绠$悊涓荤</td>
+              <td colspan="2">{{dataItem.applicant_dictText}}</td>
+            </tr>
+
+            <tr>
+              <td colspan="2" style="padding: 5px">寤朵繚锛堟垨鍙樻洿锛夊師鍥�</td>
+              <td colspan="10" style="text-align: left;padding: 5px">
+                <div style="text-align: left" v-html="dataItem.equipmentManagerComment"></div>
+                <br/><br/><br/><br/>
+                <div style="text-align: right;padding-right: 20px">
+                  涓荤瀹ょ骇棰嗗绛惧瓧锛歿{dataItem.equipmentManagerSignature_dictText}}
+                </div>
+              </td>
+            </tr>
+
+            <tr>
+              <td colspan="2" style="padding: 5px">纭閮ㄩ棬</td>
+              <td colspan="10" style="padding: 5px">
+                <div style="text-align: left" v-html="dataItem.departManagerComment"></div>
+                <br/><br/><br/><br/>
+                <div style="text-align: right;padding-right: 20px">
+                  涓荤瀹ょ骇棰嗗绛惧瓧锛歿{dataItem.departManagerSignature_dictText}}
+                </div>
+              </td>
+            </tr>
+
+            <tr>
+              <td colspan="2" style="padding: 5px">鐢熶骇淇濋殰閮�</td>
+              <td colspan="10" style="padding: 5px">
+                <div style="text-align: left" v-html="dataItem.productionSupportComment"></div>
+                <br/><br/><br/><br/>
+                <div style="text-align: right;padding-right: 20px">
+                  涓荤瀹ょ骇棰嗗绛惧瓧锛歿{dataItem.productionSupportSignature_dictText}}
+                </div>
+              </td>
+            </tr>
+
+            <tr>
+              <td colspan="12" style="padding: 5px 40px;border: none;">
+                <div style="text-align: left">
+                  澶囨敞锛氱‘璁ら儴闂ㄤ负鐢熶骇鎸囨尌閮ㄣ�佽澶囩淮淇儴闂ㄣ�侀」鐩疄鏂介儴闂ㄣ�傚叾涓洜鐢熶骇浠诲姟绱ф�ユ棤娉曞仠鏈虹殑鎯呭喌椤荤粡鐢熶骇鎸囨尌閮ㄧ瀛�
+                </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: 'EamThirdMaintenanceChangeBatchPrintModal',
+    data() {
+      return {
+        visible: false,
+        spinning: false,
+        dataSource: [],
+        url: {
+          list: '/eam/eamThirdMaintenanceChange/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
+      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>
\ No newline at end of file

--
Gitblit v1.9.3