kongdeqiang
2023-09-12 b6809f71253a524d81c086ef1293acafdaba395e
src/components/page/invoice/invoiceForm.vue
@@ -106,7 +106,7 @@
            },
            getByCarNo() {
                this.invoiceData = []
                let url = this.$systemconfig.basePath + '/orderrecord/getByCarNo';
                let url = this.$systemconfig.basePath + '/ffzf/orderrecord/getByCarNo';
                let params = {
                    carNo: this.$route.query.carNo,
                    phone: this.$route.query.phone,
@@ -159,20 +159,42 @@
                this.checkAll = checkedCount === ids.length;
            },
            seeInvoice() {  //查看发票
                console.log(this.filedId.length,'this.filedId====')
                if(this.filedId.length == 0){
                    alert("请至少选择一项")
                }else {
                    let url = this.$systemconfig.basePath + '/fileInfo/download/downloadPng';
                    this.filedId.forEach(item => {
                        console.log(item,'item=======')
                    if(this.filedId.length == 1) {
                        let url = this.$systemconfig.basePath + '/ffzf/fileInfo/download/downloadPng';
                        this.filedId.forEach(item => {
                            let param = {
                                    fileId : item
                            }
                            this.$byutil.exportData(this,url,param,res => {
                                console.log(res,'res====')
                                let date = new Date()
                                let time = this.$moment(date).format('YYYY-MM-DD HH:mm:ss') + '-' + item
                                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 = '发票下载.png'
                                document.body.appendChild(downloadElement);
                                downloadElement.click(); //点击下载
                                document.body.removeChild(downloadElement); //下载完成移除元素
                                window.URL.revokeObjectURL(href); //释放掉blob对象
                            })
                        })
                    }else if(this.filedId.length > 1) {
                        let result =  this.filedId.join(",")
                        let url = this.$systemconfig.basePath + '/ffzf/fileInfo/download/downloadZips';
                        let param = {
                                fileId : item
                            fileIds : result
                        }
                        this.$byutil.exportData(this,url,param,res => {
                            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 blob = new Blob([res], {type: 'application/zip'});
                            let downloadElement = document.createElement("a");
                            downloadElement.style.display = "none";
                            let href = window.URL.createObjectURL(blob); //创建下载的链接
@@ -183,7 +205,7 @@
                            document.body.removeChild(downloadElement); //下载完成移除元素
                            window.URL.revokeObjectURL(href); //释放掉blob对象
                        })
                    })
                    }
                }
            },
            changeDate(){