import request from '../request.js';

/** 接口管理 */
const Api = {
  page: '/api/wms/wmsWarehouse/page',
  list: '/api/wms/wmsWarehouse/list',
  save: '/api/wms/wmsWarehouse/save',
  edit: '/api/wms/wmsWarehouse/edit',
  remove: '/api/wms/wmsWarehouse/remove',
  getReport: '/api/restful/report/commonReport',
}

/** 货位列表 (分页) */
export const page = data => {
  return request.request({
    url: Api.page,
    params: data,
    method: 'GET'
  })
}

/** 列表 */
export const list = data => {
  return request.request({
    url: Api.list,
    params: data,
    method: 'GET'
  })
}

/** 保存 */
export const save = data => {
  return request.request({
    url: Api.save,
    data: data,
    method: 'POST'
  })
}

/** 修改 */
export const edit = data => {
  return request.request({
    url: Api.edit,
    data: data,
    method: 'PUT'
  })
}

/** 删除 */
export const remove = data => {
  return request.request({
    url: Api.remove,
    params: data,
    method: 'DELETE'
  })
}

/** 批量删除 */
export const removeBatch = data => {
  return request.request({
    url: Api.removeBatch,
    params: data,
    method: 'DELETE'
  })
}

/** 根据参数和获取 指定配置对应的报表数据 */
export const getReport = data => {
  return request.request({
    url: Api.getReport,
    data: data,
    method: 'POST'
  })
}
