import request from '@/utils/request'

// 创建客户等级
export function createLevel(data) {
  return request({
    url: '/customer/level/create',
    method: 'post',
    data: data
  })
}

// 更新客户等级
export function updateLevel(data) {
  return request({
    url: '/customer/level/update',
    method: 'put',
    data: data
  })
}

// 删除客户等级
export function deleteLevel(id) {
  return request({
    url: '/customer/level/delete?id=' + id,
    method: 'delete'
  })
}

// 获得客户等级
export function getLevel(id) {
  return request({
    url: '/customer/level/get?id=' + id,
    method: 'get'
  })
}

// 获得客户等级分页
export function getLevelPage(query) {
  return request({
    url: '/customer/level/page',
    method: 'get',
    params: query
  })
}

// 导出客户等级 Excel
export function exportLevelExcel(query) {
  return request({
    url: '/customer/level/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
