import request from '@/utils/request'
import qs from 'qs'
let api = '/api-web'
// 获取vip 分类列表
export function vipGroupCategory (data) {
  return request({
    url: api + '/vipGroupCategory/queryAll',
    method: 'get',
    params: data
  })
}

// 获取vip 老师默认分类列表
export function findTeacherDefaultSalary (data) {
  return request({
    url: api + '/vipGroupCategory/findTeacherDefaultSalary',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 获取 vip循环列表
export function getDefaultClassesCycle (data) {
  return request({
    url: api + '/vipGroupDefaultClassesCycle/queryAll',
    method: 'get',
    params: data,
  })
}

// 单个添加vip课程类型
export function addVipGroupCategory (data) {
  return request({
    url: api + '/vipGroupCategory/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 单个修改vip课程类型
export function resetVipGroupCategory (data) {
  return request({
    url: api + '/vipGroupCategory/update',
    method: 'post',
    data: qs.stringify(data)
  })
}
// 删除单个vip类型
export function removeVipGroupCategory (data) {
  return request({
    url: api + '/vipGroupCategory/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 新增排课周期
export function addDefaultClassesCycle (data) {
  return request({
    url: api + '/vipGroupDefaultClassesCycle/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 修改排课周期
export function resetDefaultClassesCycle (data) {
  return request({
    url: api + '/vipGroupDefaultClassesCycle/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 删除排课周期
export function removeDefaultClassesCycle (data) {
  return request({
    url: api + '/vipGroupDefaultClassesCycle/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 新增默认单价
export function defaultClassesUnitPrice (data) {
  return request({
    url: api + '/vipGroupDefaultClassesUnitPrice/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

// 查询活动方案列表
export function vipGroupActivity (data) {
  return request({
    url: api + '/vipGroupActivity/queryPage',
    method: 'get',
    params: data
  })
}

// 根据课程类型获取活动方案
export function vipGroupActivityFind (data) {
  return request({
    url: api + '/vipGroupActivity/findByVipGroupCategory',
    method: 'get',
    params: data
  })
}

// 新增vip课活动方案
export function addVipActive (data) {
  return request({
    url: api + '/vipGroupActivity/addVipGroupActivity',
    method: 'POST',
    data
  })
}
// 修改vio课活动方案
export function resetVipActive (data) {
  return request({
    url: api + '/vipGroupActivity/update',
    method: 'POST',
    data
  })
}

// 删除vip课

export function removeVipActive (data) {
  return request({
    url: api + '/vipGroupActivity/delete',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 获取vip列表
export function getVipList (data) {
  return request({
    url: api + '/vipGroupManage/queryAll',
    method: 'GET',
    params: data
  })
}
// 根据id获取vip详情
export function getVipGroupDetail (data) {
  return request({
    url: api + `/vipGroupManage/getVipGroupDetail`,
    method: 'GET',
    params: data
  })
}

// 根据id获取vip详情
export function getVipGroupDetailForAudit (data) {
  return request({
    url: api + `/vipGroupManage/getVipGroupDetailForAudit`,
    method: 'GET',
    params: data
  })
}

// 根据vipid获取学员
export function findVipGroupStudents (data) {
  return request({
    url: api + '/vipGroupManage/findVipGroupStudents',
    method: 'GET',
    params: data
  })
}

// 根据vipid和学生id 退学
export function leaveSchool (data) {
  return request({
    url: api + '/vipGroupManage/applyRefundForStudent',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 获取vip教学记录
export function findVipGroupTeachingRecord (data) {
  return request({
    url: api + '/vipGroupManage/findVipGroupTeachingRecord',
    method: 'get',
    params: data
  })
}

// 获取vip财务信息
export function getVipGroupSalarys (data) {
  return request({
    url: api + '/vipGroupManage/findVipGroupSalarys',
    method: 'get',
    params: data
  })
}

// 获取当前课程上课学员
export function getStudyStudents (data) {
  return request({
    url: api + '/vipGroupManage/findVipGroupAttendanceStudents',
    method: 'get',
    params: data
  })
}

// vip课时调整
export function resetVipClass (data) {
  return request({
    url: api + '/vipGroupManage/classStartDateAdjust',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 计算vip课酬
export function getVipGroupCostCount (data) {
  return request({
    url: api + '/vipGroupManage/getVipGroupCostCount',
    method: 'POST',
    params: data
  })
}

// vip课申请
export function createVip (data) {
  return request({
    url: api + '/vipGroupManage/vipGroupApply',
    method: 'POST',
    data
  })
}

// 暂停vip
export function closeVip (data) {
  return request({
    url: api + '/vipGroupManage/stopVipGroup',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 修改vip基本信息

export function updateVipBaseInfo (data) {
  return request({
    url: api + '/vipGroupManage/updateVipBaseInfo',
    method: 'POST',
    data
  })
}

// 获取vip课程计划
export function findVipGroupCourseSchedules (data) {
  return request({
    url: api + '/courseSchedule/findVipGroupCourseSchedules',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 批量删除课程 删除vip
export function bathDelete (data) {
  return request({

    url: api + '/courseSchedule/batchDelete',
    method: 'POST',
    data: qs.stringify(data)
  })
}
// vip批量修改
export function vipCourseAdjust (data) {
  return request({
    url: api + '/courseSchedule/vipCourseAdjust',
    method: 'POST',
    data
  })
}

// 新增vip课程计划
export function appendVipGroupCourseSchedules (data) {
  return request({
    url: api + '/vipGroupManage/appendVipGroupCourseSchedules',
    method: 'POST',
    data
  })
}

// vip退费查询
export function getStudentSurplusCourseFee (data) {
  return request({
    url: api + '/vipGroupManage/getStudentSurplusCourseFee',
    method: 'get',
    params: data
  })
}

// vip搜索课程余额的学生
export function getHaveCourseBalanceStudents (data) {
  return request({
    url: api + '/vipGroupManage/findHaveCourseBalanceStudents',
    method: 'get',
    params: data
  })
}

// vip添加学员 addVipGroupStudents
export function addVipGroupStudents (data) {
  return request({
    url: api + '/vipGroupManage/addVipGroupStudents',
    method: 'get',
    params: data
  })
}
// /courseSchedule/batchAppendVipGroupCourses
// vip课批量新增
export function batchAppendVipGroupCourses (data) {
  return request({
    url: api + '/courseSchedule/batchAppendVipGroupCourses',
    method: 'POST',
    data
  })
}

// vip休学 
export function vipPauseForStudent (data) {
  return request({
    url: api + '/vipGroupManage/pauseForStudent',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 获取学生休学信息
export function getStudentPauseInfo (data) {
  return request({
    url: api + '/vipGroupManage/getStudentPauseInfo',
    method: 'POST',
    data: qs.stringify(data)
  })
}

// 恢复休学
export function recoverForStudent (data) {
  return request({
    url: api + '/vipGroupManage/recoverForStudent',
    method: 'POST',
    data
  })
}

// 根据vip课所在部门与声部获取教师
export function findTeacherWithVipGroupOrganAndSubject (data) {
  return request({
    url: api + '/vipGroupManage/findTeacherWithVipGroupOrganAndSubject',
    method: 'get',
    params: data
  })
}
