import request from '@/utils/request'

// 创建凭证详情
export function createVoucherDetails(data) {
  return request({
    url: '/accounting/voucher-details/create',
    method: 'post',
    data: data
  })
}

// 更新凭证详情
export function updateVoucherDetails(data) {
  return request({
    url: '/accounting/voucher-details/update',
    method: 'put',
    data: data
  })
}

// 删除凭证详情
export function deleteVoucherDetails(id) {
  return request({
    url: '/accounting/voucher-details/delete?id=' + id,
    method: 'delete'
  })
}

// 获得凭证详情
export function getVoucherDetails(id) {
  return request({
    url: '/accounting/voucher-details/get?id=' + id,
    method: 'get'
  })
}

// 获得凭证详情分页
export function getVoucherDetailsPage(query) {
  return request({
    url: '/accounting/voucher-details/page',
    method: 'get',
    params: query
  })
}

// 导出凭证详情 Excel
export function exportVoucherDetailsExcel(query) {
  return request({
    url: '/accounting/voucher-details/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
