import axios from '@/libs/axios.js'

//  库存列表  分页
export const stockList = (params) => {
  const url = `stock/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存 列表 合计
export const stockCount = (params) => {
  return axios.request({
    url: 'stock/queryCount',
    data: params,
    method: 'post'
  })
}
//  库存 详情列表  分页
export const stockDetailList = (params) => {
  const url = `stock/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
//  库存流水（出入库明细） 列表  有分页
export const stockFlowList = (params) => {
  const url = `stockFlow/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    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.request({
    url: url,
    data: params,
    method: 'post'
  })
}
//  出入库明细  列表  合计
export const stockByProductSn = (params) => {
  const url = `stock/findByProductSn/${params.productSn}`
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}