zhangxiaoxu123
2023-01-03 9f928812aca560e9973283c53d4cc5e1a1c00a3c
src/components/page/invoice/invoiceForm.vue
@@ -162,23 +162,27 @@
              if(this.filedId.length == 0){
                alert("请至少选择一项")
              }else {
                let result =  this.filedId.join(",")
                let url = this.$systemconfig.basePath + '/fileInfo/download/downloadZips';
                    let url = this.$systemconfig.basePath + '/fileInfo/download/downloadPng';
                    this.filedId.forEach(item => {
                        console.log(item,'item=======')
                let param = {
                  fileIds : result
                                fileId : item
                }
                this.$byutil.exportData(this,url,param,res => {
                    console.log(res,'res=========')
                    let blob = new Blob([res], {type: 'application/zip'});
                            console.log(res,'res====')
                            let date = new Date()
                            let time = this.$moment(date).format('YYYY-MM-DD HH:mm:ss')
                            let blob = new Blob([res], {type: 'image/png'});
                    let downloadElement = document.createElement("a");
                    downloadElement.style.display = "none";
                    let href = window.URL.createObjectURL(blob); //创建下载的链接
                    downloadElement.href = href;
                    downloadElement.download = '发票下载.zip'
                            downloadElement.download = time
                    document.body.appendChild(downloadElement);
                    downloadElement.click(); //点击下载
                    document.body.removeChild(downloadElement); //下载完成移除元素
                    window.URL.revokeObjectURL(href); //释放掉blob对象
                        })
                })
              }
            },
@@ -190,6 +194,9 @@
</script>
<style lang="scss">
    .el-message-box{
        width: 80% !important;
    }
    .fapiao-btn{
        .el-checkbox{
          width: 100px!important;