import request from '@/utils/request'

// 查询财务分类列表
export function listFinancialClass(query) {
  return request({
    url: '/system/financialClass/list',
    method: 'get',
    params: query
  })
}

// 查询财务分类详细
export function getFinancialClass(id) {
  return request({
    url: '/system/financialClass/' + id,
    method: 'get'
  })
}

// 新增财务分类
export function addFinancialClass(data) {
  return request({
    url: '/system/financialClass',
    method: 'post',
    data: data
  })
}

// 修改财务分类
export function updateFinancialClass(data) {
  return request({
    url: '/system/financialClass',
    method: 'put',
    data: data
  })
}

// 删除财务分类
export function delFinancialClass(id) {
  return request({
    url: '/system/financialClass/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/financialClass/enable/' + id,
    method: 'delete'
  })
}

// 禁用
export function disabled(id) {
  return request({
    url: '/system/financialClass/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/financialClass/changeStatus',
    method: 'put',
    data: data
  })
}