// 单据的状态
export function filter_bill_status(value) {
  let text = ''
  switch (parseInt(value)) {
    case 0:
      text = '草稿'
      break
    case 1:
      text = '提交'
      break
    case 2:
      text = '已审核'
      break
    case 3:
      text = '否决'
      break
    case 4:
      text = '退回'
      break
    case 5:
      text = '作废'
      break
    case 6:
      text = '关闭'
      break
  }
  return text
}
// bug平台登记
export function bug_status(row) {
  let text = ''
  let value = 0
  const { iStatus, sDeveloper, tPlanDeliveryTime } = row
  if (String(iStatus) === 3 && sDeveloper && tPlanDeliveryTime) {
    value = 4
  } else {
    value = iStatus
  }
  switch (String(value)) {
    case '0':
      text = '无状态'
      break
    case '1':
      text = '打回'
      break
    case '2':
      text = '已关闭'
      break
    case '3':
      text = '新建'
      break
    case '4':
      text = '已分派'
      break
    case '5':
      text = '已处理'
      break
    case '6':
      text = '已测试'
      break
  }
  return text
}
export function bug_iTaskType(value) {
  let text = ''
  switch (String(value)) {
    case '8':
      text = '错误'
      break
    case '9':
      text = '功能缺陷'
      break
    case '10':
      text = '其他'
      break
    case '2':
      text = '新需求'
      break
  }
  return text
}
export function bug_iPriority(value) {
  let text = ''
  switch (String(value)) {
    case '0':
      text = '无'
      break
    case '1':
      text = '低'
      break
    case '2':
      text = '中'
      break
    case '3':
      text = '高'
      break
    case '4':
      text = '加急'
      break
    case '5':
      text = '特急'
      break
  }
  return text
}
// 检验结果
export function check_result(value) {
  let text = ''
  // 有时候后端返回一个null也要处理成未校验
  value = value === null ? 0 : value
  switch (String(value)) {
    case '0':
      text = '未检验'
      break
    case '1':
      text = '合格'
      break
    case '-1':
      text = '不合格'
      break
  }
  return text
}
export function is_success_error(value) {
  let text = ''
  switch (String(value)) {
    case '0':
      text = '未升级'
      break
    case '1':
      text = '已升级'
      break
  }
  return text
}

// 分包
export function sub_package_status(value) {
  let text = ''
  switch (String(value)) {
    case '0':
      text = '草稿'
      break
    case '1':
      text = '已分包'
      break
    case '2':
      text = '审核'
      break
  }
  return text
}

// 分包
export function hsAdminToolsAuth(value) {
  let text = ''
  switch (value) {
    case true:
      text = '有'
      break
    case false:
      text = '无'
      break
  }
  return text
}

// 性别

export function sex_status(value) {
  let text = ''
  switch (String(value)) {
    case '0':
      text = ''
      break
    case '1':
      text = '女'
      break
    case '2':
      text = '男'
      break
  }
  return text
}
//  设备类型

export function emEquipmentType(value) {
  let text = ''
  switch (String(value)) {
    case '0':
      text = '未指定'
      break
    case '1':
      text = '筒染机'
      break
    case '2':
      text = '梭织机'
      break
    case '3':
      text = '针织圆机'
      break
    case '4':
      text = '匹染机'
      break
    case '5':
      text = '整经机'
      break
    case '6':
      text = '浆纱机'
      break
    case '7':
      text = '针织横机'
      break
    case '8':
      text = '经编机'
      break
  }
  return text
}
// 工种
export function work_type(value) {
  let text = ''
  switch (String(value)) {
    case '1':
      text = '直接'
      break
    case '2':
      text = '间接'
      break
    case '3':
      text = '顶岗'
      break
    case '4':
      text = '培训'
      break
  }
  return text
}
// 仓库类型
export function store_type(value) {
  let text = ''
  switch (String(value)) {
    case '1':
      text = '仓库'
      break
    case '16':
      text = '寄存客户'
      break
    case '2':
      text = '车间'
      break
    case '4':
      text = '客户'
      break
    case '8':
      text = '客户寄存'
      break
    case '32':
      text = '门店'
      break
    case '64':
      text = '废品'
      break
  }
  return text
}
