From de4c8dc172fe0721d08b51e66d824b19d9c1e8fd Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期六, 31 十二月 2022 00:29:02 +0800 Subject: [PATCH] 修改前端页面 --- src/components/page/orderRecord/index.vue | 12 +++--- src/components/page/invoice/invoiceForm.vue | 43 ++++++++++++++++----- src/assets/js/ByUtils.js | 42 ++++++++++++++++++++ 3 files changed, 80 insertions(+), 17 deletions(-) diff --git a/src/assets/js/ByUtils.js b/src/assets/js/ByUtils.js index 895fa53..47c1026 100644 --- a/src/assets/js/ByUtils.js +++ b/src/assets/js/ByUtils.js @@ -272,7 +272,17 @@ vm.$router.push({'path': '/login'}); vm.$alert('浼氳瘽缁撴潫锛岃閲嶆柊鐧诲綍', {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); }else{ - vm.$alert('鎿嶄綔閿欒' , {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); + let a = ''; + if(response.data){ + if(response.data.msg){ + a=response.data.msg + }else { + a='鏈嶅姟鍣ㄦ晠闅�' + } + }else { + a="鏁版嵁閿欒" + } + vm.$alert(a , {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); } } }).catch((e) => { @@ -734,4 +744,34 @@ }}); }) }, + dateFormat(date,f) { + let format = 'yyyy-MM-dd hh:mm:ss' + if(f){ + format = f; + } + if (date !== 'Invalid Date') { + var o = { + 'M+': date.getMonth() + 1, // month + 'd+': date.getDate(), // day + 'h+': date.getHours(), // hour + 'm+': date.getMinutes(), // minute + 's+': date.getSeconds(), // second + 'q+': Math.floor((date.getMonth() + 3) / 3), // quarter + 'S': date.getMilliseconds() // millisecond + } + if (/(y+)/.test(format)) { + format = format.replace(RegExp.$1, + (date.getFullYear() + '').substr(4 - RegExp.$1.length)) + } + for (var k in o) { + if (new RegExp('(' + k + ')').test(format)) { + format = format.replace(RegExp.$1, + RegExp.$1.length === 1 ? o[k] + : ('00' + o[k]).substr(('' + o[k]).length)) + } + } + return format + } + return '' + }, } 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> diff --git a/src/components/page/orderRecord/index.vue b/src/components/page/orderRecord/index.vue index 8654e64..1681d02 100644 --- a/src/components/page/orderRecord/index.vue +++ b/src/components/page/orderRecord/index.vue @@ -3,8 +3,8 @@ <div style="padding: 10px 10px 0px 10px;"> <el-form :inline="true" :model="searchForm"> <el-form-item label="鍋滆溅鍦�"> - <el-select v-model="searchForm.parkId"> - <el-option v-for="item in table1" :key="item.id" :label="item.name" :value="item.id"></el-option> + <el-select v-model="searchForm.parkId" clearable> + <el-option v-for="item in table1" :key="item.id" :label="item.name" :value="item.id" ></el-option> </el-select> </el-form-item> <el-form-item label="閫夋嫨鏃堕棿"> @@ -20,11 +20,11 @@ </el-form> </div> - <el-table :data="table2" border style="width:100%;border:1px solid #bcbec2;"> + <el-table :data="table2" border style="width:55%;border:1px solid #bcbec2;"> <el-table-column type="index" width="50" label="搴忓彿" align="center"> </el-table-column> - <el-table-column prop="parkName" label="鍋滆溅鍦�" align="center" width="150"></el-table-column> - <el-table-column prop="orderNum" label="鏈夋晥璁㈠崟鏁�" align="center" width="150"></el-table-column> - <el-table-column prop="orderMoney" label="璁㈠崟鎬婚噾棰�" align="center"></el-table-column> + <el-table-column prop="parkName" label="鍋滆溅鍦�" align="center" ></el-table-column> + <el-table-column prop="orderNum" label="鏈夋晥璁㈠崟鏁�" align="center" ></el-table-column> + <el-table-column prop="orderMoney" label="璁㈠崟鎬婚噾棰�(鍏�)" align="center" ></el-table-column> </el-table> </div> </template> -- Gitblit v1.9.1