import request from '@/utils/request'

// 创建会计附件
export function createAttachment(data) {
  return request({
    url: '/accounting/attachment/create',
    method: 'post',
    data: data
  })
}

// 更新会计附件
export function updateAttachment(data) {
  return request({
    url: '/accounting/attachment/update',
    method: 'put',
    data: data
  })
}

// 删除会计附件
export function deleteAttachment(id) {
  return request({
    url: '/accounting/attachment/delete?id=' + id,
    method: 'delete'
  })
}

// 获得会计附件
export function getAttachment(id) {
  return request({
    url: '/accounting/attachment/get?id=' + id,
    method: 'get'
  })
}

// 获得会计附件分页
export function getAttachmentPage(query) {
  return request({
    url: '/accounting/attachment/page',
    method: 'get',
    params: query
  })
}

// 导出会计附件 Excel
export function exportAttachmentExcel(query) {
  return request({
    url: '/accounting/attachment/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
