| | |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getReceivablePlanPage } from '#/api/crm/receivable/plan'; |
| | | import Form from '#/views/crm/receivable/modules/form.vue'; |
| | | import { useGridColumns } from '#/views/crm/receivable/plan/data'; |
| | |
| | | import { RECEIVABLE_REMIND_TYPE } from '../data'; |
| | | |
| | | const { push } = useRouter(); |
| | | const emit = defineEmits<{ refresh: [] }>(); |
| | | |
| | | function handleRefresh() { |
| | | gridApi.query(); |
| | | emit('refresh'); |
| | | } |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | /** 打开回款详情 */ |
| | | /** 打开回款计划详情 */ |
| | | function handleDetail(row: CrmReceivablePlanApi.Plan) { |
| | | push({ name: 'CrmReceivableDetail', params: { id: row.id } }); |
| | | push({ name: 'CrmReceivablePlanDetail', params: { id: row.id } }); |
| | | } |
| | | |
| | | /** 打开客户详情 */ |
| | |
| | | |
| | | /** 创建回款 */ |
| | | function handleCreateReceivable(row: CrmReceivablePlanApi.Plan) { |
| | | if (row.receivableId) return; |
| | | formModalApi.setData({ plan: row }).open(); |
| | | } |
| | | |
| | | const [Grid] = useVbenVxeGrid({ |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | | schema: [ |
| | | { |
| | | fieldName: 'remindType', |
| | | label: '合同状态', |
| | | label: '回款状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | |
| | | return await getReceivablePlanPage({ |
| | | pageNo: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | sceneType: 1, |
| | | ...formValues, |
| | | }); |
| | | }, |
| | |
| | | |
| | | <template> |
| | | <div> |
| | | <FormModal /> |
| | | <FormModal @success="handleRefresh" /> |
| | | <Grid> |
| | | <template #customerName="{ row }"> |
| | | <Button type="link" @click="handleCustomerDetail(row)"> |
| | |
| | | <Button type="link" @click="handleDetail(row)">{{ row.period }}</Button> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <Button type="link" @click="handleCreateReceivable(row)"> |
| | | 创建回款 |
| | | </Button> |
| | | <TableAction :actions="[{ |
| | | label: '创建回款', |
| | | type: 'link', |
| | | auth: ['crm:receivable:create'], |
| | | ifShow: !row.receivableId, |
| | | onClick: handleCreateReceivable.bind(null, row), |
| | | }]" /> |
| | | </template> |
| | | </Grid> |
| | | </div> |