import request from '@/utils/request'

// 创建储位
export function createWarehouseAreaPosition(data) {
  return request({
    url: '/ecw/warehouse-area-position/create',
    method: 'post',
    data: data
  })
}

// 更新储位
export function updateWarehouseAreaPosition(data) {
  return request({
    url: '/ecw/warehouse-area-position/update',
    method: 'put',
    data: data
  })
}

// 删除储位
export function deleteWarehouseAreaPosition(id) {
  return request({
    url: '/ecw/warehouse-area-position/delete?id=' + id,
    method: 'delete'
  })
}

// 获得储位
export function getWarehouseAreaPosition(id) {
  return request({
    url: '/ecw/warehouse-area-position/get?id=' + id,
    method: 'get'
  })
}

// 获得储位分页
export function getWarehouseAreaPositionPage(query) {
  return request({
    url: '/ecw/warehouse-area-position/page',
    method: 'get',
    params: query
  })
}

// 导出储位 Excel
export function exportWarehouseAreaPositionExcel(query) {
  return request({
    url: '/ecw/warehouse-area-position/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
