import request from '@/utils/httpRequest'

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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