spring
2026-07-03 f10cf167372f2d8c4c0e14f42f361d7ab96d8347
src/views/crm/contract/data.ts
@@ -1,7 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '../../../packages/constants/src';
import { useUserStore } from '../../../packages/stores/src';
import { erpPriceInputFormatter, erpPriceMultiply } from '../../../packages/utils/src';
@@ -70,6 +69,18 @@
      },
    },
    {
      fieldName: 'orderDate',
      label: '下单日期',
      component: 'DatePicker',
      rules: 'required',
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        placeholder: '请选择下单日期',
      },
    },
    {
      fieldName: 'businessId',
      label: '商机名称',
      component: 'Select',
@@ -102,18 +113,6 @@
      },
    },
    {
      fieldName: 'orderDate',
      label: '下单日期',
      component: 'DatePicker',
      rules: 'required',
      componentProps: {
        showTime: false,
        format: 'YYYY-MM-DD',
        valueFormat: 'x',
        placeholder: '请选择下单日期',
      },
    },
    {
      fieldName: 'startTime',
      label: '合同开始时间',
      component: 'DatePicker',
@@ -134,6 +133,18 @@
        valueFormat: 'x',
        placeholder: '请选择合同结束时间',
      },
    },
    {
      fieldName: 'depositPrice',
      label: '定金金额(元)',
      component: 'InputNumber',
      componentProps: {
        class: '!w-full',
        min: 0,
        precision: 2,
        placeholder: '请输入定金金额',
      },
      rules: z.number().min(0).optional(),
    },
    {
      fieldName: 'signUserId',
@@ -278,6 +289,32 @@
        allowClear: true,
      },
    },
    {
      fieldName: 'auditStatus',
      label: '合同状态',
      component: 'Select',
      componentProps: {
        options: [
          { label: '未提交', value: 0 },
          { label: '审批中', value: 10 },
          { label: '审核通过', value: 20 },
          { label: '审核不通过', value: 30 },
          { label: '已取消', value: 40 },
          { label: '已作废', value: 50 },
        ],
        placeholder: '请选择合同状态',
        allowClear: true,
      },
    },
    {
      fieldName: 'orderNo',
      label: '关联订单',
      component: 'Input',
      componentProps: {
        placeholder: '请输入订单号',
        allowClear: true,
      },
    },
  ];
}
@@ -288,6 +325,7 @@
      field: 'no',
      minWidth: 180,
      fixed: 'left',
      slots: { default: 'no' },
    },
    {
      title: '合同名称',
@@ -311,6 +349,12 @@
    {
      title: '合同金额(元)',
      field: 'totalPrice',
      minWidth: 140,
      formatter: 'formatAmount2',
    },
    {
      title: '定金金额(元)',
      field: 'depositPrice',
      minWidth: 140,
      formatter: 'formatAmount2',
    },
@@ -402,16 +446,20 @@
      field: 'auditStatus',
      fixed: 'right',
      minWidth: 120,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_AUDIT_STATUS },
      },
      slots: { default: 'auditStatus' },
    },
    {
      title: '关联订单',
      field: 'orderNo',
      fixed: 'right',
      minWidth: 150,
      slots: { default: 'orderNo' },
    },
    {
      title: '操作',
      field: 'actions',
      fixed: 'right',
      minWidth: 130,
      minWidth: 220,
      slots: { default: 'actions' },
    },
  ];