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

// 调回单列表
export const shelfRecallList = (params) => {
  const url = `/shelfRecall/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  调回单详情列表
export const shelfRecallDetailList = (params) => {
  const url = 'shelfRecall/detail/queryList'
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  确认退库
export const warehouseCascadeList = (params) => {
  const url = '/shelfRecall/confirm'
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 取消调回单
export const shelfRecallCancel = params => {
  return axios({
    url: '/shelfRecall/cancel',
    data: params,
    method: 'post'
  })
}
// 删除回调单
export const shelfRecallDelete = params => {
  return axios({
    url: `/shelfRecall/delete/${params.recallBillSn}`,
    method: 'get'
  })
}
// 保存 调回单
export const shelfRecallSave = params => {
  return axios({
    url: '/shelfRecall/insert',
    data: params,
    method: 'post'
  })
}
// 查询不同状态的数据条数
export const shelfRecallStateCount = (params) => {
  return axios({
    url: '/shelfRecall/queryStateCount',
    data: params,
    method: 'post'
  })
}
// 获取调回单详情
export const shelfRecallDetail = params => {
  return axios({
    url: `/shelfRecall/findBySn/${params.recallSn}`,
    method: 'get'
  })
}

// 调回入库列表
export const recallStockList = (params) => {
  const url = `/shelfRecall/queryStockPutPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 调回入库信息
export const recallrStockDetail = params => {
  return axios({
    url: `/stockPut/findBySn/${params.stockPutSn}`,
    method: 'get'
  })
}
// 调回单入库明细列表
export const recallrStockDetailList = params => {
  return axios({
    url: `/stockPut/detail/query`,
    data: params,
    method: 'post'
  })
}
// 修改仓库仓位
export const updateSelective = (params) => {
  return axios({
    url: '/stockPut/detail/updateSelective',
    data: params,
    method: 'post'
  })
}
// 确认入库
export const confirmPutStock = (params) => {
  return axios({
    url: '/shelfRecall/confirmPutStock',
    data: params,
    method: 'post'
  })
}
// 待入库数量
export const stockPutCount = params => {
  return axios({
    url: '/shelfRecall/queryStockPutCount',
    data: params,
    method: 'post'
  })
}
