From a9f005e2af294c47d7cd1e4b6ed401bf65f5b080 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 04 三月 2025 16:44:09 +0800
Subject: [PATCH] art: 所有设备 台账 二保工单 根据设备id查询二保工单,并过滤掉已完成和已取消的二保工单

---
 src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue b/src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue
index c5f352f..f20be29 100644
--- a/src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue
+++ b/src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue
@@ -57,9 +57,9 @@
         :columns='columns'
         :dataSource='dataSource'
         :pagination='ipagination'
-        :rowSelection='rowSelection'
         :loading='loading'
         @change='handleTableChange'
+        :rowSelection='rowSelection'
       >
 
       </a-table>
@@ -129,6 +129,8 @@
 
       ],
       selectedRowKeys: [],
+      selectedRows: [],
+      selectionRowsNotClear: [],
       oldSelectRows: [],
       scrollTrigger: {},
       dataSource: [],
@@ -162,20 +164,29 @@
         type: 'checkbox',
         onChange: (selectedRowKeys, selectedRows) => {
           this.selectedRowKeys = selectedRowKeys
-          this.onSelectChange(selectedRows)
+        },
+        onSelect: (record, selected, selectedRows) => {
+          if (selected) {
+            this.selectionRowsNotClear.push(record);
+          }
+          if (!selected) {
+            let delIndex = this.selectionRowsNotClear.findIndex(val => {
+              return val.id === record.id
+            })
+            this.selectionRowsNotClear.splice(delIndex, 1);
+          }
         },
         getCheckboxProps: record => ({
           props: {
             disabled: record.distable
           }
         }),
-        selectedRowKeys: this.selectedRowKeys
+        selectedRowKeys: this.selectedRowKeys,
       }
     }
   },
 
   methods: {
-
     async loadData(arg) {
       if (arg === 1) {
         this.ipagination.current = 1
@@ -204,6 +215,8 @@
 
     showModals(oldSelectRows) {
       this.selectionRows = []
+      this.selectedRowKeys = []
+      this.selectionRowsNotClear = []
       this.oldSelectRows = oldSelectRows
       this.visible = true
       this.loadData(1)
@@ -229,7 +242,6 @@
       if (num !== 0) {
         that.loadData(1)
       }
-      that.selectborrowIds = []
     },
     close() {
       this.searchReset(0)
@@ -238,22 +250,24 @@
     },
     handleTableChange(pagination, filters, sorter) {
       //TODO 绛涢��
-
       if (Object.keys(sorter).length > 0) {
         this.isorter.column = sorter.field
         this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
       }
       this.ipagination = pagination
+
       this.loadData()
     },
     handleSubmit() {
-      this.$bus.$emit('selectionRows', this.selectionRows)
+      this.$bus.$emit('selectionRows', this.selectionRowsNotClear)
       this.searchReset(0)
       this.close()
     },
-    onSelectChange(selectionRows) {
-      this.selectionRows = selectionRows
+    onSelectionChange(selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys;
+      this.selectedRows = selectedRows;
     },
+
     searchQuery() {
       this.loadData(1)
     }

--
Gitblit v1.9.3