From de4c8dc172fe0721d08b51e66d824b19d9c1e8fd Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期六, 31 十二月 2022 00:29:02 +0800 Subject: [PATCH] 修改前端页面 --- src/components/page/invoice/invoiceForm.vue | 43 +++++++++++++++++++++++++++++++++---------- 1 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/components/page/invoice/invoiceForm.vue b/src/components/page/invoice/invoiceForm.vue index db8ba52..001096d 100644 --- a/src/components/page/invoice/invoiceForm.vue +++ b/src/components/page/invoice/invoiceForm.vue @@ -10,6 +10,7 @@ value-format="yyyy-MM" v-model="date" type="month" + @change="changeDate" placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </div> @@ -58,7 +59,7 @@ <div class="fapiao-btn"> <el-checkbox v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox> <div class="fapiao-right"> - <span class="money">閲戦锛�<font class="big">235</font>鍏�</span> + <span class="money">閲戦锛�<font class="big">{{countMoney}}</font>鍏�</span> <el-button size="mini" @click="seeInvoice">涓嬭浇鍙戠エ</el-button> </div> </div> @@ -86,8 +87,12 @@ current:1, size:8, total:'', - filedId: [] + filedId: [], + countMoney:0 } + }, + created() { + this.date = this.$byutil.dateFormat(new Date(), "yyyy-MM"); }, mounted() { this.getByCarNo() @@ -100,12 +105,14 @@ }, getByCarNo() { + this.invoiceData = [] let url = this.$systemconfig.basePath + '/orderrecord/getByCarNo'; let params = { carNo: this.$route.query.carNo, phone: this.$route.query.phone, current: this.current, - size: this.size + size: this.size, + month: this.date } this.$byutil.postData(this,url,params,res => { let row = res.data.records @@ -127,31 +134,47 @@ handleCheckAllChange(val) { this.filedId = [] let ids = [] + this.countMoney = 0 this.invoiceData.forEach(item => { - ids.push(item.id) + ids.push(item.fileId) item.isShow = val - this.filedId.push(item.id) + this.countMoney += item.money + this.filedId.push(item.fileId) }) }, handleCheckedCitiesChange(value) { - console.log(value,'value') this.filedId = [] + this.countMoney = 0 let checkedCount = value.length; let ids = value.filter(item => { return item.isShow == true }) - console.log(ids,'ids=========') if(ids.length > 0) { ids.forEach(item => { - this.filedId.push(item.id) + this.countMoney += item.money + this.filedId.push(item.fileId) }) } this.checkAll = checkedCount === ids.length; }, seeInvoice() { //鏌ョ湅鍙戠エ - console.log(this.filedId,'this.filedId==========') - } + if(this.filedId.length == 0){ + alert("璇疯嚦灏戦�夋嫨涓�椤�") + }else { + let result = this.filedId.join(",") + let url = this.$systemconfig.basePath + '/fileInfo/download/downloadZips'; + let param = { + fileIds : result + } + this.$byutil.postData(this,url,param,res => { + + }) + } + }, + changeDate(){ + this.getByCarNo(); + } } } </script> -- Gitblit v1.9.1