From 2898325db11ed938f9891991198b88ea6a042d3d Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期二, 21 十一月 2023 09:51:39 +0800
Subject: [PATCH] 修改前端页面

---
 src/components/page/invoice/invoiceForm.vue |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/components/page/invoice/invoiceForm.vue b/src/components/page/invoice/invoiceForm.vue
index 5d7f31f..26536fc 100644
--- a/src/components/page/invoice/invoiceForm.vue
+++ b/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 => {
+                    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); //閲婃斁鎺塨lob瀵硅薄
+                            })
+                        })
+                    }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') + '-' + item
-                            console.log(time,'time===========')
-                            let blob = new Blob([res], {type: 'image/png'});
+                            let time = this.$moment(date).format('YYYY-MM-DD HH:mm:ss')
+                            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); //閲婃斁鎺塨lob瀵硅薄
                         })
-                    })
+                    }
                 }
             },
             changeDate(){

--
Gitblit v1.9.1