import request from '@/utils/request'

// 创建收款单
export function createReceipt(data) {
  return request({
    url: '/ecw/receipt/create',
    method: 'post',
    data: data
  })
}

// 更新收款单
export function updateReceipt(data) {
  return request({
    url: '/ecw/receipt/update',
    method: 'put',
    data: data
  })
}

// 删除收款单
export function deleteReceipt(id) {
  return request({
    url: '/ecw/receipt/delete?id=' + id,
    method: 'delete'
  })
}

// 获得收款单
export function getReceipt(id) {
  return request({
    url: '/ecw/receipt/get?id=' + id,
    method: 'get'
  })
}

// 获得收款单分页
export function getReceiptPage(query) {
  return request({
    url: '/ecw/receipt/page',
    method: 'get',
    params: query
  })
}

// 导出收款单 Excel
export function exportReceiptExcel(query) {
  return request({
    url: '/ecw/receipt/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
