import request from '@/utils/httpRequest'

export default class reimbursementSys {
  treeData (params) {
    return request({
      url: '/assess/reimbursement/treeData',
      method: 'get',
      params: params
    })
  }

  saveBusiness (inputForm) {
    return request({
      url: `/assess/reimbursement/saveBusiness`,
      method: 'post',
      data: inputForm
    })
  }

  saveGatheringTime (inputForm) {
    return request({
      url: `/assess/reimbursement/saveGatheringTime`,
      method: 'post',
      data: inputForm
    })
  }

  updateReimbursementRatio (inputForm) {
    return request({
      url: `/assess/reimbursement/updateReimbursementRatio`,
      method: 'post',
      data: inputForm
    })
  }

  saveInvoice (inputForm) {
    return request({
      url: `/assess/reimbursement/saveInvoice`,
      method: 'post',
      data: inputForm
    })
  }

  modifyInvoice (inputForm) {
    return request({
      url: `/assess/reimbursement/modifyInvoice`,
      method: 'post',
      data: inputForm
    })
  }

  deleteBusiness (ids) {
    return request({
      url: '/assess/reimbursement/deleteBusiness',
      method: 'delete',
      params: {ids: ids}
    })
  }

  deleteInvoice (ids) {
    return request({
      url: '/assess/reimbursement/deleteInvoice',
      method: 'delete',
      params: {ids: ids}
    })
  }

  delete (ids) {
    return request({
      url: '/assess/reimbursement/delete',
      method: 'delete',
      params: {ids: ids}
    })
  }

  queryBusinessById (id) {
    return request({
      url: `/assess/reimbursement/queryBusinessById`,
      method: 'get',
      params: {id: id}
    })
  }

  queryBusinessByInvoiceId (id) {
    return request({
      url: `/assess/reimbursement/queryBusinessByInvoiceId`,
      method: 'get',
      params: {id: id}
    })
  }

  queryInvoiceById (id) {
    return request({
      url: `/assess/reimbursement/queryInvoiceById`,
      method: 'get',
      params: {id: id}
    })
  }

  addBatchReimbursement (invoiceNumbers) {
    return request({
      url: '/assess/reimbursement/addBatchReimbursement',
      method: 'put',
      params: {
        invoiceNumbers: invoiceNumbers
      }
    })
  }

  exportExcel (params) {
    return request({
      url: '/assess/reimbursement/export',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }

  exportTemplate () {
    return request({
      url: '/reimbursement/import/template',
      method: 'get',
      responseType: 'blob'
    })
  }
}
