默认提交
Showing
4 changed files
with
246 additions
and
1 deletions
git.sh
0 → 100755
... | @@ -76,6 +76,15 @@ export const constantRouterMap = [{ | ... | @@ -76,6 +76,15 @@ export const constantRouterMap = [{ |
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | { | 78 | { |
79 | path: '/dictionary/manual', | ||
80 | name: 'manual', | ||
81 | component: () => import('@/views/dictionary/manual'), | ||
82 | meta: { | ||
83 | title: '注册会员', | ||
84 | icon: '' | ||
85 | } | ||
86 | }, | ||
87 | { | ||
79 | path: '/dictionary/pvpage', | 88 | path: '/dictionary/pvpage', |
80 | name: 'pvpage', | 89 | name: 'pvpage', |
81 | component: () => import('@/views/dictionary/pvpage'), | 90 | component: () => import('@/views/dictionary/pvpage'), | ... | ... |
src/views/dictionary/manual.vue
0 → 100644
1 | <template> | ||
2 | <div class="page-container"> | ||
3 | <div class="tool-wrap"> | ||
4 | <div> | ||
5 | <el-form :inline="true" :model="filters"> | ||
6 | <el-form-item> | ||
7 | <el-input @change="changeHandler()" v-model="filters.mobilePhone" placeholder="请输入手机号"></el-input> | ||
8 | </el-form-item> | ||
9 | <el-form-item> | ||
10 | <el-date-picker @change="changeHandler()" v-model="filters.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
11 | </el-date-picker> | ||
12 | </el-form-item> | ||
13 | <el-form-item> | ||
14 | <el-button type="primary" v-on:click="reqQuery">查询</el-button> | ||
15 | </el-form-item> | ||
16 | </el-form> | ||
17 | </div> | ||
18 | <div> | ||
19 | <el-button class="reset-btn" @click="showDialog()">导出数据</el-button> | ||
20 | </div> | ||
21 | </div> | ||
22 | |||
23 | <el-table :data="totalData.reservationList" highlight-current-row v-loading="listLoading" style="width: 100%;"> | ||
24 | |||
25 | <el-table-column prop="employer" label="单位"> | ||
26 | </el-table-column> | ||
27 | <el-table-column prop="project" label="项目"> | ||
28 | </el-table-column> | ||
29 | <el-table-column prop="name" label="姓名"> | ||
30 | </el-table-column> | ||
31 | <el-table-column prop="mobile" label="联系方式"> | ||
32 | </el-table-column> | ||
33 | <el-table-column prop="email" label="邮箱"> | ||
34 | </el-table-column> | ||
35 | <el-table-column prop="product" label="使用过产品"> | ||
36 | </el-table-column> | ||
37 | <!-- <el-table-column prop="used" label="使用过天宝产品"> | ||
38 | </el-table-column> --> | ||
39 | |||
40 | <el-table-column prop="hdp_created" :formatter="formatTableDate" label="申请时间"> | ||
41 | </el-table-column> | ||
42 | <el-table-column prop="openid" label="openid"> | ||
43 | </el-table-column> | ||
44 | <el-table-column prop="nickname" label="昵称"> | ||
45 | </el-table-column> | ||
46 | <el-table-column label="微信头像"> | ||
47 | <template slot-scope="scope"> | ||
48 | <div class="avatar-wrap"> | ||
49 | <img class="avatar" :src="scope.row.avatar" alt=""> | ||
50 | </div> | ||
51 | </template> | ||
52 | </el-table-column> | ||
53 | |||
54 | </el-table> | ||
55 | |||
56 | <!--工具条--> | ||
57 | <el-col :span="24" class="toolbar"> | ||
58 | <div class="page-tips">总共{{total}}条记录,每页{{pageSize}}条,总共{{pageNum}}页</div> | ||
59 | <el-pagination layout="prev, pager, next,jumper" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> | ||
60 | </el-pagination> | ||
61 | </el-col> | ||
62 | |||
63 | <el-dialog class="dialog" center title="导出数据设定" :visible.sync="exportDialogVisible" :close-on-click-modal="false"> | ||
64 | <span class="tips">导出日期</span> | ||
65 | <el-date-picker v-model="exportDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions2"> | ||
66 | </el-date-picker> | ||
67 | <div slot="footer" class="dialog-footer"> | ||
68 | <el-button style="width:120px;" @click.native="exportDialogVisible = false">取消</el-button> | ||
69 | <el-button style="width:120px;" type="primary" @click.native="exportHandler()">导出</el-button> | ||
70 | </div> | ||
71 | </el-dialog> | ||
72 | |||
73 | </div> | ||
74 | </template> | ||
75 | |||
76 | <script> | ||
77 | import { Base64 } from "js-base64"; | ||
78 | import { exportTable } from "./../../api/api.js"; | ||
79 | import { formatDate } from "./../../common/utils.js"; | ||
80 | |||
81 | export default { | ||
82 | data() { | ||
83 | return { | ||
84 | exportDate: [ | ||
85 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
86 | new Date().getTime() | ||
87 | ], | ||
88 | exportDialogVisible: false, | ||
89 | listLoading: false, | ||
90 | page: 1, | ||
91 | pageSize: 10, | ||
92 | total: 0, | ||
93 | totalData: { | ||
94 | reservationList: [] | ||
95 | }, | ||
96 | selDate: [ | ||
97 | new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), | ||
98 | new Date() | ||
99 | ], | ||
100 | pickerOptions2: { | ||
101 | disabledDate(time) { | ||
102 | return time.getTime() > Date.now(); | ||
103 | } | ||
104 | }, | ||
105 | filters: { | ||
106 | mobilePhone: "", | ||
107 | date: "" | ||
108 | } | ||
109 | }; | ||
110 | }, | ||
111 | computed: { | ||
112 | pageNum() { | ||
113 | return Math.ceil(this.total / this.pageSize); | ||
114 | }, | ||
115 | startTime() { | ||
116 | let date = this.filters.date; | ||
117 | let result = (date && date[0]) || ""; | ||
118 | if (result) { | ||
119 | result = date[0].getTime(); | ||
120 | } | ||
121 | return result; | ||
122 | }, | ||
123 | endTime() { | ||
124 | let date = this.filters.date; | ||
125 | let result = (date && date[1]) || ""; | ||
126 | if (result) { | ||
127 | result = date[1].getTime() + 1000 * 60 * 60 * 24; | ||
128 | } | ||
129 | return result; | ||
130 | } | ||
131 | }, | ||
132 | methods: { | ||
133 | changeHandler() { | ||
134 | this.reqQuery(); | ||
135 | }, | ||
136 | exportHandler() { | ||
137 | let data = { | ||
138 | start_time: new Date(this.exportDate[0]).getTime(), | ||
139 | end_time: new Date(this.exportDate[1]).getTime() + 1000 * 60 * 60 * 24, | ||
140 | mobile_phone: "", | ||
141 | startIndex: 0, | ||
142 | size: 1000000 | ||
143 | }; | ||
144 | var encoder = HDP.getEncoder(); | ||
145 | var encrypted = encoder.encode(JSON.stringify(data)); | ||
146 | let params = { | ||
147 | appId: "0489fba68acd11e98c527cd30aeb749e", | ||
148 | appKey: "9524a3c59a5d4460bd141a2a93a5db17", | ||
149 | func: "queryManualList", | ||
150 | data: encrypted | ||
151 | }; | ||
152 | exportTable(params); | ||
153 | }, | ||
154 | showDialog() { | ||
155 | this.exportDialogVisible = true; | ||
156 | }, | ||
157 | formatTableDate(row, column) { | ||
158 | return formatDate.format( | ||
159 | new Date(row.hdp_created), | ||
160 | "yyyy-MM-dd hh:mm:dd" | ||
161 | ); | ||
162 | }, | ||
163 | handleCurrentChange(val) { | ||
164 | this.page = val; | ||
165 | this.reqQuery(); | ||
166 | }, | ||
167 | reqQuery() { | ||
168 | let _this = this; | ||
169 | _this.listLoading = true; | ||
170 | let data = { | ||
171 | startIndex: (this.page - 1) * this.pageSize, | ||
172 | size: this.pageSize, | ||
173 | mobile_phone: this.filters.mobilePhone, | ||
174 | start_time: this.startTime, | ||
175 | end_time: this.endTime | ||
176 | }; | ||
177 | as.queryFunV2("queryManualList", data, res => { | ||
178 | console.log("queryManualList res:", res); | ||
179 | _this.page = 1; | ||
180 | _this.listLoading = false; | ||
181 | if (res) { | ||
182 | let reservationList = res[0]; | ||
183 | let total = res[1][0].total; | ||
184 | _this.total = total; | ||
185 | _this.$set(_this.totalData, "reservationList", reservationList); | ||
186 | } | ||
187 | }); | ||
188 | } | ||
189 | }, | ||
190 | mounted() { | ||
191 | this.reqQuery(); | ||
192 | }, | ||
193 | created() {} | ||
194 | }; | ||
195 | </script> | ||
196 | |||
197 | <style lang="scss" scoped> | ||
198 | .page-container { | ||
199 | padding: 20px; | ||
200 | } | ||
201 | |||
202 | .tool-wrap { | ||
203 | padding: 24px 0; | ||
204 | display: flex; | ||
205 | border-bottom: solid 1px #cccccc; | ||
206 | justify-content: space-between; | ||
207 | } | ||
208 | |||
209 | .toolbar { | ||
210 | display: flex; | ||
211 | justify-content: space-between; | ||
212 | .page-tips { | ||
213 | height: 32px; | ||
214 | line-height: 32px; | ||
215 | color: #333333; | ||
216 | } | ||
217 | } | ||
218 | |||
219 | .dialog { | ||
220 | .tips { | ||
221 | margin-right: 24px; | ||
222 | } | ||
223 | } | ||
224 | </style> |
... | @@ -152,7 +152,7 @@ export default { | ... | @@ -152,7 +152,7 @@ export default { |
152 | this.exportDialogVisible = true; | 152 | this.exportDialogVisible = true; |
153 | }, | 153 | }, |
154 | formatTableDate(row, column) { | 154 | formatTableDate(row, column) { |
155 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm"); | 155 | return formatDate.format(new Date(row.hdp_created), "yyyy-MM-dd hh:mm:dd"); |
156 | }, | 156 | }, |
157 | handleCurrentChange(val) { | 157 | handleCurrentChange(val) { |
158 | this.page = val; | 158 | this.page = val; | ... | ... |
-
Please register or sign in to post a comment