import request from '@/utils/request'

// 创建财务档案
export function createFinance(data) {
  return request({
    url: '/electronic/finance/create',
    method: 'post',
    data: data
  })
}

// 更新财务档案
export function updateFinance(data) {
  return request({
    url: '/electronic/finance/update',
    method: 'put',
    data: data
  })
}

// 删除财务档案
export function deleteFinance(id) {
  return request({
    url: '/electronic/finance/delete?id=' + id,
    method: 'delete'
  })
}

// 获得财务档案
export function getFinance(id) {
  return request({
    url: '/electronic/finance/get?id=' + id,
    method: 'get'
  })
}

// 获得财务档案分页
export function getFinancePage(query) {
  return request({
    url: '/electronic/finance/page',
    method: 'get',
    params: query
  })
}

// 导出财务档案 Excel
export function exportFinanceExcel(query) {
  return request({
    url: '/electronic/finance/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
