| | |
| | | const records: CrmCustomerApi.Customer[] = row |
| | | ? [row] |
| | | : gridApi.grid.getCheckboxRecords(); |
| | | if ( |
| | | records.some( |
| | | (item) => item.ownerUserId != null || item.autoPoolEnabled === false, |
| | | ) |
| | | ) { |
| | | message.warning('仅可领取或分配无负责人且允许流入公海的客户'); |
| | | return []; |
| | | } |
| | | const ids = records.map((item) => item.id!); |
| | | if (ids.length === 0) { |
| | | message.warning('请先勾选客户'); |
| | |
| | | columns: useGridColumns(), |
| | | height: 'auto', |
| | | keepSource: true, |
| | | checkboxConfig: { |
| | | checkMethod: ({ row }: { row: CrmCustomerApi.Customer }) => |
| | | row.ownerUserId == null && row.autoPoolEnabled !== false, |
| | | }, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues) => { |
| | |
| | | type: 'link', |
| | | auth: ['crm:customer:receive'], |
| | | disabled: receiving, |
| | | ifShow: row.ownerUserId == null && row.autoPoolEnabled !== false, |
| | | onClick: () => handleReceive(row), |
| | | }, |
| | | { |
| | |
| | | type: 'link', |
| | | auth: ['crm:customer:distribute'], |
| | | disabled: receiving, |
| | | ifShow: row.ownerUserId == null && row.autoPoolEnabled !== false, |
| | | onClick: () => handleDistribute(row), |
| | | }, |
| | | ]" |