import request from '@/utils/request'

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

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

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


// 新增支出类目
export function addType(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/paymentEntry/type',
    method: 'post',
    data: data
  })
}

// 修改支出类目
export function updateType(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/paymentEntry/type',
    method: 'put',
    data: data
  })
}

// 删除支出类目
export function delType(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-financial'
  return request({
    url: '/paymentEntry/type/' + id,
    method: 'delete'
  })
}
