xiaoyi
5 天以前 a4025834e2304dc57f6e98d58feeb9416bd90609
src/views/crm/contract/data.ts
@@ -1,6 +1,8 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { useUserStore } from '@vben/stores';
import { erpPriceInputFormatter, erpPriceMultiply } from '@vben/utils';
@@ -66,6 +68,10 @@
      componentProps: {
        placeholder: '请选择客户',
      },
      dependencies: {
        triggerFields: ['customerId'],
        disabled: (values) => !!values.customerId,
      },
    },
    {
      fieldName: 'orderDate',
@@ -75,7 +81,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择下单日期',
      },
    },
@@ -88,9 +94,15 @@
        placeholder: '请选择商机',
      },
      dependencies: {
        triggerFields: ['customerId'],
        disabled: (values) => !values.customerId,
        triggerFields: ['customerId', 'businessId'],
        disabled: (values) => !!values.businessId || !values.customerId,
        async componentProps(values) {
          if (values.businessId && values.businessName) {
            return {
              options: [{ label: values.businessName, value: values.businessId }],
              placeholder: '请选择商机',
            };
          }
          if (!values.customerId) {
            return {
              options: [],
@@ -118,7 +130,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择合同开始时间',
      },
    },
@@ -129,7 +141,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择合同结束时间',
      },
    },
@@ -186,6 +198,78 @@
            placeholder: '请选择客户签约人',
          };
        },
      },
    },
    {
      fieldName: 'contractType',
      label: '合同类型',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_CONTRACT_TYPE),
        placeholder: '请选择合同类型',
        allowClear: true,
      },
    },
    {
      fieldName: 'voltageLevel',
      label: '电压等级',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_VOLTAGE_LEVEL),
        placeholder: '请选择电压等级',
        allowClear: true,
      },
    },
    {
      fieldName: 'electricityType',
      label: '用电类型',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_ELECTRICITY_TYPE),
        placeholder: '请选择用电类型',
        allowClear: true,
      },
    },
    {
      fieldName: 'contractCapacity',
      label: '合同容量(kVA)',
      component: 'InputNumber',
      componentProps: {
        class: '!w-full',
        min: 0,
        precision: 2,
        placeholder: '请输入合同容量',
      },
    },
    {
      fieldName: 'tariffMode',
      label: '电价模式',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_TARIFF_MODE),
        placeholder: '请选择电价模式',
        allowClear: true,
      },
    },
    {
      fieldName: 'meterMode',
      label: '计量方式',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.CRM_METER_MODE),
        placeholder: '请选择计量方式',
        allowClear: true,
      },
    },
    {
      fieldName: 'payCycle',
      label: '缴费周期(月)',
      component: 'InputNumber',
      componentProps: {
        class: '!w-full',
        min: 1,
        precision: 0,
        placeholder: '请输入缴费周期',
      },
    },
    {
@@ -343,6 +427,34 @@
      slots: { default: 'businessName' },
    },
    {
      title: '合同类型',
      field: 'contractType',
      minWidth: 110,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_CONTRACT_TYPE },
      },
    },
    {
      title: '电压等级',
      field: 'voltageLevel',
      minWidth: 90,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_VOLTAGE_LEVEL },
      },
    },
    {
      title: '合同容量',
      field: 'contractCapacity',
      minWidth: 100,
    },
    {
      title: '指令数',
      field: 'commandCount',
      minWidth: 80,
    },
    {
      title: '合同金额(元)',
      field: 'totalPrice',
      minWidth: 140,
@@ -405,6 +517,18 @@
      },
    },
    {
      title: '已开票金额(元)',
      field: 'totalInvoicePrice',
      minWidth: 150,
      formatter: 'formatAmount2',
    },
    {
      title: '未开票金额(元)',
      field: 'unInvoicePrice',
      minWidth: 140,
      formatter: 'formatAmount2',
    },
    {
      title: '最后跟进时间',
      field: 'contactLastTime',
      minWidth: 180,