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

// 获取产品适用活动的促销产品列表
export const getPromoGoodsList = (params) => {
  const url = `/sales/detail/getPromoGoodsList/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('列表查询')
    }
  })
}

// 批量添加促销品
export const addPromoGoods = (params) => {
  return axios({
    url: `/sales/detail/addPromoGoods`,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('批量添加促销品')
    }
  })
}
// 促销产品统计  列表  分页
export const salesDetailPromoList = (params) => {
  const url = `/sales/detail/queryPageByPromo/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('列表查询')
    }
  })
}
// 促销产品统计  合计
export const salesDetailPromoCount = (params) => {
  return axios({
    url: `/sales/detail/queryCountByPromo`,
    data: params,
    method: 'post'
  })
}
// 促销产品统计  详情  列表  分页
export const salesDetailPromoProductList = (params) => {
  const url = `/sales/detail/queryPageOfPromoProduct/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('列表查询')
    }
  })
}

