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

// 销售明细导出报表
export const salesDetailExport = (params) => {
  return axios({
    url: '/report/salesBillReport/salesDetail',
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}
//  开单销售单报表   列表  有分页
export const salesBillReportList = (params) => {
  const url = `/report/salesBillReport/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

//  开单销售报表   列表  有分页
export const salesBillReportGroupByBuyerList = (params) => {
  const url = `/report/salesBillReport/queryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

//  开单销售单报表合计
export const salesBillReportCount = (params) => {
  return axios({
    url: '/report/salesBillReport/totalSaleAmount',
    data: params,
    method: 'post'
  })
}

//  开单销售报表合计
export const salesBillReportCountByBuyer = (params) => {
  return axios({
    url: '/report/salesBillReport/totalGroupByBuyer',
    data: params,
    method: 'post'
  })
}

// 实售销售报表
export const salesBillRealAmountQueryPageList = (params) => {
  const url = `/report/salesBillReport/realAmountQueryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

//  实售销售报表   合计
export const salesBillRealReportCount = (params) => {
  return axios({
    url: '/report/salesBillReport/totalRealAmount',
    data: params,
    method: 'post'
  })
}
