1
|
<template>
|
1
|
<template>
|
2
|
<div class="stat-shop">
|
2
|
<div class="stat-shop">
|
3
|
<layout-body>
|
3
|
<layout-body>
|
4
|
- <p slot="title">服务费账单</p>
|
|
|
5
|
- <layout-filter class="box-filter" :inline="true" :col="1">
|
|
|
6
|
- <filter-item :label="filters.dateRange.label">
|
|
|
7
|
- <Date-picker v-model="filters.dateRange.model" type="datetimerange"
|
|
|
8
|
- :placeholder="filters.dateRange.label" format="yyyy-MM-dd" @on-change="dateRange">
|
|
|
9
|
- </Date-picker>
|
|
|
10
|
- <div class="quick">
|
|
|
11
|
- <a href="javascript:;" @click="() => { changeLimit(0); }">今日</a>
|
|
|
12
|
- <a href="javascript:;" @click="() => { changeLimit(1); }">昨天</a>
|
|
|
13
|
- <a href="javascript:;" @click="() => { changeLimit(7); }">近7天</a>
|
|
|
14
|
- <a href="javascript:;" @click="() => { changeLimit(30); }">近30天</a>
|
|
|
15
|
- </div>
|
|
|
16
|
- </filter-item>
|
4
|
+ <p slot="title">交易服务明细</p>
|
|
|
5
|
+ <layout-filter ref="filter" :model="filters" class="box-filter" :inline="true" :col="1">
|
|
|
6
|
+ <filter-item label="起止时间">
|
|
|
7
|
+ <Date-picker
|
|
|
8
|
+ v-model="filters.createTime.model"
|
|
|
9
|
+ type="datetimerange"
|
|
|
10
|
+ format="yyyy-MM-dd"
|
|
|
11
|
+ placeholder="选择日期和时间"
|
|
|
12
|
+ @on-change="createTimeChange"
|
|
|
13
|
+ ></Date-picker>
|
|
|
14
|
+ <div class="quick">
|
|
|
15
|
+ <a
|
|
|
16
|
+ href="javascript:;"
|
|
|
17
|
+ @click="
|
|
|
18
|
+ () => {
|
|
|
19
|
+ timeFlag(1);
|
|
|
20
|
+ }
|
|
|
21
|
+ "
|
|
|
22
|
+ >今天</a
|
|
|
23
|
+ >
|
|
|
24
|
+ <a
|
|
|
25
|
+ href="javascript:;"
|
|
|
26
|
+ @click="
|
|
|
27
|
+ () => {
|
|
|
28
|
+ timeFlag(2);
|
|
|
29
|
+ }
|
|
|
30
|
+ "
|
|
|
31
|
+ >昨天</a
|
|
|
32
|
+ >
|
|
|
33
|
+ <a
|
|
|
34
|
+ href="javascript:;"
|
|
|
35
|
+ @click="
|
|
|
36
|
+ () => {
|
|
|
37
|
+ timeFlag(3);
|
|
|
38
|
+ }
|
|
|
39
|
+ "
|
|
|
40
|
+ >最近7天</a
|
|
|
41
|
+ >
|
|
|
42
|
+ <a
|
|
|
43
|
+ href="javascript:;"
|
|
|
44
|
+ @click="
|
|
|
45
|
+ () => {
|
|
|
46
|
+ timeFlag(4);
|
|
|
47
|
+ }
|
|
|
48
|
+ "
|
|
|
49
|
+ >最近30天</a
|
|
|
50
|
+ >
|
|
|
51
|
+ </div>
|
|
|
52
|
+ <div class="select-container">
|
|
|
53
|
+ <Select v-model.trim="filters.withdrawStatus.model" :placeholder="filters.withdrawStatus.label">
|
|
|
54
|
+ <Option v-for="option in filters.withdrawStatus.options" :key="option.value" :value="option.value">{{
|
|
|
55
|
+ option.label
|
|
|
56
|
+ }}</Option>
|
|
|
57
|
+ </Select>
|
|
|
58
|
+ </div>
|
|
|
59
|
+ <div class="select-container">
|
|
|
60
|
+ <Input v-model.trim="filters.targetAccount.model" :placeholder="filters.targetAccount.label" />
|
|
|
61
|
+ </div>
|
|
|
62
|
+ </filter-item>
|
|
|
63
|
+ <filter-item>
|
|
|
64
|
+ <div class="select-container">
|
|
|
65
|
+ <Input v-model.trim="filters.orderCode.model" :placeholder="filters.orderCode.label" />
|
|
|
66
|
+ </div>
|
|
|
67
|
+ <div class="select-container">
|
|
|
68
|
+ <Input v-model.trim="filters.sku.model" :placeholder="filters.sku.label" />
|
|
|
69
|
+ </div>
|
|
|
70
|
+ <div class="select-container">
|
|
|
71
|
+ <Input v-model.trim="filters.productName.model" :placeholder="filters.productName.label" />
|
|
|
72
|
+ </div>
|
|
|
73
|
+ <div class="select-container">
|
|
|
74
|
+ <Select v-model.trim="filters.clearingType.model" :placeholder="filters.clearingType.label">
|
|
|
75
|
+ <Option v-for="option in filters.clearingType.options" :key="option.value" :value="option.value">{{
|
|
|
76
|
+ option.label
|
|
|
77
|
+ }}</Option>
|
|
|
78
|
+ </Select>
|
|
|
79
|
+ </div>
|
|
|
80
|
+ <div class="select-container">
|
|
|
81
|
+ <Select v-model.trim="filters.subClearingType.model" :placeholder="filters.subClearingType.label">
|
|
|
82
|
+ <Option v-for="option in filters.subClearingType.options" :key="option.value" :value="option.value">{{
|
|
|
83
|
+ option.label
|
|
|
84
|
+ }}</Option>
|
|
|
85
|
+ </Select>
|
|
|
86
|
+ </div>
|
|
|
87
|
+ <div class="select-container">
|
|
|
88
|
+ <Button type="primary" @click="search">查询</Button>
|
|
|
89
|
+ <Button type="primary" @click="reset">全部</Button>
|
|
|
90
|
+ <Button>导出</Button>
|
|
|
91
|
+ </div>
|
|
|
92
|
+ </filter-item>
|
|
|
93
|
+ </layout-filter>
|
|
|
94
|
+ <layout-tab>
|
|
|
95
|
+ <Tabs :value="activate" :animated="false" @on-click="switchTab">
|
|
|
96
|
+ <Tab-pane label="全部" name="all"></Tab-pane>
|
|
|
97
|
+ <Tab-pane :label="revenueTabLabel" name="REVENUE"></Tab-pane>
|
|
|
98
|
+ <Tab-pane :label="expendTabLabel" name="EXPEND"></Tab-pane>
|
|
|
99
|
+ </Tabs>
|
|
|
100
|
+ </layout-tab>
|
|
|
101
|
+ <layout-list>
|
|
|
102
|
+ <Table border :columns="tableCols" :data="tableData"></Table>
|
|
|
103
|
+ <Page
|
|
|
104
|
+ :total="pageData.total"
|
|
|
105
|
+ :current="pageData.current"
|
|
|
106
|
+ :page-size="pageData.pageSize"
|
|
|
107
|
+ show-total
|
|
|
108
|
+ @on-change="pageChange"
|
|
|
109
|
+ ></Page>
|
|
|
110
|
+ </layout-list>
|
17
|
</layout-body>
|
111
|
</layout-body>
|
18
|
-
|
|
|
19
|
</div>
|
112
|
</div>
|
20
|
</template>
|
113
|
</template>
|
21
|
|
114
|
|
22
|
<script>
|
115
|
<script>
|
|
|
116
|
+import _ from 'lodash';
|
|
|
117
|
+import moment from 'moment';
|
|
|
118
|
+import { TransactionList } from './store';
|
23
|
import FinanceService from 'services/finance/finance-service';
|
119
|
import FinanceService from 'services/finance/finance-service';
|
24
|
-import { ShopAccountList } from './store';
|
|
|
25
|
-import moment from "moment";
|
|
|
26
|
|
120
|
|
27
|
export default {
|
121
|
export default {
|
28
|
data() {
|
122
|
data() {
|
29
|
- return ShopAccountList.call(this);
|
|
|
30
|
- }, watch: {
|
|
|
31
|
- date() {
|
|
|
32
|
- this.loadData();
|
123
|
+ return TransactionList.call(this);
|
|
|
124
|
+ },
|
|
|
125
|
+ created() {
|
|
|
126
|
+ this.financeService = new FinanceService();
|
|
|
127
|
+ this.search();
|
|
|
128
|
+ },
|
|
|
129
|
+ computed: {
|
|
|
130
|
+ revenueTabLabel() {
|
|
|
131
|
+ return `收入`;
|
33
|
},
|
132
|
},
|
34
|
- day(newDay) {
|
|
|
35
|
- const curDay = moment().format('YYYY-MM-DD');
|
|
|
36
|
- if (newDay === this.beginTime || !newDay) {
|
|
|
37
|
- return;
|
133
|
+ expendTabLabel() {
|
|
|
134
|
+ return `支出`;
|
|
|
135
|
+ },
|
|
|
136
|
+ },
|
|
|
137
|
+ methods: {
|
|
|
138
|
+ filterValues() {
|
|
|
139
|
+ const values = {
|
|
|
140
|
+ pageNo: 1,
|
|
|
141
|
+ pageSize: 10,
|
|
|
142
|
+ };
|
|
|
143
|
+ const fields = this.filters;
|
|
|
144
|
+ const keysMap = {
|
|
|
145
|
+ beginTime: 'beginTime',
|
|
|
146
|
+ endTime: 'endTime',
|
|
|
147
|
+ timeFlag: 'timeFlag',
|
|
|
148
|
+ withdrawStatus: 'withdrawStatus',
|
|
|
149
|
+ targetAccount: 'targetAccount',
|
|
|
150
|
+ orderCode: 'orderCode',
|
|
|
151
|
+ sku: 'sku',
|
|
|
152
|
+ productName: 'productName',
|
|
|
153
|
+ clearingType: 'clearingType',
|
|
|
154
|
+ subClearingType: 'subClearingType',
|
|
|
155
|
+ };
|
|
|
156
|
+
|
|
|
157
|
+ if (this.activate !== 'all') {
|
|
|
158
|
+ // eslint-disable-next-line no-undef
|
|
|
159
|
+ values.clearingType = ClearingTypeName2Id[this.activate];
|
38
|
}
|
160
|
}
|
39
|
- this.dateRange = newDay !== this.curDay ? [newDay, curDay] : [newDay, newDay];
|
161
|
+
|
|
|
162
|
+ if (this.enableFilter) {
|
|
|
163
|
+ _.each(keysMap, (val, key) => {
|
|
|
164
|
+ values[key] = fields[val].model;
|
|
|
165
|
+ });
|
|
|
166
|
+ }
|
|
|
167
|
+ return values;
|
|
|
168
|
+ },
|
|
|
169
|
+ switchTab(name) {
|
|
|
170
|
+ this.$router.replace({
|
|
|
171
|
+ name: `finance.withdraw.transactionlist`,
|
|
|
172
|
+ query: {
|
|
|
173
|
+ tab: name,
|
|
|
174
|
+ },
|
|
|
175
|
+ });
|
|
|
176
|
+ },
|
|
|
177
|
+ search() {
|
|
|
178
|
+ let params = {};
|
|
|
179
|
+ this.enableFilter = true;
|
|
|
180
|
+ params = this.filterValues();
|
|
|
181
|
+ this.list(params);
|
|
|
182
|
+ this.pageData.current = 1;
|
|
|
183
|
+ },
|
|
|
184
|
+ reset() {
|
|
|
185
|
+ let params = {};
|
|
|
186
|
+ this.enableFilter = false;
|
|
|
187
|
+ params = this.filterValues();
|
|
|
188
|
+ this.list(params);
|
|
|
189
|
+ this.pageData.current = 1;
|
40
|
},
|
190
|
},
|
41
|
- dateRange(newDate) {
|
|
|
42
|
- this.beginTime = moment(Array.isArray(newDate) ? newDate[0] : newDate).format('YYYY-MM-DD');
|
|
|
43
|
- this.endTime = moment(Array.isArray(newDate) ? newDate[1] : newDate).format('YYYY-MM-DD');
|
|
|
44
|
- this.day = (this.beginTime === this.endTime) === this.today ? '' : this.beginTime;
|
191
|
+ timeFlag(flag) {
|
|
|
192
|
+ let params = {};
|
|
|
193
|
+ this.enableFilter = false;
|
|
|
194
|
+ params = this.filterValues();
|
|
|
195
|
+ params.timeFlag = flag;
|
|
|
196
|
+ this.list(params);
|
45
|
this.pageData.current = 1;
|
197
|
this.pageData.current = 1;
|
46
|
- this.list();
|
198
|
+ },
|
|
|
199
|
+ createTimeChange(time) {
|
|
|
200
|
+ if (!_.isArray(time)) {
|
|
|
201
|
+ time = time.split(' - ');
|
|
|
202
|
+ }
|
|
|
203
|
+ if ((time[0] + '').length) {
|
|
|
204
|
+ this.filters.beginTime.model = moment(time[0]).format('YYYY-MM-DD');
|
|
|
205
|
+ this.filters.endTime.model = moment(time[1]).format('YYYY-MM-DD');
|
|
|
206
|
+ }
|
|
|
207
|
+ },
|
|
|
208
|
+ pageChange(page) {
|
|
|
209
|
+ const params = this.filterValues();
|
|
|
210
|
+ params.pageNo = page;
|
|
|
211
|
+ this.pageData.current = page;
|
|
|
212
|
+ this.list(params);
|
|
|
213
|
+ },
|
|
|
214
|
+ list(params) {
|
|
|
215
|
+ this.financeService.shopWithdrawAccountList(params).then(ret => {
|
|
|
216
|
+ this.tableData = _.get(ret, 'data.records', []);
|
|
|
217
|
+ this.pageData.total = _.get(ret, 'data.totalCount', 0);
|
|
|
218
|
+ this.pageData.current = _.get(ret, 'data.pageNo', 0) + 1;
|
|
|
219
|
+ });
|
|
|
220
|
+ },
|
|
|
221
|
+ getDetailById(id) {
|
|
|
222
|
+ this.$router.push({
|
|
|
223
|
+ name: 'finance.withdraw.transaction-detail',
|
|
|
224
|
+ params: {
|
|
|
225
|
+ id,
|
|
|
226
|
+ },
|
|
|
227
|
+ });
|
47
|
},
|
228
|
},
|
48
|
},
|
229
|
},
|
49
|
};
|
230
|
};
|
|
@@ -146,7 +327,9 @@ export default { |
|
@@ -146,7 +327,9 @@ export default { |
146
|
|
327
|
|
147
|
.select-container {
|
328
|
.select-container {
|
148
|
display: inline-block;
|
329
|
display: inline-block;
|
149
|
- width: 220px;
|
330
|
+ width: 200px;
|
|
|
331
|
+ margin-right: 15px;
|
|
|
332
|
+ margin-top: 5px;
|
150
|
}
|
333
|
}
|
151
|
}
|
334
|
}
|
152
|
|
335
|
|
|
@@ -154,4 +337,14 @@ export default { |
|
@@ -154,4 +337,14 @@ export default { |
154
|
padding-left: 6px;
|
337
|
padding-left: 6px;
|
155
|
padding-right: 6px;
|
338
|
padding-right: 6px;
|
156
|
}
|
339
|
}
|
157
|
-</style> |
|
|
|
|
340
|
+
|
|
|
341
|
+.action-column {
|
|
|
342
|
+ .cell-action-row {
|
|
|
343
|
+ margin-top: 10px;
|
|
|
344
|
+
|
|
|
345
|
+ &:last-child {
|
|
|
346
|
+ margin-bottom: 10px;
|
|
|
347
|
+ }
|
|
|
348
|
+ }
|
|
|
349
|
+}
|
|
|
350
|
+</style> |