123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <!--
- * @Description: 统计报表 => 停车场实收统计
- * @Author: 空白格
- * @Date: 2022-08-03 13:30:32
- * @LastEditors: 空白格
- * @LastEditTime: 2022-08-03 13:30:33
- * @FilePath: \parking_operation\pages\statisticalReport\parkModel\components\parkingReallyIncome.vue
- * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
- -->
- <template>
- <view class="container">
- <view class="table">
- <!-- <view class="table-date" v-if="currentDate">{{ currentDate.join(' 至 ') }}</view> -->
- <view class="table-box">
- <TableRanking :loading="loading" :tableTh="tableTh" :tableData="tableData"
- @pageChange="pageChange" />
- </view>
- </view>
- <view class="total">
- <view>
- 停车数量<text>{{ totalData.vehicleCount || 0 }}</text>辆,实收金额<text>{{ totalData.realAmount || 0 }}</text>元
- </view>
- </view>
- </view>
- </template>
- <script>
- import TableRanking from '@/components/tableRanking.vue'
- export default {
- components: {
- TableRanking
- },
- props: {
- tableTh: {
- type: Array,
- default: () => {
- return [{
- field: '停车场名称',
- width: 120,
- key: 'parkingName'
- },
- {
- field: '停车数量(次)',
- width: 120,
- key: 'vehicleCount'
- },
- {
- field: '实收金额(元)',
- width: 80,
- key: 'realAmount'
- }
- ]
- }
- }
- },
- data() {
- return {
- loading: false,
- tableData: {
- current: 1,
- total: 0,
- list: []
- },
- totalData: {},
- currentDate: [],
- beginTime: undefined,
- endTime: undefined
- }
- },
- methods: {
- getData(data) {
- if (data.length) {
- this.beginTime = data[0]
- this.endTime = data[1]
- }
- this.currentDate = data
- this.tableData.current = 1
- this.getList();
- this.getTotal();
- },
- getList() {
- this.loading = true
- uni.$u.api.statisticalReportApi.getParkingReallyIncomeApi({
- pageNum: this.tableData.current,
- pageSize: 10,
- beginTime: this.beginTime,
- endTime: this.endTime
- }).then(res => {
- if (res.code === 200) {
- this.tableData.list = res.rows
- this.tableData.total = res.total
- }
- this.loading = false
- })
- },
- getTotal() {
- uni.$u.api.statisticalReportApi.getParkingReallyIncomeTotalApi({
- beginTime: this.beginTime,
- endTime: this.endTime
- }).then(res => {
- if (res.code === 200) {
- const { realAmount, vehicleCount } = res.data
- this.totalData.realAmount = realAmount
- this.totalData.vehicleCount = vehicleCount
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import './../../styles/report.scss';
- </style>
|