import request from '@/utils/request'

// 创建重泡货配置
export function createZhongPao(data) {
  return request({
    url: '/ecw/zhong-pao/create',
    method: 'post',
    data: data
  })
}

// 更新重泡货配置
export function updateZhongPao(data) {
  return request({
    url: '/ecw/zhong-pao/update',
    method: 'put',
    data: data
  })
}

// 删除重泡货配置
export function deleteZhongPao(id) {
  return request({
    url: '/ecw/zhong-pao/delete?id=' + id,
    method: 'delete'
  })
}

// 获得重泡货配置
export function getZhongPao(id) {
  return request({
    url: '/ecw/zhong-pao/get?id=' + id,
    method: 'get'
  })
}

// 获得客户最优惠的重泡货配置
export function getZhongPaoBest(query) {
  return request({
    url: '/ecw/zhong-pao/get-customer-best-zhong-pao',
    method: 'get',
    params: query
  })
}

// 获得重泡货配置分页
export function getZhongPaoPage(query) {
  return request({
    url: '/ecw/zhong-pao/page',
    method: 'get',
    params: query
  })
}

// 导出重泡货配置 Excel
export function exportZhongPaoExcel(query) {
  return request({
    url: '/ecw/zhong-pao/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
