/**
 * 应急物资常量
 */
export enum EMERGENCY_SUPPLY_STATUS {
  INTACT = 0,
  DAMAGED,
}

export const EMERGENCY_SUPPLY_STATUS_OPTIONS = [
  {
    label: '完好',
    value: EMERGENCY_SUPPLY_STATUS.INTACT,
  },
  {
    label: '缺损',
    value: EMERGENCY_SUPPLY_STATUS.DAMAGED,
  },
];

export const EMERGENCY_SUPPLY_TABS = [
  {
    value: 'detail',
    label: '物资详情',
  },
  {
    value: 'record',
    label: '变更记录',
  },
];

enum CHANGE_TYPE {
  CHECK = 1,
  CHANGE,
  DISCARD,
  REQUEST,
}

export const CHANGE_TYPE_MAP = {
  [CHANGE_TYPE.CHECK]: '物资盘点',
  [CHANGE_TYPE.CHANGE]: '数量变更',
  [CHANGE_TYPE.DISCARD]: '报废',
  [CHANGE_TYPE.REQUEST]: '物资申领',
};

export enum INVENTORY_RESULT {
  CHECKING = 1,
  INTACT,
  DAMAGED,
  OVERDUE,
}

export const INVENTORY_RESULT_MAP = {
  [INVENTORY_RESULT.CHECKING]: '盘点中',
  [INVENTORY_RESULT.INTACT]: '完好',
  [INVENTORY_RESULT.DAMAGED]: '缺损',
  [INVENTORY_RESULT.OVERDUE]: '逾期未完成',
};

export const INVENTORY_RESULT_OPTIONS = [
  { label: INVENTORY_RESULT_MAP[INVENTORY_RESULT.CHECKING], value: INVENTORY_RESULT.CHECKING },
  { label: INVENTORY_RESULT_MAP[INVENTORY_RESULT.INTACT], value: INVENTORY_RESULT.INTACT },
  { label: INVENTORY_RESULT_MAP[INVENTORY_RESULT.DAMAGED], value: INVENTORY_RESULT.DAMAGED },
  { label: INVENTORY_RESULT_MAP[INVENTORY_RESULT.OVERDUE], value: INVENTORY_RESULT.OVERDUE },
];

/**
 * 物资申领计划状态
 */
export enum SUPPLY_REQUEST_STATUS {
  ALL = 0,
  APPLYING = 1, // 申请中
  PURCHASING = 2, // 采购中
  RECEIVING = 3, // 领用中
  RECEIVED = 4, // 已领用
}

export const SUPPLY_REQUEST_STATUS_MAP = {
  [SUPPLY_REQUEST_STATUS.ALL]: '全部',
  [SUPPLY_REQUEST_STATUS.APPLYING]: '申请中',
  [SUPPLY_REQUEST_STATUS.PURCHASING]: '采购中',
  [SUPPLY_REQUEST_STATUS.RECEIVING]: '领用中',
  [SUPPLY_REQUEST_STATUS.RECEIVED]: '已领用',
};

export const SUPPLY_REQUEST_STATUS_OPTIONS = [
  { label: SUPPLY_REQUEST_STATUS_MAP[SUPPLY_REQUEST_STATUS.ALL], value: SUPPLY_REQUEST_STATUS.ALL },
  { label: SUPPLY_REQUEST_STATUS_MAP[SUPPLY_REQUEST_STATUS.APPLYING], value: SUPPLY_REQUEST_STATUS.APPLYING },
  { label: SUPPLY_REQUEST_STATUS_MAP[SUPPLY_REQUEST_STATUS.PURCHASING], value: SUPPLY_REQUEST_STATUS.PURCHASING },
  { label: SUPPLY_REQUEST_STATUS_MAP[SUPPLY_REQUEST_STATUS.RECEIVING], value: SUPPLY_REQUEST_STATUS.RECEIVING },
  { label: SUPPLY_REQUEST_STATUS_MAP[SUPPLY_REQUEST_STATUS.RECEIVED], value: SUPPLY_REQUEST_STATUS.RECEIVED },
];

/**
 * 物资申领计划物资状态
 */
export enum SUPPLY_REQUEST_DETAIL_STATUS {
  APPLYING = 1, // 申请中
  PURCHASING = 2, // 采购中
  RECEIVED = 3, // 已领用
  NOTIFIED = 4, // 已通知领用
}

export const SUPPLY_REQUEST_DETAIL_STATUS_MAP = {
  [SUPPLY_REQUEST_DETAIL_STATUS.APPLYING]: '申请中',
  [SUPPLY_REQUEST_DETAIL_STATUS.PURCHASING]: '采购中',
  [SUPPLY_REQUEST_DETAIL_STATUS.RECEIVED]: '已领用',
  [SUPPLY_REQUEST_DETAIL_STATUS.NOTIFIED]: '已通知领用',
};

/**
 * 物资领用通知范围
 */
export enum NOTIFY_RANGE {
  ALL = 1,
  CURRENT = 2,
}

export const NOTIFY_RANGE_MAP = {
  [NOTIFY_RANGE.ALL]: '通知此物资所有需求部门',
  [NOTIFY_RANGE.CURRENT]: '仅通知此物资当前需求部门',
};

export const NOTIFY_RANGE_OPTIONS = [
  { label: NOTIFY_RANGE_MAP[NOTIFY_RANGE.ALL], value: NOTIFY_RANGE.ALL },
  { label: NOTIFY_RANGE_MAP[NOTIFY_RANGE.CURRENT], value: NOTIFY_RANGE.CURRENT },
];
