From b6d89c86d31ad156185893659913b92e4631d25c Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 21 八月 2025 17:35:49 +0800
Subject: [PATCH] 1、产品质量隐患确认表批量打印及导出功能 2、调整点检和二保批量打印功能代码

---
 src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue |  264 ++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 180 insertions(+), 84 deletions(-)

diff --git a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
index b325d22..a675c0b 100644
--- a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
+++ b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
@@ -38,23 +38,47 @@
 
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator" v-if="isDisplayOperation">
-      <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      <a-button @click="handleBatchAdd" type="primary" icon="plus">鎵归噺鏂板</a-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="handlerBatchAbolish">
-            <a-icon type="delete"/>
-            浣滃簾
-          </a-menu-item>
-          <a-menu-item key="2" @click="handlerBatchCollect">
-            <a-icon type="form"/>
-            棰嗗彇
-          </a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
-          <a-icon type="down"/>
-        </a-button>
-      </a-dropdown>
+      <a-button v-has="'secondMaintenanceOrder:add'" @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
+      <a-button v-has="'secondMaintenanceOrder:batchAdd'" @click="handleBatchAdd" type="primary" icon="plus">鎵归噺鏂板
+      </a-button>
+
+      <a-button v-has="'secondMaintenanceOrder:batchCollect'" @click="handlerBatchCollect" 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 v-has="'secondMaintenanceOrder:batchAbolish'" @click="handlerBatchAbolish" type="danger"
+                icon="delete" :disabled="selectedRowKeys.length===0">
+        鎵归噺浣滃簾
+      </a-button>
+      <a-button v-has="'secondMaintenanceOrder:batchRestore'" @click="handlerBatchRestore"
+                :disabled="selectedRowKeys.length===0" icon="reload">
+        鎵归噺杩樺師
+      </a-button>
+      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
+         <a-menu slot="overlay">
+           <a-menu-item v-has="'secondMaintenanceOrder:batchAbolish'" key="1" @click="handlerBatchAbolish">
+             <a-icon type="delete"/>
+             浣滃簾
+           </a-menu-item>
+           <a-menu-item v-has="'secondMaintenanceOrder:batchCollect'" key="2" @click="handlerBatchCollect">
+             <a-icon type="form"/>
+             棰嗗彇
+           </a-menu-item>
+           <a-menu-item v-has="'secondMaintenanceOrder:batchRestore'" key="3" @click="handlerBatchRestore">
+             <a-icon type="reload"/>
+             杩樺師
+           </a-menu-item>
+           <a-menu-item key="4" @click="handleBatchPrint">
+             <a-icon type="monitor"/>
+             棰勮
+           </a-menu-item>
+         </a-menu>
+         <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
+           <a-icon type="down"/>
+         </a-button>
+       </a-dropdown>-->
     </div>
 
 
@@ -71,30 +95,47 @@
                :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
         <span slot="action" slot-scope="text, record">
           <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'">
-            <a @click="handleEdit(record)">缂栬緫</a>
+            <a v-has="'secondMaintenanceOrder:edit'" @click="handleEdit(record)">缂栬緫</a>
 
-            <a-divider type="vertical"/>
+            <a-divider v-has="'secondMaintenanceOrder:edit'" type="vertical"/>
 
-            <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)">
+            <a-popconfirm v-has="'secondMaintenanceOrder:collect'" title="纭畾棰嗗彇鍚�?"
+                          @confirm="() => handlerCollect(record.id)">
               <a>棰嗗彇</a>
             </a-popconfirm>
 
-            <a-divider type="vertical"/>
+            <a-divider v-has="'secondMaintenanceOrder:collect'" type="vertical"/>
 
-            <a @click="handleDetail(record)">璇︽儏</a>
-
-            <a-divider type="vertical"/>
-
-            <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handlerAbolish(record.id)">
-              <a>浣滃簾</a>
-            </a-popconfirm>
-
+            <a-dropdown>
+            <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a-popconfirm v-has="'secondMaintenanceOrder:abolish'" title="纭畾浣滃簾鍚�?"
+                              @confirm="() => handlerAbolish(record.id)">
+                  <a>浣滃簾</a>
+                </a-popconfirm>
+              </a-menu-item>
+               <a-menu-item>
+                <a @click="handleDetail(record)">璇︽儏</a>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
           </template>
 
           <template v-else>
             <a @click="handleDetail(record)">璇︽儏</a>
-            <a-divider type="vertical" v-if="record.maintenanceStatus === 'COMPLETE'"/>
-            <a v-if="record.maintenanceStatus === 'COMPLETE'" @click="handlePrint(record)">鎵撳嵃</a>
+
+
+            <a-divider v-has="'secondMaintenanceOrder:restore'" v-if="record.maintenanceStatus === 'ABOLISH'"
+                       type="vertical"/>
+
+            <a-popconfirm v-has="'secondMaintenanceOrder:restore'" v-if="record.maintenanceStatus === 'ABOLISH'"
+                          title="纭畾杩樺師鍚�?" @confirm="() => handlerRestore(record.id)">
+              <a>杩樺師</a>
+            </a-popconfirm>
+
+            <a-divider type="vertical"/>
+            <a @click="handlePrint(record)">棰勮</a>
           </template>
         </span>
       </a-table>
@@ -104,10 +145,15 @@
     <!-- 琛ㄥ崟鍖哄煙 -->
     <eamSecondMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"/>
 
+    <!--鎵归噺鏂板-->
     <eam-second-maintenance-batch-order-modal ref="batchModalForm" @ok="modalFormOk"/>
 
+    <!--瀹℃壒寮圭獥-->
     <second-maintenance-approval-modal ref="secondMaintenanceApprovalModal"
                                        :selectShenpiData="selectSecondMaintenanceData"/>
+
+    <!--鎵归噺鎵撳嵃寮圭獥-->
+    <eam-second-maintenance-order-batch-print-modal ref="batchPrintModal"/>
   </a-card>
 </template>
 
@@ -119,11 +165,13 @@
     from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
   import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect'
   import EamSecondMaintenanceBatchOrderModal from './modules/EamSecondMaintenanceBatchOrderModal'
+  import EamSecondMaintenanceOrderBatchPrintModal from './modules/EamSecondMaintenanceOrderBatchPrintModal'
 
   export default {
     name: 'EamSecondMaintenanceOrderList',
     mixins: [JeecgListMixin],
     components: {
+      EamSecondMaintenanceOrderBatchPrintModal,
       EamSecondMaintenanceBatchOrderModal,
       LxSearchEquipmentSelect,
       EamSecondMaintenanceOrderModal,
@@ -172,6 +220,12 @@
             fixed: 'left'
           },
           {
+            title: '淇濆吇鐘舵��',
+            align: 'center',
+            dataIndex: 'maintenanceStatus_dictText',
+            fixed: 'left'
+          },
+          {
             title: '宸ュ崟鍙�',
             align: 'center',
             dataIndex: 'orderNum'
@@ -205,11 +259,6 @@
             title: '缁翠慨宸�',
             align: 'center',
             dataIndex: 'repairman_dictText'
-          },
-          {
-            title: '淇濆吇鐘舵��',
-            align: 'center',
-            dataIndex: 'maintenanceStatus_dictText'
           },
           {
             title: '鍒涘缓鏂瑰紡',
@@ -246,8 +295,10 @@
           list: '/eam/secondMaintenanceOrder/list',
           abolish: '/eam/secondMaintenanceOrder/abolish',
           collect: '/eam/secondMaintenanceOrder/collect',
+          restore: '/eam/secondMaintenanceOrder/restore',
           abolishBatch: '/eam/secondMaintenanceOrder/abolishBatch',
-          collectBatch: '/eam/secondMaintenanceOrder/collectBatch'
+          collectBatch: '/eam/secondMaintenanceOrder/collectBatch',
+          restoreBatch: '/eam/secondMaintenanceOrder/restoreBatch'
         }
       }
     },
@@ -269,7 +320,7 @@
     methods: {
       handleBatchAdd() {
         this.$refs.batchModalForm.title = '鎵归噺鏂板'
-        this.$refs.batchModalForm.visible = true
+        this.$refs.batchModalForm.add()
       },
 
       /**
@@ -306,7 +357,7 @@
         this.$refs.secondMaintenanceApprovalModal.title = '璇︽儏'
         this.$refs.secondMaintenanceApprovalModal.visible = true
         this.$refs.secondMaintenanceApprovalModal.disableSubmit = true
-        this.$refs.secondMaintenanceApprovalModal.recordDetail(record)
+        this.$refs.secondMaintenanceApprovalModal.handleDetail(record)
       },
 
       /**
@@ -314,9 +365,10 @@
        * @param record 鍒楄〃琛岃褰�
        */
       handlePrint(record) {
-        let href = `${window._CONFIG['domianURL']}/jmreport/view/1094834721929232384?id=` + record.id //缃戠珯閾炬帴
+        let href = `${window._CONFIG['domianURL']}/jmreport/view/1110733537193545728?id=` + record.id //缃戠珯閾炬帴
         window.open(href, '_blank')
       },
+
       handlerAbolish(id) {
         var that = this
         deleteAction(that.url.abolish, { id })
@@ -368,54 +420,98 @@
           }
         })
       },
-      //鎵归噺棰嗗彇
-      handlerBatchCollect() {
-        if (!this.url.collectBatch) {
-          this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!')
-          return
-        }
-        if (this.selectedRowKeys.length <= 0) {
-          // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒');
-          this.$notification.warning({
-            message: '娑堟伅',
-            description: '璇烽�夋嫨涓�鏉¤褰�'
-          })
-          return
-        } else {
-          var ids = ''
-          for (var a = 0; a < this.selectedRowKeys.length; a++) {
-            ids += this.selectedRowKeys[a] + ','
-          }
-          var that = this
-          this.$confirm({
-            title: '纭棰嗗彇',
-            content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?',
-            onOk: function() {
-              that.loading = true
-              deleteAction(that.url.collectBatch, { ids: ids }).then((res) => {
-                if (res.success) {
-                  //閲嶆柊璁$畻鍒嗛〉闂
-                  that.reCalculatePage(that.selectedRowKeys.length)
-                  // that.$message.success(res.message);
-                  that.$notification.success({
-                    message: '娑堟伅',
-                    description: res.message
-                  })
-                  that.loadData()
-                  that.onClearSelected()
-                } else {
-                  // that.$message.warning(res.message);
-                  that.$notification.warning({
-                    message: '娑堟伅',
-                    description: res.message
-                  })
-                }
-              }).finally(() => {
-                that.loading = false
+
+      //杩樺師
+      handlerRestore(id) {
+        let that = this
+        this.loading = true
+        getAction(that.url.restore, { id })
+          .then((res) => {
+            if (res.success) {
+              that.$notification.success({
+                message: '娑堟伅',
+                description: res.message
               })
+              that.loadData()
+            } else {
+              that.$notification.warning({
+                message: '娑堟伅',
+                description: res.message
+              })
+              this.loading = false
             }
           })
+      },
+
+      //鎵归噺杩樺師
+      handlerBatchRestore() {
+        var ids = ''
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ','
         }
+        var that = this
+        this.$confirm({
+          title: '纭杩樺師',
+          content: '鏄惁杩樺師閫変腑鏁版嵁锛屽彧鏈変綔搴熺姸鎬佺殑鏁版嵁鎵嶅彲杩樺師鎴愬姛?',
+          onOk: function() {
+            that.loading = true
+            deleteAction(that.url.restoreBatch, { ids: ids }).then((res) => {
+              if (res.success) {
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+                that.loadData()
+                that.onClearSelected()
+              } else {
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              }
+            }).finally(() => {
+              that.loading = false
+            })
+          }
+        })
+      },
+
+      //鎵归噺棰嗗彇
+      handlerBatchCollect() {
+        var ids = ''
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ','
+        }
+        var that = this
+        this.$confirm({
+          title: '纭棰嗗彇',
+          content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?',
+          onOk: function() {
+            that.loading = true
+            deleteAction(that.url.collectBatch, { ids: ids }).then((res) => {
+              if (res.success) {
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+                that.loadData()
+                that.onClearSelected()
+              } else {
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              }
+            }).finally(() => {
+              that.loading = false
+            })
+          }
+        })
+      },
+
+      // 鎵归噺鎵撳嵃
+      handleBatchPrint() {
+        this.$refs.batchPrintModal.handlePreview(this.selectedRowKeys.join())
       },
 
       onMaintenanceDateChange: function(dataArray) {

--
Gitblit v1.9.3