gaoluyang
3 天以前 cd8b52bdf89a4d1101f72e0ece9f4df22a3d3f7a
src/views/crm/statistics/customer/data.ts
@@ -1,16 +1,17 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '../../../../packages/constants/src';
import { getDictOptions } from '../../../../packages/effects/hooks/src';
import { useUserStore } from '../../../../packages/stores/src';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { useUserStore } from '@vben/stores';
import {
  beginOfDay,
  endOfDay,
  erpCalculatePercentage,
  erpNumberFormatter,
  formatDateTime,
  handleTree,
} from '../../../../packages/utils/src';
} from '@vben/utils';
import { getSimpleDeptList } from '#/api/system/dept';
import { getSimpleUserList } from '#/api/system/user';
@@ -62,6 +63,7 @@
      component: 'RangePicker',
      componentProps: {
        ...getRangePickerDefaultProps(),
        format: 'YYYY-MM-DD',
      },
      defaultValue: [
        formatDateTime(beginOfDay(new Date(Date.now() - 3600 * 1000 * 24 * 7))),
@@ -176,13 +178,13 @@
          field: 'createTime',
          title: '创建时间',
          minWidth: 200,
          formatter: 'formatDateTime',
          formatter: 'formatDate',
        },
        {
          field: 'orderDate',
          title: '下单日期',
          minWidth: 200,
          formatter: 'formatDateTime',
          formatter: 'formatDate',
        },
      ];
    }
@@ -234,10 +236,11 @@
          field: 'creceivablePrice',
          title: '未回款金额',
          minWidth: 200,
          // 未回款金额 = 合同总金额 - 回款金额。原来这里误用了「回款完成率」的公式,金额列上显示的是百分比。
          formatter: ({ row }) => {
            return erpCalculatePercentage(
              row.receivablePrice,
              row.contractPrice,
            return erpNumberFormatter(
              (row.contractPrice ?? 0) - (row.receivablePrice ?? 0),
              2,
            );
          },
        },
@@ -307,7 +310,7 @@
        },
        {
          field: 'ownerUserName',
          title: '日期',
          title: '员工姓名',
          minWidth: 200,
        },
        {