云
12 小时以前 bef3d94968fc70667f3123cb23ee69550e08a5ca
src/views/crm/backlog/modules/receivable-plan-remind-list.vue
@@ -9,7 +9,7 @@
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';
@@ -17,15 +17,21 @@
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 } });
}
/** 打开客户详情 */
@@ -35,15 +41,16 @@
/** 创建回款 */
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,
@@ -63,6 +70,7 @@
          return await getReceivablePlanPage({
            pageNo: page.currentPage,
            pageSize: page.pageSize,
            sceneType: 1,
            ...formValues,
          });
        },
@@ -82,7 +90,7 @@
<template>
  <div>
    <FormModal />
    <FormModal @success="handleRefresh" />
    <Grid>
      <template #customerName="{ row }">
        <Button type="link" @click="handleCustomerDetail(row)">
@@ -93,9 +101,13 @@
        <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>