From 7fbe0f95cf428eb516f9015adae8bbe4baf539d4 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期五, 25 七月 2025 11:01:15 +0800
Subject: [PATCH] 安灯管理列表筛选条件修改

---
 src/views/tms/modules/inboundOrder/JSelectToolingModal.vue |   45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue b/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue
index 0ccb752..bd76e80 100644
--- a/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue
+++ b/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue
@@ -60,7 +60,11 @@
 export default {
   name: 'JSelectToolingModal',
   components: {},
-  props: {},
+  props: {
+    classifyId:{
+        type:String
+      }
+  },
   data() {
     return {
       queryParam: {},
@@ -79,25 +83,26 @@
           title: '宸ュ叿缂栫爜',
           align: 'center',
           dataIndex: 'toolCode',
-          sorter: true,
         },
         {
           title: '宸ュ叿鍚嶇О',
           align: 'center',
           dataIndex: 'chineseName',
-          sorter: true,
         },
         {
-          title: '宸ュ叿绫诲瀷',
+          title: '搴撲綅鍙�',
           align: 'center',
-          dataIndex: 'applicationTypeName',
-          sorter: true,
+          dataIndex: 'positionCode',
         },
         {
           title: '鍨嬪彿/鍥惧彿',
           align: 'center',
           dataIndex: 'toolModel',
-          sorter: true,
+        },
+        {
+          title: '宸ュ叿绫诲瀷',
+          align: 'center',
+          dataIndex: 'applicationTypeName',
         },
       ],
       selectedRowKeys: [],
@@ -105,6 +110,7 @@
       scrollTrigger: {},
       dataSource: [],
       selectionRows: [],
+      allSelectionRows: [],
       title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿',
       ipagination: {
         current: 1,
@@ -134,7 +140,10 @@
     rowSelection() {
       return {
         type: 'checkbox',
+        selectedRowKeys: this.selectedRowKeys,
         onChange: (selectedRowKeys, selectedRows) => {
+          //鏇存柊璺ㄩ〉閫変腑鐘舵��
+          this.updateSelection(selectedRows);
           this.selectedRowKeys = selectedRowKeys
           this.onSelectChange(selectedRows)
         },
@@ -150,6 +159,22 @@
   watch: {},
   created() {},
   methods: {
+    // 鏇存柊璺ㄩ〉閫変腑鐘舵��
+    updateSelection(selectedRows) {
+      // 鑾峰彇褰撳墠椤垫墍鏈夎鐨処D
+      const currentPageIds = this.dataSource.map(item => item.id);
+      
+      // 1. 绉婚櫎褰撳墠椤典箣鍓嶇殑閫夋嫨
+      this.allSelectionRows = this.allSelectionRows.filter(
+        row => !currentPageIds.includes(row.id)
+      );
+      
+      // 2. 娣诲姞褰撳墠椤垫柊閫夋嫨鐨勮
+      this.allSelectionRows = [...this.allSelectionRows, ...selectedRows];
+      
+      // 3. 鏇存柊閫変腑keys
+      this.selectedRowKeys = this.allSelectionRows.map(row => row.id);
+    },
     async loadData(arg) {
       if (arg === 1) {
         this.ipagination.current = 1
@@ -157,6 +182,7 @@
       let that = this
       this.loading = true
       let params = this.getQueryParams() //鏌ヨ鏉′欢
+      params.classifyId = this.classifyId
       await getAction(this.url.list, params).then((res) => {
         if (res.success) {
           for (let i = 0; i < res.result.records.length; i++) {
@@ -177,6 +203,9 @@
     },
     showModal(oldSlelectRows) {
       this.oldSlelectRows = oldSlelectRows
+       //閲嶇疆璺ㄩ〉閫夋嫨鐘舵��
+      this.allSelectionRows = [];
+      this.selectedRowKeys = [];
       this.visible = true
       this.loadData(1)
     },
@@ -217,7 +246,7 @@
       this.loadData()
     },
     handleSubmit() {
-      this.$bus.$emit('selectionRows', this.selectionRows)
+      this.$bus.$emit('selectionRows', this.allSelectionRows);
       this.searchReset(0)
       this.close()
     },

--
Gitblit v1.9.3