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 | 196 ++++++++++++++++++++++-------------------------- 1 files changed, 91 insertions(+), 105 deletions(-) diff --git a/src/components/page/invoice/invoiceForm.vue b/src/components/page/invoice/invoiceForm.vue index 487a110..26536fc 100644 --- a/src/components/page/invoice/invoiceForm.vue +++ b/src/components/page/invoice/invoiceForm.vue @@ -1,77 +1,71 @@ <template> <div class="invoiceForm-wrap"> - <div v-if="isWeiXin "> - <div class="title">璁㈠崟鍙戠エ</div> - <div class="invoiceForm-main"> - <div class="invoiceForm-main-inside"> - <div class="invoice-date-box"> - <el-date-picker - :editable="false" - format="yyyy-MM" - value-format="yyyy-MM" - v-model="date" - type="month" - @change="changeDate" - placeholder="閫夋嫨鏃ユ湡"> - </el-date-picker> + <div class="title">璁㈠崟鍙戠エ</div> + <div class="invoiceForm-main"> + <div class="invoiceForm-main-inside"> + <div class="invoice-date-box"> + <el-date-picker + :editable="false" + format="yyyy-MM" + value-format="yyyy-MM" + v-model="date" + type="month" + @change="changeDate" + placeholder="閫夋嫨鏃ユ湡"> + </el-date-picker> + </div> + <van-list + v-model="loading" + :finished="finished" + finished-text="娌℃湁鏇村浜�" + :offset="50" + :immediate-check="false" + @load="onLoad" + > + + <div v-for="(item,index) in invoiceData" :key="index"> + <el-checkbox + v-model="item.isShow" + class="invoiceForm-block" + @change="handleCheckedCitiesChange(invoiceData)"> + <div> + <div class="invoiceForm-content"> + + <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> + <use xlink:href="#icon-shijian3"></use> + </svg> + {{item.enterTime}} + </div> + <div class="invoiceForm-content"> + + <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> + <use xlink:href="#icon-shijian3"></use> + </svg> + {{item.outTime}} + </div> + <div class="invoiceForm-content"> + <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> + <use xlink:href="#icon-dizhi1"></use> + </svg> + {{item.address}} + </div> + </div> + <div class="money-main"> + <h1 class="money-box">{{item.money}}<font class="money-small">鍏�</font></h1> + </div> + </el-checkbox> </div> - <van-list - v-model="loading" - :finished="finished" - finished-text="娌℃湁鏇村浜�" - :offset="50" - :immediate-check="false" - @load="onLoad" - > - - <div v-for="(item,index) in invoiceData" :key="index"> - <el-checkbox - v-model="item.isShow" - class="invoiceForm-block" - @change="handleCheckedCitiesChange(invoiceData)"> - <div> - <div class="invoiceForm-content"> - - <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> - <use xlink:href="#icon-shijian3"></use> - </svg> - {{item.enterTime}} - </div> - <div class="invoiceForm-content"> - - <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> - <use xlink:href="#icon-shijian3"></use> - </svg> - {{item.outTime}} - </div> - <div class="invoiceForm-content"> - <svg class="iconSvg" style="font-size: 12px" aria-hidden="true"> - <use xlink:href="#icon-dizhi1"></use> - </svg> - {{item.address}} - </div> - </div> - <div class="money-main"> - <h1 class="money-box">{{item.money}}<font class="money-small">鍏�</font></h1> - </div> - </el-checkbox> - </div> - </van-list> - <div class="fapiao-btn"> - <el-checkbox v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox> - <div class="fapiao-right"> - <span class="money">閲戦锛�<font class="big">{{countMoney}}</font>鍏�</span> - <el-button size="mini" @click="seeInvoice">涓嬭浇鍙戠エ</el-button> - </div> + </van-list> + <div class="fapiao-btn"> + <el-checkbox v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox> + <div class="fapiao-right"> + <span class="money">閲戦锛�<font class="big">{{countMoney}}</font>鍏�</span> + <el-button size="mini" @click="seeInvoice">涓嬭浇鍙戠エ</el-button> </div> </div> </div> </div> - <div class="middlePge-wrap" v-else> - <div class="middlePge-main"> - <img src="../../../assets/images/middlePage.png" alt=""> - </div> - </div> + </div> </template> @@ -84,7 +78,6 @@ }, data() { return { - isWeiXin: false, date:'', checkedInvoices: [1,2], invoiceData:[], @@ -99,29 +92,12 @@ } }, created() { - this.checkWeiXin() this.date = this.$byutil.dateFormat(new Date(), "yyyy-MM"); }, mounted() { this.getByCarNo() }, methods: { - checkWeiXin() { - // let userAgent = navigator.userAgent; - // console.log(userAgent) - // if (userAgent.includes("MicroMessenger")) { - // this.isWeiXin = true - // } else { - // this.isWeiXin = false - // } - let ua = window.navigator.userAgent.toLowerCase(); - //閫氳繃姝e垯琛ㄨ揪寮忓尮閰島a涓槸鍚﹀惈鏈塎icroMessenger瀛楃涓� - if(ua.match(/MicroMessenger/i) == 'micromessenger'){ - this.isWeiXin = true - } else{ - this.isWeiXin = false - } - }, onLoad() { this.loading = true this.current += 1 @@ -130,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, @@ -183,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); //閲婃斁鎺塨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') - 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); //鍒涘缓涓嬭浇鐨勯摼鎺� @@ -207,7 +205,7 @@ document.body.removeChild(downloadElement); //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 window.URL.revokeObjectURL(href); //閲婃斁鎺塨lob瀵硅薄 }) - }) + } } }, changeDate(){ @@ -292,18 +290,6 @@ .el-checkbox__inner::after{ left: 5px; top: 2px; - } - } - .middlePge-wrap{ - width: 100%; - height: 100%; - background: rgba(0,0,0,0.7); - .middlePge-main{ - width: 100%; - height: 100%; - img{ - width: 100%; - } } } .iconSvg{ -- Gitblit v1.9.1