constant.tsx 4.03 KB
import { enumToProTableEnumValue } from '@/utils';
import { PAYEE_OPTIONS } from '../Order/constant';

export type InvoiceItem = {
  id: number; //id
  invoiceStatus: string; //发票类型:专票/普票
  invoiceNumber: string; //发票号码
  status: string; //状态
  purchaser: string; //购买方
  payee: string; //收款单位
  contacts: string; //联系人
  sale: string; //销售
  money: number; //金额
  invoicingTime: string; //开票日期
  collectionTime: string; //收款时间
  notes: string; //备注
};

export const INVOICE_STATUS = {
  UNVERIFIED: '未核销',
  VERIFIED: '已核销',
  ABNORMAL: '异常',
  PARTIAL_VERIFICATION: '部分核销',
};

export const INVOICE_COLUMNS = [
  {
    dataIndex: 'invoiceId',
    title: 'id',
    valueType: 'text',
    hideInTable: true,
    hideInSearch: true,
    width: 100,
  },
  {
    dataIndex: 'invoiceNumber',
    title: '发票号码',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'invoiceStatus',
    title: '发票类型',
    valueType: 'select',
    width: 100,
    valueEnum: enumToProTableEnumValue({
      SPECIALLY_INVOICED: '专票',
      COMMON_INVOICED: '普票',
    }),
  },
  {
    title: '状态',
    dataIndex: 'status',
    valueType: 'text',
    width: 100,
    valueEnum: enumToProTableEnumValue({
      UNVERIFIED: '未核销',
      VERIFIED: '已核销',
      PARTIAL_VERIFICATION: '部分核销',
    }),
  },
  {
    title: '购买方',
    dataIndex: 'purchaser',
    valueType: 'text',
    width: 180,
  },
  {
    title: '收款单位',
    dataIndex: 'payee',
    valueType: 'text',
    width: 180,
    valueEnum: enumToProTableEnumValue(PAYEE_OPTIONS),
  },
  {
    title: '联系人',
    dataIndex: 'contacts',
    valueType: 'text',
    width: 100,
  },
  {
    title: '销售',
    dataIndex: 'sale',
    valueType: 'text',
    width: 100,
  },
  {
    title: '金额',
    dataIndex: 'money',
    valueType: 'money',
    width: 100,
  },
  {
    title: '开票日期',
    dataIndex: 'invoicingTime',
    valueType: 'dateRange',
    width: 150,
    search: {
      transform: (value) => {
        if (value) {
          return {
            invoicingBeginTime: value[0],
            invoicingEndTime: value[1],
          };
        }
      },
    },
  },
  {
    title: '收款时间',
    dataIndex: 'collectionTime',
    valueType: 'dateRange',
    width: 200,
    search: {
      transform: (value) => {
        if (value) {
          return {
            collectionBeginTime: value[0],
            collectionEndTime: value[1],
          };
        }
      },
    },
  },
  {
    title: '备注',
    dataIndex: 'notes',
    valueType: 'text',
    width: 250,
  },
];

export const BANK_STATEMENT_COLUMNS = [
  {
    dataIndex: 'id',
    title: '编号',
    valueType: 'text',
    width: 160,
    copyable: true,
    // hideInTable: true,
    // hideInSearch: true,
    editable: false,
  },
  {
    dataIndex: 'statusText',
    title: '状态',
    valueType: 'select',
    width: 100,
    editable: false,
  },
  {
    dataIndex: 'serialNumber',
    title: '流水号',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'collectionDate',
    title: '收款时间',
    valueType: 'date',
    width: 100,
    hideInSearch: true,
  },
  {
    dataIndex: 'collectionDateSearch',
    title: '收款时间',
    valueType: 'dateRange',
    width: 100,
    hideInTable: true,
    search: {
      transform: (value) => {
        if (value) {
          return {
            collectionDateBegin: value[0],
            collectionDateEnd: value[1],
          };
        }
      },
    },
  },
  {
    dataIndex: 'payeeText',
    title: '收款方',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'payer',
    title: '付款方',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'amount',
    title: '金额',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'remark',
    title: '备注',
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'remarkNote',
    title: '附言',
    valueType: 'text',
    width: 100,
  },
];