const axios = require('@/common/axios').default
import qs from 'qs'
// import axios from '@/common/axios'
const api = '/api-teacher'

// 获取老师指定月份课酬信息
const findTeacherSettlementCourseSalarys = (data) => {
  return axios({
      url: api + '/courseScheduleTeacherSalary/findTeacherSettlementCourseSalarys',
      method: 'get',
      params: data
  })
}

// 分页查询结转奖励
const findTeacherRewards = (data) => {
  return axios({
      url: api + '/courseScheduleTeacherSalary/findTeacherRewards',
      method: 'get',
      params: data
  })
}

// 确定教师指定月份的课酬 
const confirmTeacherMonthSalary = (data) => {
  return axios({
      url: api + '/courseScheduleTeacherSalary/confirmTeacherMonthSalary',
      method: 'post',
      data: qs.stringify(data)
  })
}

// 课酬申述
const teacherSalaryComplaintAdd = (data) => {
  return axios({
      url: api + '/teacherSalaryComplaints/add',
      method: 'post',
      data: qs.stringify(data)
  })
}

// 获取申述
const teacherSalaryComplaintGet = (data) => {
  return axios({
      url: api + '/teacherSalaryComplaints/get',
      method: 'get',
      params: data
  })
}

// 获取当月未处理申述
const findByMonth = (data) => {
  return axios({
      url: api + '/teacherSalaryComplaints/findByMonth',
      method: 'post',
      data: qs.stringify(data)
  })
}

// 撤销当月未处理申述
const repealComplaints = (data) => {
  return axios({
      url: api + '/teacherSalaryComplaints/repealComplaints',
      method: 'post',
      data: qs.stringify(data)
  })
}

// 获取教师指定年份每月的课酬
const findTeacherYearSalarys = (data) => {
  return axios({
      url: api + '/courseScheduleTeacherSalary/findTeacherYearSalarys',
      method: 'get',
      params: data
  })
}

// 申诉列表
const teacherSalaryComplaintQueryPage = (data) => {
  return axios({
      url: api + '/teacherSalaryComplaints/queryPage',
      method: 'get',
      params: data
  })
}

// 线上课评论列表
const getOnlineCourse = (data) => {
  return axios({
      url: api + '/courseReview/getOnlineCourse',
      method: 'get',
      params: data
  })
}

// 布置线上课作业
const addHomeWork = (data) => {
  return axios({
      url: api + '/courseReview/addHomeWork',
      method: 'post',
      data: qs.stringify(data)
  })
}


export {
  findTeacherSettlementCourseSalarys,
  findTeacherRewards,
  confirmTeacherMonthSalary,
  teacherSalaryComplaintAdd,
  teacherSalaryComplaintGet,
  findByMonth,
  repealComplaints,
  findTeacherYearSalarys,
  teacherSalaryComplaintQueryPage,
  getOnlineCourse,
  addHomeWork
}