李志伟 3 年前
父节点
当前提交
461aa5194f
共有 1 个文件被更改,包括 37 次插入0 次删除
  1. 37
    0
      src/views/person/index.vue

+ 37
- 0
src/views/person/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="body" style="font-size:14px">
2
   <div class="body" style="font-size:14px">
3
+    <el-card class="box-card" shadow="never">
4
+      活动时间:
5
+      <el-date-picker
6
+        v-model="daterange"
7
+        type="daterange"
8
+        range-separator="至"
9
+        start-placeholder="开始日期"
10
+        end-placeholder="结束日期"
11
+        value-format="yyyy-MM-dd"
12
+        style="margin-right: 20px"
13
+        @change="dateChange"
14
+      />
15
+      <div style="float:right">
16
+        <el-button type="primary" @click="onSearch">查询</el-button>
17
+        <el-button @click="onReset">重置</el-button>
18
+      </div>
19
+    </el-card>
3
     <el-table stripe :data="tableData" border style="width: 100%">
20
     <el-table stripe :data="tableData" border style="width: 100%">
4
       <el-table-column prop="name" label="中奖人" />
21
       <el-table-column prop="name" label="中奖人" />
5
       <el-table-column prop="phone" label="手机号" />
22
       <el-table-column prop="phone" label="手机号" />
31
 export default {
48
 export default {
32
   data() {
49
   data() {
33
     return {
50
     return {
51
+      daterange: undefined,
34
       tableData: [],
52
       tableData: [],
53
+      endDate: undefined,
54
+      startDate: undefined,
35
       pageSize: 10,
55
       pageSize: 10,
36
       currentPage: 1,
56
       currentPage: 1,
37
       gameTotal: 0 // 条目总数
57
       gameTotal: 0 // 条目总数
54
     // 改变分页组件重新查询数据
74
     // 改变分页组件重新查询数据
55
     changePagination() {
75
     changePagination() {
56
       getPersonList({
76
       getPersonList({
77
+        startDate: this.startDate,
78
+        endDate: this.endDate,
57
         pageNum: this.currentPage,
79
         pageNum: this.currentPage,
58
         pageSize: this.pageSize
80
         pageSize: this.pageSize
59
       }).then((res) => {
81
       }).then((res) => {
62
     },
84
     },
63
     onSearch() {
85
     onSearch() {
64
       getPersonList({
86
       getPersonList({
87
+        startDate: this.startDate,
88
+        endDate: this.endDate,
65
         pageSize: this.pageSize
89
         pageSize: this.pageSize
66
       }).then((res) => {
90
       }).then((res) => {
67
         this.tableData = res.data.records
91
         this.tableData = res.data.records
68
         this.gameTotal = res.data.total
92
         this.gameTotal = res.data.total
69
         this.pageSize = res.data.size
93
         this.pageSize = res.data.size
70
       })
94
       })
95
+    },
96
+    onReset() {
97
+      this.title = undefined
98
+      this.daterange = undefined
99
+      this.startDate = undefined
100
+      this.endDate = undefined
101
+      this.currentPage = 1
102
+      this.pageSize = 10
103
+      this.onSearch()
104
+    },
105
+    dateChange(val) {
106
+      this.startDate = this.daterange[0]
107
+      this.endDate = this.daterange[1]
71
     }
108
     }
72
   }
109
   }
73
 }
110
 }