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

//  采购详情 列表  分页
export const purchaseDetailList = (params) => {
  const url = `/purchaseDetail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  采购详情 保存
export const purchaseDetailSave = (params) => {
  return axios({
    url: '/purchaseDetail/save',
    data: params,
    method: 'post'
  })
}
//  采购详情 删除
export const purchaseDetailDel = (params) => {
  return axios({
    url: `/purchaseDetail/delete/${params.id}`,
    method: 'get'
  })
}
//  采购详情 整单删除
export const purchaseDetailDelAll = (params) => {
  return axios({
    url: `/purchaseDetail/deleteAll/${params.id}`,
    data: params,
    method: 'post'
  })
}

//  采购明细 统计
export const purchaseDetailCount = (params) => {
  return axios({
    url: `/purchaseDetail/queryCount`,
    data: params,
    method: 'post'
  })
}

//  采购入库 修改仓库仓位
export const purchaseUpdateWarehouse = (params) => {
  return axios({
    url: `/receivingDetail/updateWarehouse`,
    data: params,
    method: 'post'
  })
}
//  采购 详情 上次缺货 列表 分页
export const purchaseDetailCancelList = (params) => {
  const url = `/purchaseDetail/queryCancelPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
//  采购 详情 上次缺货 列表 分页
export const purchaseDetailCancelSave = (params) => {
  return axios({
    url: '/purchaseDetail/saveCancelProduct',
    data: params,
    method: 'post'
  })
}
