payment.vue
3.54 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
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
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.balanceId.label">
<Input v-model.trim="filters.balanceId.model"
:placeholder="filters.balanceId.holder"></Input>
</filter-item>
<filter-item :label="filters.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model"
type="datetimerange" format="yyyy-MM-dd" placeholder="选择日期和时间">
</Date-picker>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
<layout-list>
<Demo></Demo>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.pageNo"
@on-change="pageChange" :page-size="20" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import list from './store/list';
import FinanceService from 'services/finance/finance-service';
export default {
data() {
return list.call(this);
},
created() {
this.FinanceService = new FinanceService();
},
computed: {
startTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
},
methods: {
search() {
// 在这里实现异步查询的方法,建议在service中做
let params = {
type: 2,
balanceId: +this.filters.balanceId.model,
brandId: this.filters.brandId.model,
status: this.filters.status.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
this.FinanceService.settlementList(params).then(ret => {
console.log(ret)
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.status.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.payment.detail',
params: {},
query: {
balanceId: params.row.balanceId,
status: params.row.statusDesc,
brandName: params.row.brandName
}
});
},
onClickStock() {}
}
};
</script>
<style lang="scss">
.ivu-date-picker .ivu-select-dropdown {
left: -284px !important;
}
</style>