import request from '@/utils/request'

// 查询库位列表
export function listWmslocation(query) {
  return request({
    url: '/wms/wmslocation/list',
    method: 'get',
    params: query
  })
}

// 查询库位详细
export function getWmslocation(locationId) {
  return request({
    url: '/wms/wmslocation/' + locationId,
    method: 'get'
  })
}

// 新增库位
export function addWmslocation(data) {
  return request({
    url: '/wms/wmslocation',
    method: 'post',
    data: data
  })
}

// 修改库位
export function updateWmslocation(data) {
  return request({
    url: '/wms/wmslocation',
    method: 'put',
    data: data
  })
}

// 删除库位
export function delWmslocation(locationId) {
  return request({
    url: '/wms/wmslocation/' + locationId,
    method: 'delete'
  })
}

// 查询仓库列表
export function getWarehouses(query) {
  return request({
    url: '/wms/wmslocation/getWarehouses',
    method: 'get',
    params: query
  })
}


// 锁定库位
export function lockWmslocation(locationId) {
  return request({
    url: '/wms/wmslocation/lockWmsLocation/' + locationId,
    method: 'get'
  })
}

// 解锁库位
export function unlockWmslocation(locationId) {
  return request({
    url: '/wms/wmslocation/unlockWmsLocation/' + locationId,
    method: 'get'
  })
}
