import request from "@/http/request";

export const requireStockIn = (params) => {
  return request({
    url: '/task/requireStockIn',
    method: 'post',
    data: params
  })
}

export const requireStockOut = (params) => {
  return request({
    url: '/task/requireStockOut',
    method: 'post',
    data: params
  })
}

export const getCompareData = (params) => {
  return request({
    url: '/task/getCompareData',
    method: 'post',
    data: params
  })
}

export const queryStocksCompare = (params) => {
  return request({
    url: '/task/queryStocksCompare',
    method: 'post',
    data: params
  })
}

export const requireVehiclesForIn = (params) => {
  return request({
    url: '/task/requireVehiclesForIn',
    method: 'post',
    data: params
  })
}

export const getCurrentTask = (params) => {
  return request({
    url: '/task/getCurrentTask',
    method: 'post',
    data: params
  })
}

export const getPdaData = (params) => {
  return request({
    url: '/task/getPdaData',
    method: 'post',
    data: params
  })
}

export const confirmCurrentTask = (params, config = {}) => {
  return request({
    url: '/task/confirmCurrentTask',
    method: 'post',
    data: params,
    ...config
  })
}


export const confirmCurrentTaskByPDA = (params) => {
  return request({
    url: '/task/confirmCurrentTaskByPDA',
    method: 'post',
    data: params
  })
}

// 请求盘点
export const requestInventory = (params) => {
  return request({
    url: '/task/requestInventory',
    method: 'post',
    data: params
  })
}
// 获取盘点信息
export const getInventoryConfirm = (params) => {
  return request({
    url: '/task/getInventoryConfirm',
    method: 'post',
    data: params
  })
}
// 确认盘点信息
export const confirmInventory = (params) => {
  return request({
    url: '/task/confirmInventory',
    method: 'post',
    data: params
  })
}
// 获取缺料数量
export const getGoodsLackQty = (params) => {
  return request({
    url: '/task/getGoodsLackQty',
    method: 'get',
    params: {
      goodsId: params.goodsId,
      workOrder: params.workOrder
    }
  })
}