import request from '@/utils/request'

// 查询支出科目列表
export function listSubject(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/expenditure/subject/list',
    method: 'get',
    params: query
  })
}

// 查询支出科目详细
export function getSubject(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/expenditure/subject/' + id,
    method: 'get'
  })
}

// 新增支出科目
export function addSubject(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/expenditure/subject',
    method: 'post',
    data: data
  })
}

// 修改支出科目
export function updateSubject(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/expenditure/subject',
    method: 'put',
    data: data
  })
}

// 删除支出科目
export function delSubject(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/expenditure/subject/' + id,
    method: 'delete'
  })
}
