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

//  缺货  列表  分页
export const oosList = (params) => {
  const url = `/oos/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
//  缺货  详情
export const oosDetail = (params) => {
  const url = `/oos/findBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get'
  })
}
//  缺货 按客户导出
export const oosDetailExport = (params) => {
  return axios({
    url: '/oos/detail/exportByBuyer',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('按客户导出')
    }
  })
}
//  缺货 按产品导出
export const oosDetailExportByProduct = (params) => {
  return axios({
    url: '/oos/detail/exportByProduct',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('按产品导出')
    }
  })
}

//  缺货  详情  列表  分页
export const oosDetailList = (params) => {
  const url = `/oos/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('详情列表查询')
    }
  })
}
// 缺货统计  按客户  列表  分页
export const oosBuyerList = (params) => {
  const url = `/oos/detail/queryPageByBuyer/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
// 缺货统计  按客户  合计  本页
export const oosBuyerDetailPageCount = (params) => {
  const url = `/oos/detail/queryPageCountByBuyer/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 缺货统计  按客户  合计
export const oosBuyerDetailCount = (params) => {
  return axios({
    url: '/oos/detail/queryAllCountByBuyer',
    data: params,
    method: 'post'
  })
}
// 缺货统计  按产品  列表  分页
export const oosProductList = (params) => {
  const url = `/oos/detail/queryPageByProduct/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
// 缺货统计  按产品  合计  本页
export const oosProductDetailPageCount = (params) => {
  const url = `/oos/detail/queryPageCountByProduct/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 缺货统计  按产品  合计
export const oosProductDetailCount = (params) => {
  return axios({
    url: '/oos/detail/queryAllCountByProduct',
    data: params,
    method: 'post'
  })
}
// 缺货 详情  打印
export const oosDetailPrint = params => {
  return axios.request({
    url: `oos/print/${params.sn}`,
    method: 'get',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('打印')
    }
  })
}
