// 订单状态
export const statusMap = {
  101: '未付款',
  102: '已取消',
  103: '支付超时取消',
  201: '已付款',
  202: '退款中',
  203: '已退款',
  301: '服务中',
  401: '服务已完成',
  // 402: '服务已完成(系统)'
}
export const statusModifyMap = {
  202: '申请退款',
  203: '已退款',
  301: '服务中',
  401: '服务已完成',
  402: '服务已完成(系统)'
}

 //客户处理结果
 export const ccResultList= {  
  Y: "成立",
  N: "不成立",
  // O: "无法判定",
}

//客诉责任方
export const ccResList= {
  P: "服务人员",
  S: "商家运营",
  C: "客服",
  O: "其他"
}

export const defaultLevelMap = [
  { label: 0, value: "无" },
  { label: 1, value: "一般" },
  { label: 2, value: "严重" },
  { label: 3, value: "非常严重" },
];
// 投诉治理状态
export const ruleStatusDesc= {
  0: "待处理",
  1: "总部运营已处理",
  2: "不申诉",
  3: "申诉处理中",
  4: "申诉成立",
  5: "申诉不成立",
  6: "申诉审核通过",
  7: "申诉审核不通过",
}

export const defaultUseStatusOptions = [
  {
    label: '未使用',
    value: 0
  },
  {
    label: '已使用',
    value: 1
  },
  {
    label: '已过期',
    value: 2
  },
  {
    label: '已下架',
    value: 3
  },
  {
    label: '已占有预售',
    value: 4
  }
]

//投诉单退款方式
export  const refundMethodDesc={
  1: "银行卡",
  2: "支付宝",
  3: "微信",
  4: "盒马二线手工退",
  5: "盒马XP工单退"
} 

// 工单状态
export const statusDesc = {
  0: '创建',
  1: '处理中',
  2: '已完成',
  3: '作废'
}
// 工单子状态
export const substatusDesc = {
  101: '待处理',
  102: '升级',
  103: '驳回',
  104: '重新打开',
  106: '等待客户上传图片',
  107: '客户已上传图片',
  108: '服务商处理中',
  109: '服务商已处理',
  201: '完成',
  0: '创建'
}

// 服务工单状态
export const bookStatusMap = {
  // 0: '未预约',
  1: '待履约',
  2: '服务中',
  3: '服务已提供',
  4: '服务已完成',
  5: '取消',
  6: '退款',
  7:'匹配中'
}
// 权益单状态
export const hmBenefitStatusMap = {
  1: '待支付',
  2: '待履约',
  4: '已取消',
  5: '已关闭',
  7: '服务已提供',
  8: '待派单',
  9: '服务已完成'
}

export const cityList=[
  "北京","上海","南京","深圳","苏州","无锡","杭州","宜昌","青岛","成都","重庆","广州"
]

//客户来源
export const sourceMap = [
  { label: "xinghai", value: "星海" },
  { label: "saasmall", value: "saas商城" },
  { label: "jzmall", value: "鲸致商城" },
  { label: "hema", value: "盒马" },
  { label: "IB", value: "进电" },
  { label: "OB", value: "外拨" },
  { label: "IM", value: "聊天工具" },
  { label: "EMAILL", value: "邮件" },
  { label: "APP", value: "APP" },
  { label: "H5", value: "H5" },
  { label: "SS", value: "服务者提供" },
  { label: "RE", value: "引荐人" },
  { label: "Other", value: "其他" },
  { label: "XP", value: "XP反馈" }, 
  { label: "DD", value: "钉钉反馈" },
  { label: "HMAPP", value: "盒马APP" },
  { label: "CP", value: "企微反馈" },
  { label: "CallRecord", value: "外拨录音衍生" },
  { label: "FG", value: "复购不达标" },
  { label: "Customer", value: "客户" },
  { label: "CC", value: "电访" },
  { label: "douyin", value: "抖音商城" },
 
];

export const ticketSourceList= [
  { label: "400进线", value: "IB" },
  { label: "日常回访", value: "OB" },
  { label: "XP反馈", value: "XP" },
  { label: "在线chat", value: "IM" },
  { label: "钉钉反馈", value: "DD" },
  { label: "APP差评", value: "HMAPP" },
  { label: "企微反馈", value: "CP" },
  { label: "勤鸽XP", value: "QG" },
  { label: "阿姨自主报备", value: "SS" },
  { label: "保姆工具", value: "APP" },
  { label: "公众号", value: "WX" },
  { label: "其他", value: "OT" },
  { label: "回访话务", value: "CallRecord" },
  { label: "客户中心", value: "Customer" },
]
// 表sys_station{ id: 1, city: '上海', name: '仓库站(总仓)' },
export const stations = [
{ id: 28, city: '上海', name: '上海品类浦西站' },
{ id: 40, city: '深圳', name: '深圳宝安服务站' },
{ id: 69, city: '上海', name: '上海静安嘉定长宁站' },
{ id: 70, city: '上海', name: '上海杨浦虹口站' },
{ id: 72, city: '上海', name: '上海徐汇黄浦站' },
{ id: 73, city: '上海', name: '上海闵行松江站' },
{ id: 75, city: '上海', name: '上海浦东北站' },
{ id: 76, city: '上海', name: '上海浦东南站' },
{ id: 79, city: '北京', name: '北京朝阳东城站' },
{ id: 81, city: '深圳', name: '深圳南山服务站' },
{ id: 82, city: '深圳', name: '深圳罗湖服务站' },
{ id: 95, city: '北京', name: '北京海淀西城站' },
{ id: 97, city: '深圳', name: '深圳福田服务站' },
{ id: 98, city: '深圳', name: '深圳桃源服务站' },
{ id: 99, city: '北京', name: '北京品类站' },
{ id: 100, city: '北京', name: '北京丰台站' },
{ id: 101, city: '深圳', name: '深圳沙井服务站' },
{ id: 102, city: '深圳', name: '深圳福永服务站' },
{ id: 103, city: '深圳', name: '深圳龙华服务站' },
{ id: 104, city: '深圳', name: '深圳龙岗服务站' },
{ id: 105, city: '北京', name: '北京大兴东南站' },
{ id: 106, city: '深圳', name: '深圳锦荟服务站' },
{ id: 112, city: '深圳', name: '深圳品类站' },
{ id: 115, city: '深圳', name: '深圳聚福服务站' },
{ id: 117, city: '南京', name: '南京建邺站' },
{ id: 118, city: '南京', name: '南京秦淮站' },
{ id: 119, city: '南京', name: '南京江宁站' },
{ id: 120, city: '南京', name: '南京北大站' },
{ id: 121, city: '南京', name: '南京品类站' },
{ id: 123, city: '南京', name: '南京栖霞站' },
{ id: 124, city: '南京', name: '南京浦口站' },
{ id: 125, city: '苏州', name: '苏州园区站' },
{ id: 126, city: '苏州', name: '苏州品类站' },
{ id: 127, city: '无锡', name: '无锡经开站' },
{ id: 128, city: '无锡', name: '无锡品类站' },
{ id: 131, city: '上海', name: '短期出单（保姆/钟点）' },
{ id: 132, city: '上海', name: '上海品类浦东站' },
{ id: 133, city: '上海', name: '上海丘比特小程序站' },
{ id: 134, city: '北京', name: '顺义门店' },
{ id: 135, city: '杭州', name: '杭州西溪风情站' },
{ id: 136, city: '深圳', name: '测算-宝安中洲华府' },
{ id: 137, city: '上海', name: '上海品类收纳站' },
{ id: 138, city: '上海', name: '上海黄浦站' },
{ id: 161, city: '青岛', name: '青岛服务站' },
{ id: 165, city: '青岛', name: '青岛品类站' },
{ id: 167, city: '成都', name: '成都成华站' },
{ id: 168, city: '成都', name: '成都东站' },
{ id: 169, city: '广州', name: '广州天河站' },
{ id: 167, city: '成都', name: '成都南站' },
{ id: 167, city: '成都', name: '成都西站' },
]

// 优惠券类型
export const defaultCouponTypeOptions = [
  {
    label: '通用领券',
    value: 0
  },
  {
    label: '注册赠券',
    value: 1
  },
  {
    label: '兑换码',
    value: 2
  },
  // {
  //   label: '助力活动推荐3人',
  //   value: 3
  // },
  {
    label: '会员系统派发券',
    value: 4
  }
]

// object对象转数组
export function ObjectToArray(obj) {
  const objArray = Object.keys(obj).map(key => {
    return { value: key, label: obj[key] }
  })
  return objArray
}

// 队列转对象
export function ArrayToObject(array) {
  let jsonStr = '{'
  let index = 0
  array.forEach(item => {
    if (index === 0) {
      jsonStr = jsonStr + '"' + item.label + '":"' + item.value + '"'
    } else {
      jsonStr = jsonStr + ',"' + item.label + '":"' + item.value + '"'
    }

    index = index + 1
  })

  jsonStr = jsonStr + '}'

  return JSON.parse(jsonStr)
}
