import request from '@/utils/request'

// 查询物资分类列表
export function listMaterialType(query) {
  return request({
    url: '/business/materialType/list',
    method: 'get',
    params: query
  })
}

// 查询物资分类树结构
export function typeTree(query) {
  return request({
    url: '/business/materialType/typeTree',
    method: 'get',
    params: query
  })
}

// 查询物资分类列表
export function listTypeExcludeChild(typeId) {
  return request({
    url: '/business/materialType/list/exclude/' + typeId,
    method: 'get',
  })
}

// 查询物资分类详细
export function getMaterialType(typeId) {
  return request({
    url: '/business/materialType/' + typeId,
    method: 'get'
  })
}

// 新增物资分类
export function addMaterialType(data) {
  return request({
    url: '/business/materialType',
    method: 'post',
    data: data
  })
}

// 修改物资分类
export function updateMaterialType(data) {
  return request({
    url: '/business/materialType',
    method: 'put',
    data: data
  })
}

// 删除物资分类
export function delMaterialType(typeId) {
  return request({
    url: '/business/materialType/' + typeId,
    method: 'delete'
  })
}
