import { request } from '@/utils/request'

// 对账管理
export const reconciliationApi = {
  // 对账单管理
  getBillList: (params: any) => request.get('/reconciliation/bill/list', params),
  getBillDetail: (id: number) => request.get(`/reconciliation/bill/${id}`),
  exportBill: (params: any) => request.get('/reconciliation/bill/export', params, { responseType: 'blob' }),

  // 开票管理
  getInvoiceOrderList: (params: any) => request.get('/reconciliation/invoice/order/list', params),
  applyInvoice: (data: any) => request.post('/reconciliation/invoice/apply', data),
  exportInvoiceOrder: (params: any) => request.get('/reconciliation/invoice/order/export', params, { responseType: 'blob' }),
  importInvoice: (file: File) => {
    const formData = new FormData()
    formData.append('file', file)
    return request.post('/reconciliation/invoice/import', formData)
  }
}
