clearing.vue
1.91 KB
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
<template>
<layout-body>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page
:total="pageData.total"
:current="pageData.pageNo"
:page-size="20"
show-total
@on-change="pageChange"
></Page>
</layout-list>
</layout-body>
</template>
<script>
import list from './store/list';
import FranchiseService from 'services/finance/franchise-service';
import _ from 'lodash';
export default {
data() {
return list.call(this);
},
created() {
this.franchiseService = new FranchiseService();
this.search();
},
methods: {
filterValues() {
const params = {
type: 1,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 2,
};
return _.pickBy(params, val => val);
},
search() {
this.franchiseService.balanceList(this.filterValues()).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
reset() {
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.franchise-clearing.detail',
params: {},
query: {
balanceId: params.row.id,
brandId: params.row.brandId,
status: {
未结算: 1,
已结算: 2,
}[params.row.statusDesc],
productSku: params.row.productSku,
orderCode: params.row.orderCode,
type: params.row.type,
agreementIsAbnormal: params.row.agreementIsAbnormal,
},
});
},
},
};
</script>