请求接口的数据并把数据带着传给接口下载文件‘
数据太大不能用get方法
方法如下

getDaochuData() {
  this.spinning = true
  let name = ''
  if (this.curSelect === 'facility') {
    name = '营地'
  } else if (this.curSelect === 'project') {
    name = '现场施工'
  } else if (this.curSelect === 'difference') {
    name = '差异'
  }
  //api是请求下载文件的接口
  let api = this.$route.query.host + '/api/matching/list?export=xls&fileName=' + name
  //model是请求带的参数
  let model = {
    'facilityId': this.value,
    'projectIds': this.treeValueObj,
    'beginDate': this.beginDate,
    'endDate': this.endeDate,
    'token': this.$route.query.token,
    'kind': this.curSelect, // facility营地 project施工现场 difference差异
    'keyword': '',
    'pageIndex': 0,
    'pageSize': 0
  }
  this.$axios.post(api, model, {
    //这个配置必须
    responseType: 'blob'
  })
    .then(res => {
      //以下是关键的地方,实现下载
      let blob = res.data
      let reader = new FileReader()
      reader.readAsDataURL(blob)
      reader.onload = (e) => {
        let a = document.createElement('a')
        a.download = name
        a.href = e.target.result
        document.body.appendChild(a)
        a.click()
        document.body.removeChild(a)
      }
      this.spinning = false
    })
    .catch(error => {
      this.spinning = false
      this.$message.info(error + '网络繁忙, getDaochuData MenJinReport.vue')
    })
}