settlement-list.vue
6.34 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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="结算单ID">
<Input v-model.trim="query.id"></Input>
</filter-item>
<filter-item label="SKU编码">
<Input v-model.trim="query.productSku" :maxlength="9"></Input>
</filter-item>
<filter-item label="支付时间">
<Date-picker v-model="query.createTime"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期" clearable>
</Date-picker>
</filter-item>
<filter-item label="结算单状态">
<Select v-model="query.status" clearable>
<Option value="10">未到票</Option>
<Option value="20">待支付</Option>
<Option value="30">已支付</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button @click="exportData" type="warning">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import moment from 'moment';
import _ from 'lodash';
export default {
data() {
return {
query: {
id: '',
productSku: '',
status: null,
createTime: []
},
pageData: {
total: 0,
current: 1,
},
tableData: [],
tableCols: [{
title: '结算单ID',
key: 'id',
align: 'center'
}, {
title: '开始时间',
key: 'startTime',
width: 110,
render: (h, params) => {
let time = moment.unix(params.row.createTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
},
align: 'center'
}, {
title: '结束时间',
key: 'endTime',
width: 110,
render: (h, params) => {
let time = moment.unix(params.row.endTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
},
align: 'center'
}, {
title: '应付金额',
key: 'paymentAmount',
align: 'center'
}, {
title: '到票金额',
key: 'invoiceAmount',
align: 'center'
}, {
title: '实付金额',
key: 'amount',
align: 'center'
}, {
title: '状态',
key: 'statusName',
align: 'center'
}, {
title: '支付时间',
key: 'paymentTime',
width: 110,
render: (h, params) => {
let time = moment.unix(params.row.paymentTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
},
align: 'center'
}, {
title: '备注',
key: 'col2',
align: 'center'
}, {
title: '操作',
align: 'center',
width: 100,
render: (h, params) => {
return (
<action-group>
<i-button type="primary" size="small" onClick={() => this.edit(params.row)}>查看详情</i-button>
</action-group>
);
}
}]
};
},
computed: {
startTime() {
let createTime = this.query.createTime;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.query.createTime;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
},
created() {
this.candidateListService = new CandidateListService();
},
mounted() {
this.search();
},
methods: {
filterValues() {
let params = {
pageNo: this.pageData.current,
pageSize: 10,
id: +this.query.id,
productSku: +this.query.productSku,
status: +this.query.status,
startTime: this.startTime,
endTime: this.endTime
};
params = _.pickBy(params, val => val);
return params;
},
search() {
this.candidateListService.clearingList(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalPage', 0);
this.pageData.current = _.get(ret, 'data.pageNo', 1);
} else {
this.$Message.error(ret.message);
}
});
},
reset() {
this.$refs.filter.reset();
this.search();
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
edit(row) {
this.$router.push({
name: 'kol.settlement.detail',
params: {
id: row.id
}
});
},
exportData() {}
},
components: {}
};
</script>
<style lang="scss">
</style>