kongdeqiang
2022-12-31 de4c8dc172fe0721d08b51e66d824b19d9c1e8fd
修改前端页面
3个文件已修改
93 ■■■■ 已修改文件
src/assets/js/ByUtils.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/invoice/invoiceForm.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/orderRecord/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 ''
    },
}
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,30 +134,46 @@
            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();
            }
        }
    }
src/components/page/orderRecord/index.vue
@@ -3,7 +3,7 @@
        <div style="padding: 10px 10px 0px 10px;">
            <el-form :inline="true" :model="searchForm">
              <el-form-item label="停车场">
              <el-select v-model="searchForm.parkId">
              <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>
@@ -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>