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 | 38 +++++++++++++++++++++++++++++++------- 1 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue b/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue index 7c37496..bd76e80 100644 --- a/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue +++ b/src/views/tms/modules/inboundOrder/JSelectToolingModal.vue @@ -83,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: [], @@ -109,6 +110,7 @@ scrollTrigger: {}, dataSource: [], selectionRows: [], + allSelectionRows: [], title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿', ipagination: { current: 1, @@ -138,7 +140,10 @@ rowSelection() { return { type: 'checkbox', + selectedRowKeys: this.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { + //鏇存柊璺ㄩ〉閫変腑鐘舵�� + this.updateSelection(selectedRows); this.selectedRowKeys = selectedRowKeys this.onSelectChange(selectedRows) }, @@ -154,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 @@ -182,6 +203,9 @@ }, showModal(oldSlelectRows) { this.oldSlelectRows = oldSlelectRows + //閲嶇疆璺ㄩ〉閫夋嫨鐘舵�� + this.allSelectionRows = []; + this.selectedRowKeys = []; this.visible = true this.loadData(1) }, @@ -222,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