Mr.Zhang
2023-10-12 7f05ab4e75036b2697c9208e581f609b27f0af82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<template>
  <TableLayout :permissions="['business:wxbill:query']">
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="对账日期" prop="name">
        <el-date-picker
          v-model="value1"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
          @change="selectDate"
        ></el-date-picker>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- 表格和分页 -->
    <template v-slot:table-wrap>
      <div class="sum">
        <div class="sum-title">
          <div>本次筛选</div>
          <div>合计</div>
        </div>
        <div class="sum-value">
          <div>收款笔数</div>
          <div>{{ sumData.sumBill }}</div>
        </div>
        <div class="sum-value">
          <div>收款金额(元)</div>
          <div>{{ sumData.sumTotalFee }}</div>
        </div>
        <div class="sum-value">
          <div>收款手续费(元)</div>
          <div>{{ sumData.sumCmmsAmt }}</div>
        </div>
        <div class="sum-value">
          <div>退款笔数</div>
          <div>{{ sumData.sumRefundBill }}</div>
        </div>
        <div class="sum-value">
          <div>退款金额(元)</div>
          <div>{{ sumData.sumRefundBill }}</div>
        </div>
        <div class="sum-value">
          <div>退款手续费(元)</div>
          <div>{{ sumData.sumRefundCmmsAmt }}</div>
        </div>
        <div class="sum-value">
          <div>结算金额(元)</div>
          <div>{{ sumData.total }}</div>
        </div>
      </div>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
      >
        <el-table-column prop="createDate" label="日期" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumBill" label="收款笔数" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumTotalFee" label="收款金额" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumCmmsAmt" label="收款手续费" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumRefundBill" label="退款笔数" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumRefundFee" label="退款金额" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumRefundCmmsAmt" label="退款手续费" min-width="100px" align="center"></el-table-column>
 
        <!-- <el-table-column prop="sumSuccessFee" label="应结订单总金额" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumCouponRefundFee" label="充值券退款总金额" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="sumApplyRefundFee" label="申请退款总金额" min-width="100px" align="center"></el-table-column> -->
        <el-table-column prop="total" label="结算金额" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="bikeFee" label="自行车收入" min-width="100px" align="center"></el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
  </TableLayout>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
export default {
  name: 'WxBill',
  extends: BaseTable,
  components: { TableLayout, Pagination },
  data () {
    return {
      value1: [],
      // 搜索
      searchForm: {
        endDate: '',
        startDate: '',
      },
      sumData: {
 
      }
    }
  },
  created () {
    this.config({
      module: '',
      api: '/business/wxBill',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    reset() {
      this.searchForm.startDate = ''
      this.searchForm.endDate = ''
      this.value1 = []
      this.search()
    },
    selectDate(v) {
      this.searchForm.startDate = ''
      this.searchForm.endDate = ''
      if (v) {
        this.searchForm.startDate = v[0]
        this.searchForm.endDate = v[1]
      }
      this.search()
    },
    // 页码变更处理
    handlePageChange (pageIndex) {
      this.__checkApi()
      this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex
      this.isWorking.search = true
      this.api.fetchList({
        page: this.tableData.pagination.pageIndex,
        capacity: this.tableData.pagination.pageSize,
        model: this.searchForm,
        sorts: this.tableData.sorts
      })
        .then(data => {
          this.tableData.list = data.records
          this.tableData.pagination.total = data.total
          this.sumData = data.extData
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking.search = false
        })
    },
  },
}
</script>
<style lang="scss" scoped>
.sum {
  display: flex;
  font-size: 16px;
  margin-bottom: 10px;
  background-color: rgb(243, 243, 251);
  .sum-title {
    background-color: rgb(111, 129, 198);
    color: #fff;
    font-weight: 500;
    text-align: center;
    padding: 15px;
  }
  .sum-value {
    padding: 15px 30px;
    :first-child {
      font-size: 14px;
    }
    :last-child {
      font-weight: 600;
    }
  }
}
</style>