import request from '@/utils/request'

// 创建货架格子
export function createShelfGrid(data) {
  return request({
    url: '/ecw/shelf-grid/create',
    method: 'post',
    data: data
  })
}

// 更新货架格子
export function updateShelfGrid(data) {
  return request({
    url: '/ecw/shelf-grid/update',
    method: 'put',
    data: data
  })
}

// 删除货架格子
export function deleteShelfGrid(id) {
  return request({
    url: '/ecw/shelf-grid/delete?id=' + id,
    method: 'delete'
  })
}

// 获得货架格子
export function getShelfGrid(id) {
  return request({
    url: '/ecw/shelf-grid/get?id=' + id,
    method: 'get'
  })
}

// 获得货架格子分页
export function getShelfGridPage(query) {
  return request({
    url: '/ecw/shelf-grid/page',
    method: 'get',
    params: query
  })
}

// 导出货架格子 Excel
export function exportShelfGridExcel(query) {
  return request({
    url: '/ecw/shelf-grid/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
