
import request from '@/utils/request'

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

// 查询库位详细
export function getLocations(id) {
  return request({
    url: '/inventory/locations/' + id,
    method: 'get'
  })
}

// 新增库位
export function addLocations(data) {
  return request({
    url: '/inventory/locations',
    method: 'post',
    data: data
  })
}

// 修改库位
export function updateLocations(data) {
  return request({
    url: '/inventory/locations',
    method: 'put',
    data: data
  })
}

// 删除库位
export function delLocations(id) {
  return request({
    url: '/inventory/locations/' + id,
    method: 'delete'
  })
}

// 查询库位列表（无权限限制，用于选择器）
export function listLocationsForSelector(query) {
  return request({
    url: '/inventory/locations/listForSelector',
    method: 'get',
    params: query
  })
}

export function getlocationsdicts() {
  return request({
    url: '/inventory/owners/getMapList',
    method: 'get'
  })
}