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
| <template>
| <div class="finance-del">
| <v-header
| title="收益结算"
| search
| :bar="bar"
| @on-search="onSearch"
| ></v-header>
| <div class="tab">
| <v-tool-table
| :trs="trs"
| :tds="tds"
| >
| <template v-slot:btn="{scope}">
| <div class="table_flex">
| <span @click="onSum(scope)">结算</span>
| </div>
| </template>
| </v-tool-table>
| </div>
| <v-tool-page
| :item="paged"
| @on-page="onPage"
| ></v-tool-page>
| </div>
| </template>
| <script>
| import { mapState } from "vuex";
| export default {
| props: [],
| components: {},
| data() {
| return {
| bar: [
| { title: "姓名", name: "name" },
| { title: "账号", name: "phone" },
| ],
| os: {},
| trs: [
| { text: "姓名", val: "userName" },
| { text: "账号", val: "phone" },
| { text: "累计收益(元)", val: "incomeAmount", down: true },
| { text: "已结算(元)", val: "settlementAmount" },
| { text: "未结算(元)", val: "availableAmount" },
| { text: "操作", val: "btn" },
| ],
| tds: [],
| paged: { page: 0, total: 0, r: 0, limit: 10 },
| search: {},
| };
| },
| mounted() {},
| methods: {
| onSum(e) {
| this.$store.dispatch("setFixed", {
| event: "add",
| data: { type: "fin-sum", data: e },
| timeout: Date.now(),
| });
| },
| onSearch(v) {
| if (v.time && v.time.length && v.time[1]) {
| v.startTime = v.time[0];
| v.endTime = v.time[1];
| } else {
| v.startTime = "";
| v.endTime = "";
| }
| this.search = demo.copy(v);
| this.paged.page = 1;
| this.init();
| },
| // 分页点击
| onPage(v) {
| if (v.page === this.paged.page && v.page && !v.reset) {
| return 0;
| }
| this.paged.page = v.page;
| this.paged.limit = v.limit;
| this.init();
| },
| init() {
| let v = demo.copy(
| Object.assign(this.os, this.search, {
| pageNum: this.paged.page,
| pageSize: this.paged.limit,
| type: 1,
| })
| );
| this.$api.post("user/wallet/page", v, (e) => {
| this.paged.total = e.total;
| this.paged.r++;
| this.tds = (e.records || []).map((v) => {
| v.t_check = false;
| return v;
| });
| });
| },
| },
| watch: {
| vuex_page: {
| handler(n) {
| if (n.page === this.$route.path) {
| this.paged.page = 1;
| this.init();
| }
| },
| deep: true,
| },
| },
| computed: {
| ...mapState({ vuex_page: "pageReset" }),
| },
| };
| </script>
| <style scoped lang="less">
| .finance-del {
| overflow: scroll;
| }
| </style>
|
|