index.vue
1.97 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
<template>
<div class="orders-page">
<h2 class="page-title">开单记录</h2>
<el-card>
<el-table :data="list" border size="small" :header-cell-style="{ background:'#f8fafc', color:'#64748b', fontWeight:600 }" v-loading="loading">
<el-table-column prop="id" label="开单编号" width="180" />
<el-table-column prop="kdhyc" label="会员" width="120" />
<el-table-column prop="kdrq" label="开单日期" width="120" />
<el-table-column prop="zdyj" label="整单业绩" width="120" />
<el-table-column prop="sfyj" label="实付业绩" width="120" />
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="viewDetail(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
layout="total, sizes, prev, pager, next, jumper"
:total="total"
:page-size="pageSize"
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
@size-change="val => { pageSize = val; handlePageChange(1) }"
@current-change="handlePageChange"
style="margin-top: 16px; text-align: right;"
/>
</el-card>
</div>
</template>
<script>
export default {
name: 'Orders',
data() {
return {
list: [],
loading: false,
page: 1,
pageSize: 10,
total: 0
}
},
created() {
this.fetchList()
},
methods: {
fetchList() {
this.loading = true
// TODO: 对接开单列表接口
setTimeout(() => {
this.list = []
this.total = 0
this.loading = false
}, 300)
},
handlePageChange(p) {
this.page = p
this.fetchList()
},
viewDetail(row) {
this.$message.info('详情功能待对接')
}
}
}
</script>
<style lang="scss" scoped>
.page-title {
margin: 0 0 20px;
font-size: 20px;
color: #303133;
}
</style>