import { axios } from '@/utils/request'

//  经销商产品 列表  分页  （自建产品）
export const dealerProductList = (params) => {
  const url = `/dealerProduct/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

//  散件入库 列表  分页  （自建产品）
export const bulkProductList = (params) => {
  const url = `/dealerProduct/queryPageForSparePartsPur/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 新增/编辑 经销商产品
export const dealerProductSave = params => {
  return axios({
    url: '/dealerProduct/save',
    data: params,
    method: 'post'
  })
}

// 经销商产品 更改状态
export const dealerProductUpdate = params => {
  return axios({
    url: '/dealerProduct/updateStatus',
    data: params,
    method: 'post'
  })
}

// 经销商产品 导出
export const dealerProductExport = params => {
  return axios({
    url: '/dealerProduct/export',
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}

//  经销商产品  详情
export const dealerProductDetail = (params) => {
  return axios({
    url: `/dealerProduct/findById/${params.id}`,
    data: {},
    method: 'get'
  })
}
//  赠品 列表  分页
export const giftsDetailList = (params) => {
  const url = `/giftsDetail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  产品定价 列表  分页
export const dealerProductPriceList = (params) => {
  const url = `/dealerProduct/queryPageForSalesOffer/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
