| | |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="中文名称"> |
| | | <a-input placeholder="请输入中文名称,支持模糊查询" v-model="queryParam.chineseName"></a-input> |
| | | <a-form-item label="标记"> |
| | | <a-input placeholder="请输入标记,支持模糊查询" v-model="queryParam.groupCompanySign"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="型号/图号"> |
| | | <a-input placeholder="请输入规格型号,支持模糊查询" v-model="queryParam.toolModel"></a-input> |
| | | <a-form-item label="工具简称"> |
| | | <a-input placeholder="请输入工具简称" v-model="queryParam.shortCalled"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | |
| | | title: '工具编码', |
| | | align: 'center', |
| | | dataIndex: 'toolCode', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: '工具名称', |
| | | align: 'center', |
| | | dataIndex: 'chineseName', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: '工具类型', |
| | | title: '工具简称', |
| | | align: 'center', |
| | | dataIndex: 'applicationTypeName', |
| | | sorter: true, |
| | | dataIndex: 'shortCalled', |
| | | }, |
| | | { |
| | | title: '标记', |
| | | align: 'center', |
| | | dataIndex: 'groupCompanySign', |
| | | }, |
| | | { |
| | | title: '库位号', |
| | | align: 'center', |
| | | dataIndex: 'positionCode', |
| | | }, |
| | | { |
| | | title: '型号/图号', |
| | | align: 'center', |
| | | dataIndex: 'toolModel', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: '工具类型', |
| | | align: 'center', |
| | | dataIndex: 'applicationTypeName', |
| | | }, |
| | | ], |
| | | selectedRowKeys: [], |
| | |
| | | scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectionRows: [], |
| | | allSelectionRows: [], |
| | | title: '根据查询结果选择工具', |
| | | ipagination: { |
| | | current: 1, |
| | |
| | | loading: false, |
| | | url: { |
| | | // list: '/base/tooling/list', |
| | | list: '/tms/baseTools/paraCommonToolList', |
| | | list: '/tms/baseTools/selectToolList', |
| | | }, |
| | | } |
| | | }, |
| | |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | //更新跨页选中状态 |
| | | this.updateSelection(selectedRows); |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.onSelectChange(selectedRows) |
| | | }, |
| | |
| | | watch: {}, |
| | | created() {}, |
| | | methods: { |
| | | // 更新跨页选中状态 |
| | | updateSelection(selectedRows) { |
| | | // 获取当前页所有行的ID |
| | | 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 |
| | |
| | | }, |
| | | showModal(oldSlelectRows) { |
| | | this.oldSlelectRows = oldSlelectRows |
| | | //重置跨页选择状态 |
| | | this.allSelectionRows = []; |
| | | this.selectedRowKeys = []; |
| | | this.visible = true |
| | | this.loadData(1) |
| | | }, |
| | |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.$bus.$emit('selectionRows', this.allSelectionRows); |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |