import request from '@/utils/request'

// 创建我的发票
export function createInvoice(data) {
  return request({
    url: '/bs/invoice/create',
    method: 'post',
    data: data
  })
}

// 更新我的发票
export function updateInvoice(data) {
  return request({
    url: '/bs/invoice/update',
    method: 'put',
    data: data
  })
}

// 删除我的发票
export function deleteInvoice(id) {
  return request({
    url: '/bs/invoice/delete?id=' + id,
    method: 'delete'
  })
}

// 获得我的发票
export function getInvoice(id) {
  return request({
    url: '/bs/invoice/get?id=' + id,
    method: 'get'
  })
}

// 获得我的发票分页
export function getInvoicePage(query) {
  return request({
    url: '/bs/invoice/page',
    method: 'get',
    params: query
  })
}

// 导出我的发票 Excel
export function exportInvoiceExcel(query) {
  return request({
    url: '/bs/invoice/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
