import request from '@/config/axios'

// 查询列表-分页
export const getClassTypePage = async (params) => {
  return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
}

// 查询详情
export const getClassType = async (id) => {
  return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
}

// 新增
export const createClassType = async (data) => {
  return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
}

// 修改
export const updateClassType = async (params) => {
  return await request.put({ url: '/admin-api/crm/sch-class-type/update', data: params })
}

// 删除
export const deleteClassType = async (id) => {
  return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
}

// 修改状态
export const updateClassTypeStatus = async (data) => {
  return request.put({ url: '/admin-api/crm/sch-class-type/status/update', data })
}

// 批量修改状态
export const batchUpdateClassTypeStatus = async (data) => {
  return request.put({ url: '/admin-api/crm/sch-class-type/status/batch-update', data })
}

// 批量删除
export const batchDeleteClassType = async (ids) => {
  return await request.delete({ url: '/admin-api/crm/sch-class-type/batch-delete?ids=' + ids })
}

// 获取提成结算参数
export const getCommissionParams = async () => {
  return await request.get({ url: '/admin-api/crm/sch-class-type/get-percentage-param' })
}
