import request from '@/utils/request'

// 查询仓库管理列表
export function listStorage(query) {
  return request({
    url: '/system/storage/list',
    method: 'get',
    params: query
  })
}

// 查询仓库管理列表 不分页
export function selectStorageList(query) {
  return request({
    url: '/system/storage/selectList',
    method: 'get',
    params: query
  })
}

// 查询仓库管理详细
export function getStorage(id) {
  return request({
    url: '/system/storage/' + id,
    method: 'get'
  })
}

// 新增仓库管理
export function addStorage(data) {
  return request({
    url: '/system/storage',
    method: 'post',
    data: data
  })
}

// 修改仓库管理
export function updateStorage(data) {
  return request({
    url: '/system/storage',
    method: 'put',
    data: data
  })
}

// 删除仓库管理
export function delStorage(id) {
  return request({
    url: '/system/storage/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/storage/enable/' + id,
    method: 'delete'
  })
}

// 禁用
export function disabled(id) {
  return request({
    url: '/system/storage/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/storage/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询仓库库区库位列表
export function listStorageAreaLocation(query) {
  return request({
    url: '/system/storage/storageAreaLocationList',
    method: 'get',
    params: query
  })
}