import request from '@/utils/wms-request'

// 查询生产领料单列表
export function listTask(query) {
  return request({
    url: '/produce/draw/task/list',
    method: 'get',
    params: query
  })
}

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
  return request({
    url: '/system/dict/data/type/' + dictType,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getConfigKey(configKey) {
  return request({
    url: '/system/config/configKey/' + configKey,
    method: 'get'
  })
}

// 查询仓库列表
export function listWarehouse(query) {
  return request({
    url: '/basic/warehouse/list',
    method: 'get',
    params: query
  })
}

// 选择库存查询物料库存信息列表
export function selectExactStockList(query) {
  return request({
    url: '/stock/stock/selectExactStockList',
    method: 'get',
    params: query
  })
}

// 分配库存
export function allocateStock(data) {
  return request({
    url: '/produce/draw/task/allocateStock',
    method: 'post',
    data: data
  })
}

// 修改生产领料单
export function updateTask(data) {
  return request({
    url: '/produce/draw/task',
    method: 'put',
    data: data
  })
}
// 生产拣货单
export function schedulePick(data) {
  return request({
    url: '/produce/draw/task/schedulePick',
    method: 'post',
    data: data
  })
}

// 新增U9物料库存信息,返回新增的记录
export function addU9StockRecord(data) {
  return request({
    url: '/stock/u9Stock/record',
    method: 'post',
    data: data
  })
}

// 查询已结案领料出库单列表
export function listSolvedOut(query) {
  return request({
    url: '/produce/draw/out/getSolvedList',
    method: 'get',
    params: query
  })
}



// 修改领料拣货单
export function updatePick(data) {
  return request({
    url: '/produce/draw/pick',
    method: 'put',
    data: data
  })
}