import request from '@/utils/request'

// 创建会计报表
export function createAccountingReport(data) {
  return request({
    url: '/archives/accounting-report/create',
    method: 'post',
    data: data
  })
}

// 更新会计报表
export function updateAccountingReport(data) {
  return request({
    url: '/archives/accounting-report/update',
    method: 'put',
    data: data
  })
}

// 删除会计报表
export function deleteAccountingReport(id) {
  return request({
    url: '/archives/accounting-report/delete?id=' + id,
    method: 'delete'
  })
}

// 获得会计报表
export function getAccountingReport(id) {
  return request({
    url: '/archives/accounting-report/get?id=' + id,
    method: 'get'
  })
}

// 获得会计报表分页
export function getAccountingReportPage(query) {
  return request({
    url: '/archives/accounting-report/page',
    method: 'get',
    params: query
  })
}

// 导出会计报表 Excel
export function exportAccountingReportExcel(query) {
  return request({
    url: '/archives/accounting-report/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 下载元数据
export function downloadXml(query) {
  return request({
    url: '/archives/accounting-report/downloadXml',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
