constant.js 1.31 KB
// TODO: add test
// const invoiceStatus = {
//   20: ['未开票', 'UNOPEN'],
//   30: ['已开票', 'OPNED'],
//   40: ['退货待处理', 'REJECT_UNHANDLED'],
//   50: ['退货已处理', 'REJECT_HANDLED'],
//   90: ['已作废', 'CANCELLED'],
// };
// _.forEach(invoiceStatus, (value, key) => {
//   InvoiceStatusId2CNName[key] = value[0];
//   InvoiceStatusName2Id[value[1]] = key;
// });

//发票状态 20、未开票 30、已开票 40、退货待处理  50、退货已处理 90、已作废
/**
 * id => CNName 用于数据显示
 */
const InvoiceStatusId2CNName = {
  20: '未开票',
  30: '已开票',
  40: '退货待处理',
  50: '退货已处理',
  90: '已作废',
};

/**
 * name => id 做为枚举常量
 */
const InvoiceStatusName2Id = {
  UNOPEN: 20,
  OPNED: 30,
  REJECT_UNHANDLED: 40,
  REJECT_HANDLED: 50,
  CANCELLED: 90,
};

//发票类型 1:纸质票 2:电子票
/**
 * id => CNName 用于数据显示
 */
const InvoiceTypeId2CNName = {
  1: '纸质票',
  2: '电子票',
};

/**
 * name => id 做为枚举常量
 */
const InvoiceTypeName2Id = {
  PAPER: 1,
  ELECTRONIC: 2,
};
/**
 * logisticsSwitch '1 需要物流    2 不需要物流'
 */
const LogisticsTypeName2Id = {
  NO: 2,
  YES: 1,
};
export { InvoiceStatusId2CNName, InvoiceStatusName2Id, InvoiceTypeId2CNName, InvoiceTypeName2Id, LogisticsTypeName2Id };