|
@@ -0,0 +1,117 @@
|
|
1
|
+<template>
|
|
2
|
+ <div id="root">
|
|
3
|
+ <el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
4
|
+ <el-form-item label="车牌">
|
|
5
|
+ <el-input v-model="formInline.plateNumber" placeholder="车牌"></el-input>
|
|
6
|
+ </el-form-item>
|
|
7
|
+ <el-form-item label="客户姓名">
|
|
8
|
+ <el-input v-model="formInline.customerName" placeholder="客户姓名"></el-input>
|
|
9
|
+ </el-form-item>
|
|
10
|
+ <el-form-item label="手机">
|
|
11
|
+ <el-input v-model="formInline.phone" placeholder="手机"></el-input>
|
|
12
|
+ </el-form-item>
|
|
13
|
+ <el-form-item label="来访时间">
|
|
14
|
+ <el-date-picker
|
|
15
|
+ v-model="formInline.recordDate"
|
|
16
|
+ type="date"
|
|
17
|
+ value-format="yyyy-MM-dd"
|
|
18
|
+ placeholder="来访时间">
|
|
19
|
+ </el-date-picker>
|
|
20
|
+ </el-form-item>
|
|
21
|
+ <el-form-item>
|
|
22
|
+ <el-button type="primary" @click="onSubmit">查询</el-button>
|
|
23
|
+ </el-form-item>
|
|
24
|
+ </el-form>
|
|
25
|
+ <el-table
|
|
26
|
+ :data="cartList.records"
|
|
27
|
+ border
|
|
28
|
+ style="width: 100%">
|
|
29
|
+ <el-table-column
|
|
30
|
+ prop="serialNo"
|
|
31
|
+ label="序号"
|
|
32
|
+ width="180"/>
|
|
33
|
+ <el-table-column
|
|
34
|
+ prop="plateNumber"
|
|
35
|
+ label="车牌"/>
|
|
36
|
+ <el-table-column
|
|
37
|
+ prop="driverImage"
|
|
38
|
+ label="驾驶员照片">
|
|
39
|
+ <template slot-scope="scope">
|
|
40
|
+ <el-image
|
|
41
|
+ style="width: 100px; height: 100px"
|
|
42
|
+ :src="scope.row.driverImage"
|
|
43
|
+ fit="fill"></el-image>
|
|
44
|
+ </template>
|
|
45
|
+ </el-table-column>
|
|
46
|
+ <el-table-column
|
|
47
|
+ prop="customerName"
|
|
48
|
+ label="客户姓名"/>
|
|
49
|
+ <el-table-column
|
|
50
|
+ prop="phone"
|
|
51
|
+ label="手机号"/>
|
|
52
|
+ <el-table-column
|
|
53
|
+ prop="createDate"
|
|
54
|
+ label="来访时间"/>
|
|
55
|
+ </el-table>
|
|
56
|
+ <el-pagination
|
|
57
|
+ @size-change="handleSizeChange"
|
|
58
|
+ @current-change="handleCurrentChange"
|
|
59
|
+ :current-page="formInline.pageNum"
|
|
60
|
+ :page-sizes="[1,10, 20, 30, 40]"
|
|
61
|
+ :page-size="formInline.pageSize"
|
|
62
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
63
|
+ :total="cartList.total || 0">
|
|
64
|
+ </el-pagination>
|
|
65
|
+ </div>
|
|
66
|
+</template>
|
|
67
|
+
|
|
68
|
+<script>
|
|
69
|
+import { createNamespacedHelpers } from 'vuex'
|
|
70
|
+const {mapState: mapCartState, mapActions: mapCartActions} = createNamespacedHelpers('cart')
|
|
71
|
+
|
|
72
|
+export default {
|
|
73
|
+ name: 'cart-index',
|
|
74
|
+ data() {
|
|
75
|
+ return {
|
|
76
|
+ formInline: {
|
|
77
|
+ plateNumber: '',
|
|
78
|
+ recordDate: '',
|
|
79
|
+ customerName: '',
|
|
80
|
+ phone: '',
|
|
81
|
+ pageNum: 1,
|
|
82
|
+ pageSize: 10
|
|
83
|
+ }
|
|
84
|
+ }
|
|
85
|
+ },
|
|
86
|
+ computed: {
|
|
87
|
+ ...mapCartState({
|
|
88
|
+ cartList: x => x.carRecord
|
|
89
|
+ })
|
|
90
|
+ },
|
|
91
|
+ created() {
|
|
92
|
+ this.getPage()
|
|
93
|
+ },
|
|
94
|
+ methods: {
|
|
95
|
+ ...mapCartActions([
|
|
96
|
+ 'getCartRecord'
|
|
97
|
+ ]),
|
|
98
|
+ onSubmit() {
|
|
99
|
+ this.getPage()
|
|
100
|
+ },
|
|
101
|
+ getPage() {
|
|
102
|
+ this.getCartRecord(this.formInline)
|
|
103
|
+ },
|
|
104
|
+ handleSizeChange(val) {
|
|
105
|
+ // console.log(`每页 ${val} 条`)
|
|
106
|
+ this.formInline.pageSize = val
|
|
107
|
+ this.getPage()
|
|
108
|
+ },
|
|
109
|
+ handleCurrentChange(val) {
|
|
110
|
+ // console.log(`当前页: ${val}`)
|
|
111
|
+ this.formInline.pageNum = val
|
|
112
|
+ this.getPage()
|
|
113
|
+ }
|
|
114
|
+ }
|
|
115
|
+}
|
|
116
|
+</script>
|
|
117
|
+
|