constant.ts 7.62 KB
import { enumToProTableEnumValue } from '@/utils';

export const COMFIR_RECEIPT_IMAGES_NUMBER = 3;

export const PAYMENT_CHANNEL_OPTIONS = {
  ALIPAY: '支付宝',
  WECHAT: '微信',
  BANK_TRANSFER: '银行转账',
};

export const PAYMENT_METHOD_OPTIONS = {
  PAYMENT_IN_ADVANCE: '预付',
  CASH_ON_DELIVERY: '货到付款',
  UNPAID: '未付款',
  PLATFORM_SETTLEMENT: '平台结算',
};

export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
  APPLICATION_PROJECT: '应用项目事业部门',
  TEST: '测试事业部门',
  CUSTOMIZATION: '定制化事业部门',
  EXPERIMENTAL_EQUIPMENT: '实验设备事业部门',
  EXPERIMENTAL_CONSUMABLES: '实验耗材事业部门',
};

export const INVOCING_STATUS_OPTIONS = {
  UN_INVOICE: '不需开票',
  INVOICED: '需要开票',
};

export const LOGISTICS_STATUS_OPTIONS = {
  JINGDONG_LOGISTICS: '京东',
  SF_EXPRESS: '顺丰',
  DEBANG_LOGISTICS: '德邦物流',
};

export const ORDER_STATUS_OPTIONS = {
  UNAUDITED: '未审核',
  AUDIT_FAILED: '审核失败',
  AUDITED: '已审核',
  WAIT_SHIP: '待发货',
  SHIPPED: '已发货',
  CONFIRM_RECEIPT: '确认收货',
};

export const TAGS_COLOR = new Map<string, string>([
  ['UN_INVOICE', 'success'],
  ['INVOICED', 'processing'],
  ['AFTER_INVOICED', 'success'],
  ['UNAUDITED', 'warning'],
  ['AUDITED', 'processing'],
  ['WAIT_SHIP', 'processing'],
  ['SHIPPED', 'processing'],
  ['AUDIT_FAILED', 'error'],
  ['CONFIRM_RECEIPT', 'success'],
]);

export const SALES_CODE_OPTIONS = [
  { label: 'HQ_Linda', value: 'HQ_Linda' },
  { label: 'HQ-1_Rita', value: 'HQ-1_Rita' },
  { label: 'HQ-2_Lisa', value: 'HQ-2_Lisa' },
  { label: 'HQ-3_iris', value: 'HQ-3_iris' },
  { label: 'HQ-4_Lynn', value: 'HQ-4_Lynn' },
  { label: 'HQ-5_Jessica', value: 'HQ-5_Jessica' },
  { label: 'HQ-6_smile', value: 'HQ-6_smile' },
  { label: 'HQ-7_Yvonne', value: 'HQ-7_Yvonne' },
  { label: 'HQ-8_Daniel', value: 'HQ-8_Daniel' },
  { label: 'W_strong', value: 'W_strong' },
  { label: 'W-1_Alice', value: 'W-1_Alice' },
  { label: 'W-2_Demi', value: 'W-2_Demi' },
  { label: 'W-3_Nico', value: 'W-3_Nico' },
  { label: 'W-4_kk', value: 'W-4_kk' },
  { label: 'W-5_Alma', value: 'W-5_Alma' },
  { label: 'W-6_Dream', value: 'W-6_Dream' },
  { label: 'W-7_Aimee', value: 'W-7_Aimee' },
  { label: 'XX_Tina', value: 'XX_Tina' },
  { label: 'XX-2_Vivi', value: 'XX-2_Vivi' },
  { label: 'XX-A1_Ada', value: 'XX-A1_Ada' },
  { label: 'XX-A2_Amy', value: 'XX-A2_Amy' },
  { label: 'XX-N1_Nancy', value: 'XX-N1_Nancy' },
  { label: 'XX-N2_Sara', value: 'XX-N2_Sara' },
  { label: 'XX-C_CC', value: 'XX-C_CC' },
  { label: 'XX-L1_Lucy', value: 'XX-L1_Lucy' },
  { label: 'XX-L2_Lulu', value: 'XX-L2_Lulu' },
  { label: 'XX-P', value: 'XX-P' },
  { label: 'TB', value: 'TB' },
  { label: 'HCTB', value: 'HCTB' },
  { label: 'TBC', value: 'TBC' },
  { label: 'GW-3_iris', value: 'GW-3_iris' },
  { label: 'GW-4_Lynn', value: 'GW-4_Lynn' },
  { label: 'GW-6_smile', value: 'GW-6_smile' },
  { label: 'GW-7_Yvonne', value: 'GW-7_Yvonne' },
  { label: 'W-9_Jack', value: 'W-9_Jack' },
  { label: 'W-8_Andy', value: 'W-8_Andy' },
  { label: 'CQ_Peter', value: 'CQ_Peter' },
  { label: 'MA_A_Mao', value: 'MA_A_Mao' },
];

export const MAIN_ORDER_COLUMNS = [
  {
    title: '订单列表',
    width: 120,
    dataIndex: 'name',
    search: false,
  },
  {
    title: '订单编号',
    dataIndex: 'id',
    valueType: 'digit',
    hideInTable: true,
  },
  {
    title: '销售代表',
    dataIndex: 'salesCode',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人',
    dataIndex: 'customerName',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人联系电话',
    dataIndex: 'customerContactNumber',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '单位',
    dataIndex: 'institution',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '单位联系人',
    dataIndex: 'institutionContactName',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人地址',
    dataIndex: 'customerShippingAddress',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '商品名称',
    dataIndex: 'productName',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '商品参数',
    dataIndex: 'parameters',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '订单状态',
    dataIndex: 'orderStatus',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(ORDER_STATUS_OPTIONS),
  },
  {
    title: '支付方式',
    dataIndex: 'paymentMethod',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(PAYMENT_METHOD_OPTIONS),
  },
  {
    title: '物流方式',
    dataIndex: 'logisticsMethod',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(LOGISTICS_STATUS_OPTIONS),
  },
  {
    title: '支付渠道',
    dataIndex: 'paymentChannel',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(PAYMENT_CHANNEL_OPTIONS),
  },
  {
    title: '银行名称',
    dataIndex: 'bank',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '支付流水',
    dataIndex: 'paymentTransactionId',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '所属部门',
    dataIndex: 'productBelongBusiness',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(PRODUCT_BELONG_DEPARTMENT_OPTIONS),
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
    valueType: 'dateRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          beginTime: value[0],
          endTime: value[1],
        };
      },
    },
  },
  {
    title: '是否需要开票',
    dataIndex: 'invoicingStatus',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(INVOCING_STATUS_OPTIONS),
  },
  {
    title: '开票日期',
    dataIndex: 'invoicingTime',
    valueType: 'dateRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          invoicingBeginTime: value[0],
          invoicingEndTime: value[1],
        };
      },
    },
  },
];

export const SUB_ORDER_COLUMNS = [
  { title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
  {
    title: '商品编码',
    dataIndex: 'productCode',
    key: 'productCode',
    width: 80,
  },
  {
    title: '商品名称',
    dataIndex: 'productName',
    key: 'productName',
    width: 80,
  },
  { title: '商品参数', dataIndex: 'parameters', key: 'parameters', width: 80 },
  { title: '商品数量', dataIndex: 'quantity', key: 'quantity', width: 80 },
  {
    title: '子订单金额(¥)',
    dataIndex: 'subOrderPayment',
    key: 'subOrderPayment',
    width: 80,
  },
  {
    title: '所属事业部',
    dataIndex: 'productBelongBusiness',
    key: 'productBelongBusiness',
    width: 80,
  },
  {
    title: '支付方式',
    dataIndex: 'paymentMethod',
    key: 'paymentMethod',
    width: 80,
  },
  {
    title: '支付渠道',
    dataIndex: 'paymentChannel',
    key: 'paymentChannel',
    width: 80,
  },
  {
    title: '支付流水',
    dataIndex: 'paymentTransactionId',
    key: 'paymentTransactionId',
    width: 80,
  },
  {
    title: '物流方式',
    dataIndex: 'logisticsMethod',
    key: 'logisticsMethod',
    width: 80,
  },
  {
    title: '物流单号',
    dataIndex: 'serialNumber',
    key: 'serialNumber',
    width: 80,
  },
  {
    title: '开票状态',
    dataIndex: 'invoicingStatus',
    key: 'invoicingStatus',
    component: 'tag',
    width: 80,
  },
  {
    title: '订单状态',
    dataIndex: 'orderStatus',
    key: 'orderStatus',
    component: 'tag',
    width: 80,
  },
];