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

const Api = {
  page: '/api/wms/skuCategory/page',
  list: '/api/wms/skuCategory/list',
  remove: '/api/wms/skuCategory/remove',
  removeBatch: '/api/wms/skuCategory/removeBatch',
  save: '/api/wms/skuCategory/save',
  edit: '/api/wms/skuCategory/edit',
  getSkuCategoryListByCode: '/api/wms/skuCategory/getSkuCategoryListByCode',
}

/** 物料分类管理 */
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 getSkuCategoryListByCode = data => {
  return request.request({
    url: Api.getSkuCategoryListByCode,
    params: data,
    method: 'GET'
  })
}