import request from '@/utils/request'

// 查询物资分类列表
export function listCategory(query) {
  return request({
    url: '/resources/material-categories/list',
    method: 'get',
    params: query
  })
}

// 查询物资分类树形下拉列表
export function treeselect() {
  return request({
    url: '/resources/material-categories/treeselect',
    method: 'get'
  })
}

// 查询物资分类列表（排除节点）
export function listCategoryExcludeChild(id) {
  return request({
    url: '/resources/material-categories/list/exclude/' + id,
    method: 'get'
  })
}

// 查询物资分类详情
export function getCategory(id) {
  return request({
    url: '/resources/material-categories/' + id,
    method: 'get'
  })
}

// 新增物资分类
export function addCategory(data) {
  return request({
    url: '/resources/material-categories',
    method: 'post',
    data: data
  })
}

// 修改物资分类
export function updateCategory(data) {
  return request({
    url: '/resources/material-categories',
    method: 'put',
    data: data
  })
}

// 删除物资分类
export function delCategory(id) {
  return request({
    url: '/resources/material-categories/' + id,
    method: 'delete'
  })
}