constant.tsx 4.77 KB
import { enumToProTableEnumValue } from '@/utils';

export type PrepaidItem = {
  id: number; // id
  customerName: string; // 购买方
  contactPerson: string; // 联系人
  salesCode: string; // 销售
  phone: string; // 销售
  rechargeAmount: number; // 金额
  notes: string; // 备注
  rechargeSource: string; // 充值来源
  status: string; // 状态
  auditors: string; // 审核人
  auditDate: string; // 审核日期
  auditNotes: string; // 审核备注
};
export const PREPAID_STATUS_OPTIONS = {
  CREATED: '待审核',
  AUDIT_FAIL: '审核失败',
  AUDIT_PASS: '审核通过',
};
export const SALES_RECHARGE_PREPAYMENT_COLUMNS = [
  // {
  //   title: '编号',
  //   dataIndex: 'id',
  //   key: 'id',
  //   valueType: 'index',
  // },
  {
    title: '客户名称',
    dataIndex: 'customerName',
    key: 'customerName',
    valueType: 'text',
  },
  {
    title: '联系人',
    dataIndex: 'contactPerson',
    key: 'contactPerson',
    valueType: 'text',
  },
  {
    title: '销售',
    dataIndex: 'salesCode',
    key: 'salesCode',
    valueType: 'text',
  },
  {
    title: '手机号',
    dataIndex: 'phone',
    key: 'phone',
    valueType: 'text',
  },
  {
    title: '金额',
    dataIndex: 'rechargeAmount',
    key: 'rechargeAmount',
    valueType: 'money',
    hideInSearch: true,
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'status',
    valueType: 'text',
    valueEnum: enumToProTableEnumValue(PREPAID_STATUS_OPTIONS),
  },
  {
    title: '备注',
    dataIndex: 'notes',
    key: 'notes',
    valueType: 'text',
  },
  {
    title: '凭证',
    dataIndex: 'proofImages',
    key: 'proofImages',
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
    key: 'createTime',
    valueType: 'dateTimeRange',
    search: {
      transform: (value) => {
        return {
          createTimeBeginTime: value[0],
          createTimeEndTime: value[1],
        };
      },
    },
  },
  {
    title: '充值来源',
    dataIndex: 'rechargeSource',
    key: 'rechargeSource',
    valueType: 'text',
    hideInTable: true,
    hideInSearch: true,
  },

  {
    title: '审核人',
    dataIndex: 'auditors',
    key: 'auditors',
    valueType: 'text',
    hideInTable: true,
    hideInSearch: true,
  },
  {
    title: '审核日期',
    dataIndex: 'auditDate',
    key: 'auditDate',
    valueType: 'dateTimeRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          auditDateBeginTime: value[0],
          auditDateEndTime: value[1],
        };
      },
    },
    hideInSearch: true,
  },
  {
    title: '审核备注',
    dataIndex: 'auditNotes',
    key: 'auditNotes',
    valueType: 'text',
  },
];

export const ACCOUNT_COLUMNS = [
  // {
  //   title: '编号',
  //   dataIndex: 'uid',
  //   key: 'uid',
  //   valueType: 'index',
  //   hideInSearch: true,
  // },
  {
    title: '关键字',
    dataIndex: 'keywords',
    key: 'keywords',
    hideInTable: true,
    fieldProps: {
      placeholder: '请输入 单位|课题组|姓名|手机号|昵称',
    },
  },
  {
    title: '单位',
    dataIndex: 'institution',
    key: 'institution',
    valueType: 'text',
    hideInSearch: true,
  },
  {
    title: '课题组老师',
    dataIndex: 'institutionContactName',
    key: 'institutionContactName',
    valueType: 'text',
    hideInSearch: true,
  },
  {
    title: '手机号',
    dataIndex: 'phone',
    key: 'phone',
    valueType: 'text',
  },
  {
    title: '真实姓名',
    dataIndex: 'realName',
    key: 'realName',
    valueType: 'text',
    hideInSearch: true,
  },
  {
    title: '余额(¥)',
    dataIndex: 'nowMoney',
    key: 'nowMoney',
    valueType: 'money',
    hideInSearch: true,
  },
  {
    title: '账号',
    dataIndex: 'account',
    key: 'account',
    valueType: 'text',
    hideInSearch: true,
  },
  {
    title: '昵称',
    dataIndex: 'nickname',
    key: 'nickname',
    valueType: 'text',
    hideInSearch: true,
  },
  {
    title: '账号创建日期',
    dataIndex: 'createTime',
    key: 'createTime',
    valueType: 'dateRange',
    search: {
      transform: (value) => {
        return {
          dateLimit: value[0] + ',' + value[1],
        };
      },
    },
  },
];

export const BALANCE_CHANGE_COLUMNS = [
  {
    title: '变动金额(¥)',
    dataIndex: 'number',
    key: 'number',
    dataType: 'money',
    width: 140,
  },
  {
    title: '变动后(¥)',
    dataIndex: 'balance',
    key: 'balance',
    dataType: 'money',
    width: 140,
  },
  {
    title: '类型',
    dataIndex: 'title',
    key: 'title',
    dataType: 'text',
    width: 200,
  },
  {
    title: '备注',
    dataIndex: 'mark',
    key: 'mark',
    dataType: 'text',
    width: 250,
  },
  {
    title: '创建时间',
    dataIndex: 'add_time',
    key: 'add_time',
    dataType: 'datetime',
  },
];