| | |
| | | if(this.filedId.length == 0){ |
| | | alert("请至少选择一项") |
| | | }else { |
| | | if(this.filedId.length == 1) { |
| | | let url = this.$systemconfig.basePath + '/fileInfo/download/downloadPng'; |
| | | this.filedId.forEach(item => { |
| | | let param = { |
| | |
| | | window.URL.revokeObjectURL(href); //释放掉blob对象 |
| | | }) |
| | | }) |
| | | }else if(this.filedId.length > 1) { |
| | | let result = this.filedId.join(",") |
| | | console.log(result,'result---------') |
| | | let url = this.$systemconfig.basePath + '/fileInfo/download/downloadZips'; |
| | | let param = { |
| | | fileIds : result |
| | | } |
| | | this.$byutil.exportData(this,url,param,res => { |
| | | console.log(res,'res=========') |
| | | let blob = new Blob([res], {type: 'application/zip'}); |
| | | let downloadElement = document.createElement("a"); |
| | | downloadElement.style.display = "none"; |
| | | let href = window.URL.createObjectURL(blob); //创建下载的链接 |
| | | downloadElement.href = href; |
| | | downloadElement.download = '发票下载.zip' |
| | | document.body.appendChild(downloadElement); |
| | | downloadElement.click(); //点击下载 |
| | | document.body.removeChild(downloadElement); //下载完成移除元素 |
| | | window.URL.revokeObjectURL(href); //释放掉blob对象 |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | changeDate(){ |