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

//  仓库调拨 列表  分页
export const allocWarehouseList = (params) => {
  const url = `/allocWarehouse/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 仓库调拨  审核
export const allocWarehouseAudit = params => {
  return axios({
    url: '/allocWarehouse/audit',
    data: params,
    method: 'post'
  })
}
// 仓库调拨  删除
export const allocWarehouseDel = params => {
  return axios({
    url: `/allocWarehouse/delete/${params.id}`,
    method: 'get'
  })
}
// 仓库调拨 详情  合计
export const allocWarehouseDetailCount = params => {
  return axios({
    url: '/allocWarehouse/detail/queryCount',
    data: params,
    method: 'post'
  })
}
// 仓库调拨 详情 列表  分页
export const allocWarehouseDetailList = params => {
  const url = `/allocWarehouse/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 仓库调拨  详情  添加/编辑
export const allocWarehouseDetailSave = params => {
  return axios({
    url: '/allocWarehouse/detail/save',
    data: params,
    method: 'post'
  })
}
// 仓库调拨  详情  删除
export const allocWarehouseDetailDel = params => {
  return axios({
    url: '/allocWarehouse/detail/delete',
    data: params,
    method: 'post'
  })
}
// 仓库调拨  保存
export const allocWarehouseSave = params => {
  return axios({
    url: '/allocWarehouse/save',
    data: params,
    method: 'post'
  })
}
// 选择产品
export const productQuery = params => {
  const url = `/stock/detail/queryStockProductPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 仓库调拨 详情
export const allocWarehouseDetail = params => {
  const url = `/allocWarehouse/findById/${params.id}`
  delete params.id
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  仓库调拨 详情  根据sn查
export const allocWarehouseDetailSn = (params) => {
  return axios({
    url: `/allocWarehouse/findBySn/${params.sn}`,
    method: 'get'
  })
}
// 仓库调拨 提交
export const allocWarehouseSubmit = params => {
  return axios({
    url: '/allocWarehouse/submit',
    data: params,
    method: 'post'
  })
}
