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

//  出库 列表  有分页
export const stockOutList = (params) => {
  const url = `/stockOut/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('列表查询')
    }
  })
}
//  出库 出库
export const stockOutOut = (params) => {
  return axios({
    url: '/stockOut/out',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent(params.length==1?'出库':'批量出库')
    }
  })
}
//  出库 详情
export const stockOutDetail = (params) => {
  const url = `/stockOut/queryDetailHeadInfoBySn/${params.sn}`
  return axios({
    url: url,
    data: {},
    method: 'post'
  })
}
//  出库 详情 列表 有分页
export const stockOutDetailList = (params) => {
  const url = `/stockOut/queryDetailPageBySn/${params.sn}/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('明细列表')
    }
  })
}
//  出库 详情 合计
export const stockOutDetailCount = (params) => {
  const url = `/stockOut/queryDetailPageCountBySn/${params.sn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 导出销售
export const exportSalesOutProduct = (params) => {
  const url = `/stockOutDetail/exportSalesOutProduct`
  return axios({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('导出')
    }
  })
}
