
/*
 * @Date: 2020-12-29 16:49:28
 * @LastEditors: zwq
 * @LastEditTime: 2023-07-03 10:40:31
 * @FilePath: \basic-admin\src\filters\basicData\index.js
 * @Description:
 */
import moment from 'moment'

const table = {
  eightDisciplineType: {
    1: '客诉问题',
    2: '重大质量问题',
    0: '重复发生问题',
  },
  examineStatus: {
    1: '需要审批',
    0: '不需要审批',
  },
  gradeFinish: {
    1: '已打分',
    0: '未打分',
  },
  step: {
    0: 'D0',
    1: 'D1',
    2: 'D2',
    3: 'D3',
    4: 'D4',
    5: 'D5',
    6: 'D6',
    7: 'D7',
    8: 'D8',
  },
  containmentLocaleName:
  {
    1: "装配线",
    2: "生产线",
    3: "实验室",
    4: "成品在途",
    5: "第三方中间商",
  },
  developCountermeasuresName:
  {
    1: "让步接收",
    2: "分选返工",
    3: "隔离",
    4: "退换货",
    5: "通知供应商",
  },
}

export function timeFormatter(timeObj) {
  if (timeObj) {
    return moment(timeObj).format('YYYY-MM-DD HH:mm:ss')
  } else {
    return '-'
  }
}

export default function (dictTable) {
  return function (val) {
    return table?.[dictTable]?.[val]
  }
}