gaoluyang
3 天以前 d841a8ea6dc2f7fdedbf0ea2b1e539842f5f3e37
src/views/crm/contract/data.ts
@@ -28,10 +28,11 @@
      fieldName: 'no',
      label: '合同编号',
      component: 'Input',
      componentProps: {
        placeholder: '保存时自动生成',
        disabled: true,
      },
      componentProps: (values) => ({
        placeholder: values?.id ? '留空则保持原编号' : '留空则自动生成',
        allowClear: true,
        maxlength: 100,
      }),
    },
    {
      fieldName: 'name',
@@ -66,6 +67,10 @@
      componentProps: {
        placeholder: '请选择客户',
      },
      dependencies: {
        triggerFields: ['customerId'],
        disabled: (values) => !!values.customerId,
      },
    },
    {
      fieldName: 'orderDate',
@@ -75,7 +80,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择下单日期',
      },
    },
@@ -88,9 +93,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 +129,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择合同开始时间',
      },
    },
@@ -129,7 +140,7 @@
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD',
        placeholder: '请选择合同结束时间',
      },
    },
@@ -405,6 +416,18 @@
      },
    },
    {
      title: '已开票金额(元)',
      field: 'totalInvoicePrice',
      minWidth: 150,
      formatter: 'formatAmount2',
    },
    {
      title: '未开票金额(元)',
      field: 'unInvoicePrice',
      minWidth: 140,
      formatter: 'formatAmount2',
    },
    {
      title: '最后跟进时间',
      field: 'contactLastTime',
      minWidth: 180,