import dayjs from 'dayjs'

export const descs = {
  STUDENT_REGISTRATION_NUM: '截止到昨日，系统注册学员总数',
  CHARGE_STUDENT_CHANGE_RATE: '截止到昨日，注册学员现金付费率（有订单交易成功的都算，导入的也算）',
  ACTIVATION_RATE: '截止到昨日，筹备中或进行中乐团在读学员和有VIP或网管课学员激活率',
  SCHOOL: '截止到昨日，存在【进行中】乐团的【合作单位】总数',
  PROGRESS_MUSIC_GROUP_NUM: '截止到昨日，【进行中】乐团总数',
  TEACHER_NUM: '截止到昨日，非冻结，且离职时间在昨日之后的老师总数',
  FULL_TIME_NUM: '截止到昨日，非冻结、离职时间在昨日之后，且工作类型为【全职】的老师总数',
  PART_TIME_NUM: '截止到昨日，非冻结、离职时间在昨日之后，且工作类型为【兼职】的老师总数',
  SURPLUS_COURSE_NUM: '截止到昨日，系统中【未开始】课程总数（乐团+VIP+网管）【不包括试听课】',
  SURPLUS_MUSIC_COURSE_NUM: '截止到昨日，系统乐团【未开始】课程总数',
  SURPLUS_VIP_COURSE_NUM: '截止到昨日，系统中【未开始】VIP课程总数',
  SURPLUS_PRACTICE_COURSE_NUM: '截止到昨日，系统中【未开始】网管课程总数',
  OVER_COURSE_NUM: '截止到昨日，系统中【已结束】课程总数（乐团+VIP+网管）【不包括试听课】',
  OVER_MUSIC_COURSE_NUM: '截止到昨日，系统中乐团【已结束】课程总数',
  OVER_VIP_COURSE_NUM: '截止到昨日，系统中【已结束】VIP课程总数',
  OVER_PRACTICE_COURSE_NUM: '截止到昨日，系统中【已结束】网管课程总数',
  FINANCE_PAY: '筛选时间段内支出金额总和',
  FINANCE_BALANCE_AMOUNT: '筛选时间段内余额消耗总和',
  FINANCE_AMOUNT: '筛选时间段内现金收入总和',
  HOMEWORK_CREATE_RATE: '筛选时间段内，服务指标作业总布置率',
  HOMEWORK_SUBMIT_RATE: '筛选时间段内，已布置的作业学员总提交率（包括服务指标外的作业）',
  HOMEWORK_COMMENT_RATE: '筛选时间段内，学员已提交的作业老师总点评率',
  MUSIC_GROUP_COURSE: '筛选时间段内，乐团课程总数',
  VIP_GROUP_COURSE: '筛选时间段内，VIP课程总数',
  PRACTICE_GROUP_COURSE: '筛选时间段内，网管课程总数',
  ADD_STUDENT_REGISTRATION_NUM: '筛选时间段内，新注册学员总数',
  MUSIC_GROUP_STUDENT: '筛选时间段中最后一日，【进行中】乐团【在读】学员总数，分部下去重',
  NEWLY_STUDENT_NUM: '筛选时间段内，新增的【进行中】乐团【在读】学员总数（学员当前无在读乐团则记为新增）',
  QUIT_MUSIC_GROUP_STUDENT_NUM: '筛选时间段内，乐团退团学员总数（学员无在读乐团，则记为退团）',
  VIP_PRACTICE_STUDENT_NUM: '筛选时间段中最后一日，学员有剩余VIP或网管未上课时的总人数（分部下去重）',
  VIP_PRACTICE_ADD_STUDENT_NUM: '筛选时间段内，新增的VIP/网管课付费学员总数',
  MUSIC_PATROL_ITEM:'乐团主管提交的巡查表中有未勾选事项',
  HIGH_CLASS_STUDENT_LESS_THAN_THREE:'基础技能班学员数量<3',
  STUDENT_NOT_PAYMENT:'当前时间以前的缴费项目中未缴费学员数量',
  STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP:'未处理的学员退团申请数量',
  TEACHER_EXPECT_SALARY_BE_LOW:'本月预计课酬未达到系统设置的分部基本课酬标准的老师人数',
  INSPECTION_ITEM:'乐团主管未完成巡查计划安排',
  INSPECTION_ITEM_PLAN:'乐团主管已安排的巡查任务未提交',
  STUDENT_VISIT:'乐团主管未完成回访任务',
  TEACHER_EXCEPTION_ATTENDANCE:'课程上有老师或学员考勤异常',
  TEACHER_NOT_A_CLASS:'课程无老师考勤',
  TEACHER_SERVE_ERROR:'服务指标生成的作业未布置',
  WAIT_CREATE_PAYMENT_CALENDER:'缴费项目有效期结束前7天'
}

const dates = {
  start: dayjs().subtract(2, 'month').set('date', 1).format('YYYY-MM-DD'),
  end: dayjs().format('YYYY-MM-DD'),
}

export const errorType = {
  MUSIC_PATROL_ITEM: {
    name: '乐团巡查事项异常',
    isError: false,
    url: '/business/musicInspection',
    always: true,
    query: {
      tabrouter: 'teamSchedule',
      searchType:'MUSIC_PATROL_ITEM',
      conclusionStatus: '1',
      ...dates,
    },
  },
  HIGH_CLASS_STUDENT_LESS_THAN_THREE: {
    name: '基础技能班学员数量异常',
    isError: true,
    url: '/business/teamCLassList',
    always: true,
    query: {
      lessThenThreeHighOnline: '1',
    },
  },
  STUDENT_NOT_PAYMENT: {
    name: '未缴费学员数',
    isError: true,
    url: '/business/ArrearageStudents',
    always: true,
  },
  STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP: {
    name: '申请退团学员数',
    isError: true,
    url: '/business/WithdrawalApplication',
    always: true,
    query: {
      visitFlag: '0',
    },
  },
  WAIT_CREATE_PAYMENT_CALENDER: {
    name: '待创建缴费项目',
    isError: true,
    url: '/business/teamDetail',
    resultKey: 'search',
  },
  COURSE_TRUANT_STUDENT_NUM: {
    name: '学员考勤异常旷课',
    isError: true,
    url: '/operateManager/stuRecodeManager',
    always: true,
    query: {
      visitFlag: '0',
      status: 'TRUANT',
      ...dates,
    }
  },
  COURSE_LEAVE_STUDENT_NUM: {
    name: '学员请假',
    isError: true,
    url: '/operateManager/stuRecodeManager',
    always: true,
    query: {
      visitFlag: 0,
      status: 'LEAVE',
      ...dates,
    }
  },
  TEACHER_EXCEPTION_ATTENDANCE: {
    name: '课程考勤异常',
    isError: true,
    always: true,
    url: '/business/teamCourseList',
    query: {
      searchType: 'ERR_ATTENDANCE',
      ...dates,
      start: '2021-02-01',
    },
  },
  TEACHER_NOT_A_CLASS: {
    name: '课程异常',
    isError: true,
    always: true,
    url: '/business/teamCourseList',
    query: {
      searchType: 'NO_ATTENDANCE',
      ...dates,
      start: '2021-02-01',
    },
  },
  TEACHER_LEAVE: {
    name: '老师请假',
    isError: false,
    url: '/journal/journal',
    resultKey: 'search',
    query: {
      tabrouter: 'LEAVE'
    }
  },
  TEACHER_EXPECT_SALARY_BE_LOW: {
    name: '预计课酬较低',
    isError: false,
    url: '/operateManager/operationalList',
    always: true,
    query: {
      lowSalary: 1
    }
  },
  INSPECTION_ITEM: {
    name: '乐团巡查任务未计划',
    isError: true,
    always: true,
    url: '/main/main',
    resultKey: 'ids',
    query: {
      tabrouter: 'teamSchedule',
      searchType: 'INSPECTION_ITEM',
    },
  },
  INSPECTION_ITEM_PLAN: {
    name: '乐团巡查任务未提交',
    isError: true,
    url: '/business/musicInspection',
    always: true,
    query: {
      searchType: 'INSPECTION_ITEM_PLAN',
      ...dates
    },
  },
  STUDENT_VISIT: {
    name: '回访任务未完成',
    isError: true,
    url: '/main/main',
    always: true,
    query: {
      tabrouter: 'teamSchedule',
      searchType: 'STUDENT_VISIT',
      ...dates
    },
  },
  TEACHER_SERVE_ERROR: {
    name: '服务指标异常',
    isError: true,
    always: true,
    url: '/operateManager/serverDetail',
    query: {
      searchType: 'TEACHER_SERVE_ERROR',
      unDone:1
    },
  }
}

export const matterTypes = {
  INSPECT: '下校巡查',
  VISIT: '学员回访',
}

export const chioseNum = 31
