import request from '@/utils/request'

// 创建库区库域
export function createWarehouseArea(data) {
  return request({
    url: '/ecw/warehouse-area/create',
    method: 'post',
    data: data
  })
}

// 更新库区库域
export function updateWarehouseArea(data) {
  return request({
    url: '/ecw/warehouse-area/update',
    method: 'put',
    data: data
  })
}

// 删除库区库域
export function deleteWarehouseArea(id) {
  return request({
    url: '/ecw/warehouse-area/delete?id=' + id,
    method: 'delete'
  })
}

// 获得库区库域
export function getWarehouseArea(id) {
  return request({
    url: '/ecw/warehouse-area/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库查询库域
export function getByWarehouseId(params) {
  return request({
    url: '/ecw/warehouse-area/getByWarehouseId',
    method: 'get',
    params
  })
}

// 获得库区库域分页
export function getWarehouseAreaPage(query) {
  return request({
    url: '/ecw/warehouse-area/page',
    method: 'get',
    params: query
  })
}

// 导出库区库域 Excel
export function exportWarehouseAreaExcel(query) {
  return request({
    url: '/ecw/warehouse-area/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function getWarehouseAreaList(query) {
  return request({
    url: '/ecw/warehouse-area/list',
    method: 'get',
    params: query
  })
}

