import request from '@/utils/request'

// 创建会计账簿
export function createAccountingBook(query,data) {
  return request({
    url: '/archives/accounting-book/create',
    method: 'post',
    params: query,
    data: data
  })
}

// 更新会计账簿
export function updateAccountingBook(data) {
  return request({
    url: '/archives/accounting-book/update',
    method: 'put',
    data: data
  })
}

// 删除会计账簿
export function deleteAccountingBook(id) {
  return request({
    url: '/archives/accounting-book/delete?id=' + id,
    method: 'delete'
  })
}

// 获得会计账簿
export function getAccountingBook(id) {
  return request({
    url: '/archives/accounting-book/get?id=' + id,
    method: 'get'
  })
}

// 获得会计账簿分页
export function getAccountingBookPage(query) {
  return request({
    url: '/archives/accounting-book/page',
    method: 'get',
    params: query
  })
}

// 导出会计账簿 Excel
export function exportAccountingBookExcel(query) {
  return request({
    url: '/archives/accounting-book/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

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