zhangxiaoxu123
2023-01-04 cf1da9992ed87f5c014794da046e651e70693263
下载bug修改
1个文件已修改
22 ■■■■■ 已修改文件
src/components/page/invoice/invoiceForm.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/invoice/invoiceForm.vue
@@ -162,6 +162,7 @@
                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 = {
@@ -184,6 +185,27 @@
                            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(){