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

//  库存列表  分页
export const stockList = (params) => {
  const url = `/stock/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存 列表 合计
export const stockCount = (params) => {
  return axios({
    url: '/stock/queryCount',
    data: params,
    method: 'post'
  })
}
//  库存 导出
export const stockExport = (params) => {
  return axios({
    url: '/stock/exportExcel',
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}
//  库存 详情列表  分页
export const stockDetailList = (params) => {
  const url = `/stock/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存 详情列表 合计
export const stockDetailCount = (params) => {
  return axios({
    url: '/stock/detail/queryCount',
    data: params,
    method: 'post'
  })
}

//  库存 详情列表  分页
export const querySumByProductLocation = (params) => {
  const url = `/stock/detail/querySumByProductLocation/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  出入库明细  列表  合计
export const stockByProductSn = (params) => {
  const url = `/stock/findByProductSn/${params.productSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
