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

// 销售明细导出报表
export const salesDetailExport = (params) => {
  return axios({
    url: '/report/salesBillReport/salesDetail',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('销售单明细导出')
    }
  })
}
// 获取开单销售dan报表 表头
export const salesKdxxdReportTitle = (params) => {
  return axios({
    url: '/report/salesKdxxd/reportTitle',
    data: params,
    method: 'get'
  })
}
// 获取开单销售报表 表头
export const salesKdxxReportTitle = (params) => {
  return axios({
    url: '/report/salesKdxx/reportTitle',
    data: params,
    method: 'get'
  })
}
//  开单销售单报表   列表  有分页
export const salesBillReportList = (params) => {
  const url = `/report/salesKdxxd/reportPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('列表查询')
    }
  })
}

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

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

//  开单销售报表合计
export const salesBillReportCountByBuyer = (params) => {
  return axios({
    url: '/report/salesKdxx/reportCount',
    data: params,
    method: 'post'
  })
}
// 实售销售报表 biao头
export const salesBillRealReportTitle = (params) => {
  return axios({
    url: '/report/salesSsxs/reportTitle',
    data: params,
    method: 'get'
  })
}
// 实售销售报表
export const salesBillRealAmountQueryPageList = (params) => {
  const url = `/report/salesSsxs/reportPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
          'module': encodeURIComponent('列表查询')
    }
  })
}

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