| | |
| | | minWidth: 120, |
| | | |
| | | }, |
| | | relatedBillName: { |
| | | label: '关联联账单名称', |
| | | isCreate: { |
| | | label: '是否已入账', dataType: 'string', |
| | | type: 'select', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | |
| | | search: true, |
| | | dicUrl: '/system/dict/data/type/sys_whether_type', |
| | | }, |
| | | billName: { |
| | | label: '关联账单名称', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | search: true, |
| | | }, |
| | | isIncomeMatched: { |
| | | label: '是否匹配收入', |
| | | type: 'select', |
| | | dataType: 'string', |
| | | minWidth: 120, |
| | | |
| | | dicUrl: '/system/dict/data/type/sys_matching_status', |
| | | }, |
| | | isCostMatched: { |
| | |
| | | dicUrl: '/system/dict/data/type/sys_matching_status', |
| | | }, |
| | | |
| | | isCreate: { |
| | | label: '是否已入账', dataType: 'string', |
| | | type: 'select', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | dicUrl: '/system/dict/data/type/sys_whether_type', |
| | | }, |
| | | |
| | | relatedBillStatus: { |
| | | minWidth: 120, |
| | | label: '关联账单状态', |
| | |
| | | crudRef.value.rowEdit(selectionList.value[0]); |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | if (selection.every((item: any) => item.isCreate == '0')) { |
| | | if (selection.length > 0) { |
| | | // 检查是否所有记录都是未入账状态(isCreate == '0') |
| | | const allNotCreated = selection.every((item: any) => item.isCreate == '0'); |
| | | // 检查是否所有记录的客户名称都相同 |
| | | const sameCustomer = selection.every((item: any) => item.customerName === selection[0].customerName); |
| | | |
| | | if (allNotCreated && sameCustomer) { |
| | | generateDisabled.value = false; |
| | | } else { |
| | | generateDisabled.value = true; |
| | | if (selection.length > 0) { |
| | | if (!allNotCreated) { |
| | | proxy.$message.warning('请选择未入账的记录'); |
| | | } else if (!sameCustomer) { |
| | | proxy.$message.warning('请选择相同客户名称的记录'); |
| | | } |
| | | } |
| | | selectionList.value = selection; |
| | | } else { |
| | | generateDisabled.value = false; |
| | | } |
| | | selectionList.value = selection; |
| | | } |
| | | }) |