From 886748a39efb188d8008d41f2718eb78f3006ddd Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 18 七月 2025 17:08:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue |  304 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 271 insertions(+), 33 deletions(-)

diff --git a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
index b91805c..dd20db6 100644
--- a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
+++ b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue
@@ -39,12 +39,40 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <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-item key="3" @click="handlerBatchRestore">
+            <a-icon type="form"/>
+            杩樺師
+          </a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
+          <a-icon type="down"/>
+        </a-button>
+      </a-dropdown>
     </div>
+
 
     <!-- table鍖哄煙-begin -->
     <div>
-      <a-table size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination"
-               :loading="loading" :scroll="{ x: 'max-content' }" @change="handleTableChange">
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{selectedRowKeys.length
+        }}</a>椤�
+        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+      </div>
+
+      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
+               :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" :scroll="{x:'max-content'}"
+               :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>
@@ -57,15 +85,34 @@
 
             <a-divider type="vertical"/>
 
-            <a @click="handleDetail(record)">璇︽儏</a>
+            <a-dropdown>
+            <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleAbolish(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 v-if="record.maintenanceStatus === 'ABOLISH'" type="vertical"/>
+
+            <a-popconfirm v-if="record.maintenanceStatus === 'ABOLISH'" title="纭畾杩樺師鍚�?" @confirm="() => handlerRestore(record.id)">
+              <a>杩樺師</a>
+            </a-popconfirm>
+
             <a-divider type="vertical" v-if="record.maintenanceStatus === 'COMPLETE'"/>
             <a v-if="record.maintenanceStatus === 'COMPLETE'" @click="handlePrint(record)">鎵撳嵃</a>
           </template>
-
         </span>
       </a-table>
     </div>
@@ -73,6 +120,8 @@
 
     <!-- 琛ㄥ崟鍖哄煙 -->
     <eamSecondMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"/>
+
+    <eam-second-maintenance-batch-order-modal ref="batchModalForm" @ok="modalFormOk"/>
 
     <second-maintenance-approval-modal ref="secondMaintenanceApprovalModal"
                                        :selectShenpiData="selectSecondMaintenanceData"/>
@@ -86,11 +135,13 @@
   import SecondMaintenanceApprovalModal
     from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
   import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect'
+  import EamSecondMaintenanceBatchOrderModal from './modules/EamSecondMaintenanceBatchOrderModal'
 
   export default {
     name: 'EamSecondMaintenanceOrderList',
     mixins: [JeecgListMixin],
     components: {
+      EamSecondMaintenanceBatchOrderModal,
       LxSearchEquipmentSelect,
       EamSecondMaintenanceOrderModal,
       SecondMaintenanceApprovalModal
@@ -116,22 +167,26 @@
             align: 'center',
             customRender: function(t, r, index) {
               return parseInt(index) + 1
-            }
+            },
+            fixed: 'left'
           },
           {
             title: '缁熶竴缂栫爜',
             align: 'center',
-            dataIndex: 'equipmentCode'
+            dataIndex: 'equipmentCode',
+            fixed: 'left'
           },
           {
             title: '璁惧鍚嶇О',
             align: 'center',
-            dataIndex: 'equipmentName'
+            dataIndex: 'equipmentName',
+            fixed: 'left'
           },
           {
             title: '璁惧鍨嬪彿',
             align: 'center',
-            dataIndex: 'equipmentModel'
+            dataIndex: 'equipmentModel',
+            fixed: 'left'
           },
           {
             title: '宸ュ崟鍙�',
@@ -166,7 +221,7 @@
           {
             title: '缁翠慨宸�',
             align: 'center',
-            dataIndex: 'operator_dictText'
+            dataIndex: 'repairman_dictText'
           },
           {
             title: '淇濆吇鐘舵��',
@@ -181,7 +236,7 @@
           {
             title: '绠$悊鍛樼‘璁�',
             align: 'center',
-            dataIndex: 'confirmUser_dictText'
+            dataIndex: 'manageUser_dictText'
           },
           {
             title: '绠$悊鍛樼‘璁ゆ椂闂�',
@@ -191,12 +246,12 @@
           {
             title: '妫�鏌ヤ汉纭',
             align: 'center',
-            dataIndex: 'confirmLeader_dictText'
+            dataIndex: 'inspector_dictText'
           },
           {
             title: '妫�鏌ヤ汉纭鏃堕棿',
             align: 'center',
-            dataIndex: 'leaderConfirmTime'
+            dataIndex: 'inspectConfirmTime'
           },
           {
             title: 'HF缂栫爜',
@@ -207,7 +262,11 @@
         url: {
           list: '/eam/secondMaintenanceOrder/list',
           abolish: '/eam/secondMaintenanceOrder/abolish',
-          collect: '/eam/secondMaintenanceOrder/collect'
+          collect: '/eam/secondMaintenanceOrder/collect',
+          restore:'/eam/secondMaintenanceOrder/restore',
+          abolishBatch: '/eam/secondMaintenanceOrder/abolishBatch',
+          collectBatch: '/eam/secondMaintenanceOrder/collectBatch',
+          restoreBatch: '/eam/secondMaintenanceOrder/restoreBatch',
         }
       }
     },
@@ -227,17 +286,59 @@
       this.loadData(1)
     },
     methods: {
-      onMaintenanceDateChange: function(dataArray) {
-        this.queryParam.maintenanceDateBegin = dataArray[0]
-        this.queryParam.maintenanceDateEnd = dataArray[1]
+      handleBatchAdd() {
+        this.$refs.batchModalForm.title = '鎵归噺鏂板'
+        this.$refs.batchModalForm.visible = true
       },
+
       /**
        * 鐐瑰嚮棰嗗彇鏃惰Е鍙�
        * @param id 琛岃褰昳d
        */
       handlerCollect(id) {
         let that = this
+        this.loading = true
         getAction(that.url.collect, { 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
+            }
+          })
+      },
+
+      /**
+       * 鐐瑰嚮璇︽儏鏃惰Е鍙�
+       * @param record 鍒楄〃琛岃褰�
+       */
+      handleDetail(record) {
+        this.selectSecondMaintenanceData = Object.assign({}, record)
+        this.$refs.secondMaintenanceApprovalModal.title = '璇︽儏'
+        this.$refs.secondMaintenanceApprovalModal.visible = true
+        this.$refs.secondMaintenanceApprovalModal.disableSubmit = true
+        this.$refs.secondMaintenanceApprovalModal.recordDetail(record)
+      },
+
+      /**
+       * 鐐瑰嚮鎵撳嵃鏃惰Е鍙�
+       * @param record 鍒楄〃琛岃褰�
+       */
+      handlePrint(record) {
+        let href = `${window._CONFIG['domianURL']}/jmreport/view/1094834721929232384?id=` + record.id //缃戠珯閾炬帴
+        window.open(href, '_blank')
+      },
+      handlerAbolish(id) {
+        var that = this
+        deleteAction(that.url.abolish, { id })
           .then((res) => {
             if (res.success) {
               that.$notification.success({
@@ -253,25 +354,162 @@
             }
           })
       },
-
-      /**
-       * 鐐瑰嚮璇︽儏鏃惰Е鍙�
-       * @param record 鍒楄〃琛岃褰�
-       */
-      handleDetail(record) {
-        this.selectSecondMaintenanceData = Object.assign({}, record)
-        this.$refs.secondMaintenanceApprovalModal.recordDetail(record)
-        this.$refs.secondMaintenanceApprovalModal.title = '璇︽儏'
-        this.$refs.secondMaintenanceApprovalModal.disableSubmit = true
+      handlerBatchAbolish() {
+        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.abolishBatch, { 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
+              })
+          }
+        })
+      },
+      //杩樺師
+      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(){
+        if (!this.url.restoreBatch) {
+          this.$message.error('璇疯缃畊rl.restoreBatch灞炴��!')
+          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.restoreBatch, { 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
+              })
+            }
+          })
+        }
+      },
+      //鎵归噺棰嗗彇
+      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
+              })
+            }
+          })
+        }
       },
 
-      /**
-       * 鐐瑰嚮鎵撳嵃鏃惰Е鍙�
-       * @param record 鍒楄〃琛岃褰�
-       */
-      handlePrint(record) {
-        let href = `${window._CONFIG['domianURL']}/jmreport/view/1094834721929232384?id=` + record.id //缃戠珯閾炬帴
-        window.open(href, '_blank')
+      onMaintenanceDateChange: function(dataArray) {
+        this.queryParam.maintenanceDateBegin = dataArray[0]
+        this.queryParam.maintenanceDateEnd = dataArray[1]
       }
     }
   }

--
Gitblit v1.9.3