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

//  箭冠 产品 列表  分页  采购
export const productListPurchase = (params) => {
  const url = `/dealerProduct/queryPageForPurchase/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  箭冠 产品 列表  分页
export const productList = (params) => {
  const url = `/product/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 查询最近上下线产品
export const queryNewProductPage = (params) => {
  const url = `/product/queryNewProductPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 产品详情
export const productDetail = (params) => {
  const url = `/product/findBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get'
  })
}
//  产品  价格变更记录  列表  分页
export const productPriceChangeList = (params) => {
  const url = `/product/priceChange/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  查找当前经销商信息
export const getCurrentDealer = (params) => {
  return axios({
    url: `/dealer/findCurrentDealer`,
    method: 'get'
  })
}
// 产品上线信息  导出
export const productExport = params => {
  return axios.request({
    url: `/product/export`,
    method: 'post',
    data: params,
    responseType: 'blob'
  })
}
