leisure-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +145 -0
- package/le-button/index.js +7 -0
- package/le-button/src/main.vue +48 -0
- package/le-button-msg/index.js +7 -0
- package/le-button-msg/src/main.vue +61 -0
- package/le-button-select-media/index.js +7 -0
- package/le-button-select-media/src/main.vue +64 -0
- package/le-button-upload/index.js +7 -0
- package/le-button-upload/src/main.vue +50 -0
- package/le-company/index.js +7 -0
- package/le-company/src/main.vue +101 -0
- package/le-company/src/sub.vue +111 -0
- package/le-coupon-give/index.js +7 -0
- package/le-coupon-give/src/main.vue +94 -0
- package/le-depart/index.js +7 -0
- package/le-depart/src/main.vue +162 -0
- package/le-dialog-container/index.js +7 -0
- package/le-dialog-container/src/main.vue +74 -0
- package/le-home/index.js +7 -0
- package/le-home/src/main.vue +570 -0
- package/le-image/index.js +7 -0
- package/le-image/src/main.vue +145 -0
- package/le-integral/index.js +7 -0
- package/le-integral/src/main.vue +198 -0
- package/le-libs/mixins/main.js +37 -0
- package/le-login/index.js +7 -0
- package/le-login/src/main.vue +181 -0
- package/le-media/index.js +7 -0
- package/le-media/src/main.vue +267 -0
- package/le-media-list/index.js +7 -0
- package/le-media-list/src/main.vue +177 -0
- package/le-media-upload/index.js +7 -0
- package/le-media-upload/src/main.vue +308 -0
- package/le-member/index.js +7 -0
- package/le-member/src/main.vue +445 -0
- package/le-member-level/index.js +7 -0
- package/le-member-level/src/main.vue +93 -0
- package/le-member-level/src/sub.vue +86 -0
- package/le-menu/index.js +7 -0
- package/le-menu/src/main.vue +248 -0
- package/le-rich-text/index.js +7 -0
- package/le-rich-text/src/main.vue +136 -0
- package/le-role/index.js +7 -0
- package/le-role/src/main.vue +169 -0
- package/le-role/src/sub.vue +79 -0
- package/le-role-user/index.js +7 -0
- package/le-role-user/src/main.vue +158 -0
- package/le-role-user/src/sub.vue +90 -0
- package/le-theme/common/var.scss +17 -0
- package/le-theme/iconfont/iconfont.css +125 -0
- package/le-theme/iconfont/iconfont.ttf +0 -0
- package/le-theme/iconfont/iconfont.woff +0 -0
- package/le-theme/iconfont/iconfont.woff2 +0 -0
- package/le-theme/pages/index.css +15 -0
- package/le-user/index.js +7 -0
- package/le-user/src/add.vue +118 -0
- package/le-user/src/main.vue +423 -0
- package/le-user/src/sub.vue +214 -0
- package/le-user-type/index.js +7 -0
- package/le-user-type/src/main.vue +39 -0
- package/package.json +51 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form :inline="true" :model="searchData">
|
|
4
|
+
<el-form-item label="用户id">
|
|
5
|
+
<el-input v-model="searchData.id" placeholder="用户id"></el-input>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
|
|
8
|
+
<el-form-item label="手机号">
|
|
9
|
+
<el-input v-model="searchData.phone" placeholder="手机号"></el-input>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="昵称">
|
|
12
|
+
<el-input v-model="searchData.nick" placeholder="昵称"></el-input>
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item>
|
|
15
|
+
<el-button type="primary" @click="list">查询</el-button>
|
|
16
|
+
<el-button type="primary" @click="integralLook">积分统计</el-button>
|
|
17
|
+
<el-popconfirm
|
|
18
|
+
:title="`该操作不可逆,将清除所有过期积分!`"
|
|
19
|
+
@confirm="clear()"
|
|
20
|
+
>
|
|
21
|
+
<template #reference>
|
|
22
|
+
<el-button type="danger" size="small" style="margin-left: 10px"
|
|
23
|
+
>积分清零</el-button
|
|
24
|
+
>
|
|
25
|
+
</template>
|
|
26
|
+
</el-popconfirm>
|
|
27
|
+
<el-button
|
|
28
|
+
id="btnExport"
|
|
29
|
+
type="primary"
|
|
30
|
+
@click="exportExcell"
|
|
31
|
+
style="margin-left: 10px"
|
|
32
|
+
>
|
|
33
|
+
导出会员
|
|
34
|
+
</el-button>
|
|
35
|
+
</el-form-item>
|
|
36
|
+
</el-form>
|
|
37
|
+
<el-table
|
|
38
|
+
:data="resultData"
|
|
39
|
+
border
|
|
40
|
+
row-key="id"
|
|
41
|
+
stripe
|
|
42
|
+
ref="eltablemain"
|
|
43
|
+
:max-height="elTableMaxHeight"
|
|
44
|
+
style="width: 100%"
|
|
45
|
+
>
|
|
46
|
+
<!-- <el-table-column
|
|
47
|
+
prop="id"
|
|
48
|
+
align="center"
|
|
49
|
+
label="ID"
|
|
50
|
+
width="60"
|
|
51
|
+
show-overflow-tooltip
|
|
52
|
+
el-tooltip
|
|
53
|
+
>
|
|
54
|
+
</el-table-column> -->
|
|
55
|
+
<el-table-column prop="phone" align="center" width="100" label="手机号">
|
|
56
|
+
</el-table-column>
|
|
57
|
+
<el-table-column prop="nick" align="center" width="120" label="昵称">
|
|
58
|
+
</el-table-column>
|
|
59
|
+
<el-table-column prop="utname" align="center" label="身份">
|
|
60
|
+
</el-table-column>
|
|
61
|
+
<el-table-column prop="sname" align="center" label="姓名">
|
|
62
|
+
</el-table-column>
|
|
63
|
+
<el-table-column prop="integral" align="center" label="积分">
|
|
64
|
+
<template slot-scope="scope">
|
|
65
|
+
<span v-if="scope.row.integral && scope.row.integral > 0">{{
|
|
66
|
+
scope.row.integral
|
|
67
|
+
}}</span>
|
|
68
|
+
<span v-else></span>
|
|
69
|
+
</template>
|
|
70
|
+
</el-table-column>
|
|
71
|
+
<el-table-column prop="birthday" align="center" width="90" label="生日">
|
|
72
|
+
</el-table-column>
|
|
73
|
+
<el-table-column prop="mtitle" align="center" label="会员级别">
|
|
74
|
+
</el-table-column>
|
|
75
|
+
<el-table-column
|
|
76
|
+
width="120"
|
|
77
|
+
prop="cdate"
|
|
78
|
+
align="center"
|
|
79
|
+
label="时间"
|
|
80
|
+
:formatter="dateFormat"
|
|
81
|
+
>
|
|
82
|
+
</el-table-column>
|
|
83
|
+
<el-table-column
|
|
84
|
+
label="操作"
|
|
85
|
+
align="center"
|
|
86
|
+
width="400"
|
|
87
|
+
fixed="right"
|
|
88
|
+
row
|
|
89
|
+
:key="guid()"
|
|
90
|
+
:render-header="renderHeader"
|
|
91
|
+
>
|
|
92
|
+
<template slot-scope="scope">
|
|
93
|
+
<div class="le-table-btn-container">
|
|
94
|
+
<el-button
|
|
95
|
+
type="primary"
|
|
96
|
+
id="btnEdit"
|
|
97
|
+
size="small"
|
|
98
|
+
@click="openIntegralWindow(scope.row, 0)"
|
|
99
|
+
>积分</el-button
|
|
100
|
+
>
|
|
101
|
+
<el-button
|
|
102
|
+
id="btnXf"
|
|
103
|
+
v-if="scope.row.unionid"
|
|
104
|
+
type="danger"
|
|
105
|
+
@click="openOrder(scope.row)"
|
|
106
|
+
>
|
|
107
|
+
订单
|
|
108
|
+
</el-button>
|
|
109
|
+
<el-button
|
|
110
|
+
id="btnConsume"
|
|
111
|
+
v-if="scope.row.unionid"
|
|
112
|
+
type="danger"
|
|
113
|
+
@click="giveIntegral(scope.row)"
|
|
114
|
+
>
|
|
115
|
+
赠送积分
|
|
116
|
+
</el-button>
|
|
117
|
+
<el-button
|
|
118
|
+
id="btnMemberNote"
|
|
119
|
+
v-if="scope.row.unionid"
|
|
120
|
+
type="danger"
|
|
121
|
+
@click="openMeberNote(scope.row)"
|
|
122
|
+
>
|
|
123
|
+
领取记录
|
|
124
|
+
</el-button>
|
|
125
|
+
<el-button
|
|
126
|
+
id="btnQrCode"
|
|
127
|
+
v-if="scope.row.unionid"
|
|
128
|
+
type="danger"
|
|
129
|
+
@click="getQrCode(scope.row)"
|
|
130
|
+
>
|
|
131
|
+
二维码
|
|
132
|
+
</el-button>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
</el-table-column>
|
|
136
|
+
</el-table>
|
|
137
|
+
<div style="text-align: center; margin-top: 30px">
|
|
138
|
+
<el-pagination
|
|
139
|
+
background
|
|
140
|
+
layout="prev, pager, next"
|
|
141
|
+
:total="searchData.total"
|
|
142
|
+
:page-size="10"
|
|
143
|
+
@current-change="current_change"
|
|
144
|
+
>
|
|
145
|
+
</el-pagination>
|
|
146
|
+
</div>
|
|
147
|
+
<el-dialog
|
|
148
|
+
width="90%"
|
|
149
|
+
v-el-drag-dialog
|
|
150
|
+
title="积分列表"
|
|
151
|
+
:visible.sync="showIntegral"
|
|
152
|
+
:close-on-click-modal="false"
|
|
153
|
+
@close="closeIntegralDialog"
|
|
154
|
+
>
|
|
155
|
+
<le-integral
|
|
156
|
+
:uid="currentUid"
|
|
157
|
+
@close="closeIntegralDialog"
|
|
158
|
+
v-if="showIntegral"
|
|
159
|
+
></le-integral>
|
|
160
|
+
</el-dialog>
|
|
161
|
+
<el-dialog
|
|
162
|
+
width="60%"
|
|
163
|
+
v-el-drag-dialog
|
|
164
|
+
title="赠送积分"
|
|
165
|
+
:visible.sync="showGiveIntegral"
|
|
166
|
+
:close-on-click-modal="false"
|
|
167
|
+
@close="closeGiveIntegralDialog"
|
|
168
|
+
>
|
|
169
|
+
<el-form v-model="integralForm">
|
|
170
|
+
<el-form-item label="手机号" label-width="150">
|
|
171
|
+
<el-input v-model="integralForm.phone"></el-input>
|
|
172
|
+
</el-form-item>
|
|
173
|
+
<el-form-item label="昵称" label-width="150">
|
|
174
|
+
<el-input v-model="integralForm.nick"></el-input>
|
|
175
|
+
</el-form-item>
|
|
176
|
+
<el-form-item label="积分" label-width="150">
|
|
177
|
+
<el-input-number
|
|
178
|
+
v-model="integralForm.integralNum"
|
|
179
|
+
:min="1"
|
|
180
|
+
></el-input-number>
|
|
181
|
+
</el-form-item>
|
|
182
|
+
</el-form>
|
|
183
|
+
<div slot="footer" class="dialog-footer">
|
|
184
|
+
<el-button @click="closeGiveIntegralDialog">取 消</el-button>
|
|
185
|
+
<el-button type="primary" @click="saveGiveIntegral">确 定</el-button>
|
|
186
|
+
</div>
|
|
187
|
+
</el-dialog>
|
|
188
|
+
<el-dialog
|
|
189
|
+
width="60%"
|
|
190
|
+
v-el-drag-dialog
|
|
191
|
+
title="领取记录"
|
|
192
|
+
:visible.sync="showMemberNote"
|
|
193
|
+
:close-on-click-modal="false"
|
|
194
|
+
@close="closeMemberNotelDialog"
|
|
195
|
+
>
|
|
196
|
+
<el-form v-model="memberNoteForm">
|
|
197
|
+
<el-form-item label="领取记录" label-width="150">
|
|
198
|
+
<el-input v-model="memberNoteForm.note" type="textarea" :rows="4">
|
|
199
|
+
</el-input>
|
|
200
|
+
</el-form-item>
|
|
201
|
+
</el-form>
|
|
202
|
+
<div slot="footer" class="dialog-footer">
|
|
203
|
+
<el-button @click="closeMemberNotelDialog">取 消</el-button>
|
|
204
|
+
<el-button type="primary" @click="saveMemberNoteForm">确 定</el-button>
|
|
205
|
+
</div>
|
|
206
|
+
</el-dialog>
|
|
207
|
+
<el-dialog
|
|
208
|
+
title="二维码"
|
|
209
|
+
v-el-drag-dialog
|
|
210
|
+
:visible.sync="showQRCodeDialog"
|
|
211
|
+
:close-on-click-modal="false"
|
|
212
|
+
width="250px"
|
|
213
|
+
append-to-body
|
|
214
|
+
center
|
|
215
|
+
>
|
|
216
|
+
<div v-if="showQRCodeDialog" id="qrcode"></div>
|
|
217
|
+
<span slot="footer" class="dialog-footer">
|
|
218
|
+
<el-button
|
|
219
|
+
type="primary"
|
|
220
|
+
size="small"
|
|
221
|
+
@click="showQRCodeDialog = false"
|
|
222
|
+
>
|
|
223
|
+
关闭
|
|
224
|
+
</el-button>
|
|
225
|
+
</span>
|
|
226
|
+
</el-dialog>
|
|
227
|
+
</div>
|
|
228
|
+
</template>
|
|
229
|
+
<script>
|
|
230
|
+
import { list as userList } from "@/api/user";
|
|
231
|
+
import { addIntegral } from "@/api/integral";
|
|
232
|
+
import QRCode from "qrcodejs2";
|
|
233
|
+
import { list, sum, clear } from "@/api/integral";
|
|
234
|
+
import { insertMemberNote, selectMemberNote } from "@/api/member";
|
|
235
|
+
import { exportMemberExcel } from "@/utils/downLoadFile";
|
|
236
|
+
import moment from "moment";
|
|
237
|
+
import leMixins from "leisure-ui/le-libs/mixins/main"; //
|
|
238
|
+
import guid from "leisure-js/common/util";
|
|
239
|
+
export default {
|
|
240
|
+
name: "le-member",
|
|
241
|
+
mixins: [leMixins],
|
|
242
|
+
data() {
|
|
243
|
+
return {
|
|
244
|
+
resultData: [],
|
|
245
|
+
currentUid: "",
|
|
246
|
+
searchData: {
|
|
247
|
+
id: "",
|
|
248
|
+
phone: "",
|
|
249
|
+
nick: "",
|
|
250
|
+
pageNo: 1,
|
|
251
|
+
total: 1,
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
showProductOrder: false,
|
|
255
|
+
showQRCodeDialog: false,
|
|
256
|
+
showIntegral: false,
|
|
257
|
+
uphone: "",
|
|
258
|
+
unionid: "",
|
|
259
|
+
|
|
260
|
+
showGiveIntegral: false,
|
|
261
|
+
currentUser: {},
|
|
262
|
+
integralForm: {
|
|
263
|
+
phone: "",
|
|
264
|
+
nick: "",
|
|
265
|
+
integralNum: 0,
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
showMemberNote: false,
|
|
269
|
+
memberNoteForm: {
|
|
270
|
+
id: "",
|
|
271
|
+
uid: "",
|
|
272
|
+
note: "",
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
},
|
|
276
|
+
mounted() {
|
|
277
|
+
this.list();
|
|
278
|
+
// this.getAllCouponList();
|
|
279
|
+
},
|
|
280
|
+
methods: {
|
|
281
|
+
guid,
|
|
282
|
+
openOrder(row) {
|
|
283
|
+
this.uphone = row.phone;
|
|
284
|
+
this.unionid = row.unionid;
|
|
285
|
+
this.showProductOrder = true;
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
integralLook() {
|
|
289
|
+
this.currentUid = "";
|
|
290
|
+
this.showIntegral = true;
|
|
291
|
+
},
|
|
292
|
+
openIntegralWindow(row) {
|
|
293
|
+
this.currentUid = row.id;
|
|
294
|
+
this.showIntegral = true;
|
|
295
|
+
},
|
|
296
|
+
closeIntegralDialog() {
|
|
297
|
+
this.currentUid = "";
|
|
298
|
+
this.showIntegral = false;
|
|
299
|
+
},
|
|
300
|
+
closeProductOrderDialog() {
|
|
301
|
+
this.showProductOrder = false;
|
|
302
|
+
this.uphone = "";
|
|
303
|
+
},
|
|
304
|
+
closeMemberNotelDialog() {
|
|
305
|
+
this.showMemberNote = false;
|
|
306
|
+
this.memberNoteForm.id = "";
|
|
307
|
+
this.memberNoteForm.uid = "";
|
|
308
|
+
this.memberNoteForm.note = "";
|
|
309
|
+
},
|
|
310
|
+
giveIntegral(item) {
|
|
311
|
+
this.integralForm.phone = item.phone;
|
|
312
|
+
this.integralForm.nick = item.nick;
|
|
313
|
+
this.integralForm.integralNum = 1;
|
|
314
|
+
this.currentUser = item;
|
|
315
|
+
this.showGiveIntegral = true;
|
|
316
|
+
},
|
|
317
|
+
|
|
318
|
+
saveGiveIntegral() {
|
|
319
|
+
let params = {};
|
|
320
|
+
params.uid = this.currentUser.id;
|
|
321
|
+
params.phone = this.currentUser.phone;
|
|
322
|
+
params.quantity_r = this.integralForm.integralNum;
|
|
323
|
+
addIntegral(params).then((res) => {
|
|
324
|
+
this.showGiveIntegral = false;
|
|
325
|
+
this.$message.success(res.data.info);
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
openMeberNote(row) {
|
|
329
|
+
let uid = row.id;
|
|
330
|
+
this.selectMemberNoteForm(uid);
|
|
331
|
+
},
|
|
332
|
+
selectMemberNoteForm(uid) {
|
|
333
|
+
let param = {};
|
|
334
|
+
param.uid = uid;
|
|
335
|
+
selectMemberNote(param).then((res) => {
|
|
336
|
+
let data = res.data.data;
|
|
337
|
+
if (data) {
|
|
338
|
+
this.memberNoteForm.note = data.note;
|
|
339
|
+
this.memberNoteForm.id = data.id;
|
|
340
|
+
}
|
|
341
|
+
this.memberNoteForm.uid = uid;
|
|
342
|
+
this.showMemberNote = true;
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
saveMemberNoteForm() {
|
|
346
|
+
let param = JSON.parse(JSON.stringify(this.memberNoteForm));
|
|
347
|
+
console.log(param);
|
|
348
|
+
insertMemberNote(param).then((res) => {
|
|
349
|
+
this.$message.success("保存成功!");
|
|
350
|
+
this.showMemberNote = false;
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
closeGiveIntegralDialog() {
|
|
354
|
+
this.showGiveIntegral = false;
|
|
355
|
+
},
|
|
356
|
+
list() {
|
|
357
|
+
let params = {};
|
|
358
|
+
|
|
359
|
+
if (this.searchData.phone.length > 0) {
|
|
360
|
+
params.phone = this.searchData.phone;
|
|
361
|
+
}
|
|
362
|
+
if (this.searchData.nick.length > 0) {
|
|
363
|
+
params.nick = this.searchData.nick;
|
|
364
|
+
}
|
|
365
|
+
if (this.searchData.id && this.searchData.id.length > 0) {
|
|
366
|
+
params.id = this.searchData.id;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
params.membered = 1;
|
|
370
|
+
|
|
371
|
+
params.pageNo = this.searchData.pageNo;
|
|
372
|
+
userList(params).then((res) => {
|
|
373
|
+
this.resultData = res.data.data.list;
|
|
374
|
+
this.searchData.total = res.data.data.count;
|
|
375
|
+
});
|
|
376
|
+
},
|
|
377
|
+
current_change(currentPage) {
|
|
378
|
+
this.searchData.pageNo = currentPage;
|
|
379
|
+
this.list();
|
|
380
|
+
},
|
|
381
|
+
dateFormat(row, column, data) {
|
|
382
|
+
return moment.unix(data).format("YYYY-MM-DD HH:mm");
|
|
383
|
+
},
|
|
384
|
+
clear() {
|
|
385
|
+
clear().then(() => {
|
|
386
|
+
this.$message.success("所有用户过期积分已经全部清零");
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
exportExcell() {
|
|
390
|
+
let params = {};
|
|
391
|
+
exportMemberExcel("会员列表", params);
|
|
392
|
+
},
|
|
393
|
+
getQrCode(userInfo) {
|
|
394
|
+
this.showQRCodeDialog = true;
|
|
395
|
+
let params = {};
|
|
396
|
+
params.id = userInfo.id;
|
|
397
|
+
params.account = userInfo.account;
|
|
398
|
+
params.nick = userInfo.nick;
|
|
399
|
+
params.wx_url = userInfo.wx_url;
|
|
400
|
+
params.unionid = userInfo.unionid;
|
|
401
|
+
params.phone = userInfo.phone;
|
|
402
|
+
params.openid = userInfo.openid;
|
|
403
|
+
params.pid = userInfo.pid;
|
|
404
|
+
params.ptype = userInfo.ptype;
|
|
405
|
+
params = encodeURIComponent(JSON.stringify(params));
|
|
406
|
+
setTimeout(() => {
|
|
407
|
+
new QRCode("qrcode", {
|
|
408
|
+
width: 200,
|
|
409
|
+
height: 200,
|
|
410
|
+
text: params,
|
|
411
|
+
colorDark: "#000",
|
|
412
|
+
colorLight: "#fff",
|
|
413
|
+
correctLevel: QRCode.CorrectLevel.L,
|
|
414
|
+
});
|
|
415
|
+
}, 100);
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
</script>
|
|
420
|
+
<style lang="less">
|
|
421
|
+
.avatar-uploader {
|
|
422
|
+
width: 100px;
|
|
423
|
+
border: 1px dashed #d9d9d9;
|
|
424
|
+
border-radius: 6px;
|
|
425
|
+
cursor: pointer;
|
|
426
|
+
position: relative;
|
|
427
|
+
overflow: hidden;
|
|
428
|
+
}
|
|
429
|
+
.avatar-uploader:hover {
|
|
430
|
+
border-color: #409eff;
|
|
431
|
+
}
|
|
432
|
+
.avatar-uploader-icon {
|
|
433
|
+
font-size: 28px;
|
|
434
|
+
color: #8c939d;
|
|
435
|
+
width: 100px;
|
|
436
|
+
height: 100px;
|
|
437
|
+
line-height: 100px;
|
|
438
|
+
text-align: center;
|
|
439
|
+
}
|
|
440
|
+
.avatar {
|
|
441
|
+
width: 100px;
|
|
442
|
+
height: 100px;
|
|
443
|
+
display: block;
|
|
444
|
+
}
|
|
445
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-table :data="tableData" border row-key="id" stripe style="width: 100%">
|
|
4
|
+
<el-table-column prop="title" label="标题"> </el-table-column>
|
|
5
|
+
<!-- <el-table-column prop="note" label="权益"> </el-table-column> -->
|
|
6
|
+
<el-table-column
|
|
7
|
+
fixed="right"
|
|
8
|
+
label="操作"
|
|
9
|
+
align="center"
|
|
10
|
+
width="120"
|
|
11
|
+
row
|
|
12
|
+
>
|
|
13
|
+
<template slot-scope="scope">
|
|
14
|
+
<el-button type="text" size="small" @click="openDetail(scope.row)"
|
|
15
|
+
>编辑与详情</el-button
|
|
16
|
+
>
|
|
17
|
+
<el-popconfirm
|
|
18
|
+
:title="`该操作不可逆,确定删除?`"
|
|
19
|
+
@confirm="del(scope.row.id)"
|
|
20
|
+
>
|
|
21
|
+
<template #reference>
|
|
22
|
+
<!-- <el-button type="text" size="small">删除</el-button> -->
|
|
23
|
+
</template>
|
|
24
|
+
</el-popconfirm>
|
|
25
|
+
</template>
|
|
26
|
+
</el-table-column>
|
|
27
|
+
</el-table>
|
|
28
|
+
<el-dialog
|
|
29
|
+
width="60%"
|
|
30
|
+
v-el-drag-dialog
|
|
31
|
+
title="会员等级"
|
|
32
|
+
:visible.sync="showDetails"
|
|
33
|
+
:close-on-click-modal="false"
|
|
34
|
+
append-to-body
|
|
35
|
+
@close="closeDetailsDialog"
|
|
36
|
+
>
|
|
37
|
+
<le-member-level-sub
|
|
38
|
+
ref="detaileditwindow"
|
|
39
|
+
:rowData="detailRow"
|
|
40
|
+
:isAdd="false"
|
|
41
|
+
v-if="showDetails"
|
|
42
|
+
></le-member-level-sub>
|
|
43
|
+
<div slot="footer">
|
|
44
|
+
<el-button type="primary" @click="saveMemberLevel">保存</el-button>
|
|
45
|
+
<el-button type="primary" @click="closeDetailsDialog">关闭</el-button>
|
|
46
|
+
</div>
|
|
47
|
+
</el-dialog>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
<script>
|
|
51
|
+
import { levelList, levelDel, levelAdd, levelEdit } from "@/api/member";
|
|
52
|
+
import LeMemberLevelSub from "./sub.vue";
|
|
53
|
+
export default {
|
|
54
|
+
name: "le-member-level",
|
|
55
|
+
components: { LeMemberLevelSub },
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
tableData: [],
|
|
59
|
+
showDetails: false,
|
|
60
|
+
detailRow: null,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
computed: {},
|
|
64
|
+
mounted() {
|
|
65
|
+
this.list();
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
list() {
|
|
69
|
+
levelList().then((res) => {
|
|
70
|
+
this.tableData = res.data.data;
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
del(levelId) {
|
|
74
|
+
levelDel(levelId).then((response) => {
|
|
75
|
+
this.list();
|
|
76
|
+
this.$message.success(response.data.info);
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
closeDetailsDialog() {
|
|
80
|
+
this.detailRow = null;
|
|
81
|
+
this.showDetails = false;
|
|
82
|
+
},
|
|
83
|
+
openDetail(obj) {
|
|
84
|
+
this.detailRow = obj;
|
|
85
|
+
this.showDetails = true;
|
|
86
|
+
},
|
|
87
|
+
saveMemberLevel() {
|
|
88
|
+
this.$refs["detaileditwindow"].onSubmit();
|
|
89
|
+
this.closeDetailsDialog();
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
3
|
+
<el-form-item label="等级标题" prop="title">
|
|
4
|
+
<el-input v-model="form.title"></el-input>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item label="权益说明" prop="note">
|
|
7
|
+
<le-editor v-model="form.note"></le-editor>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
</el-form>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
import { levelAdd, levelEdit } from "@/api/member";
|
|
13
|
+
import { LeEditor } from "leisure-editor";
|
|
14
|
+
// import { LeEditor } from "../../../dist/leisure-editor";
|
|
15
|
+
export default {
|
|
16
|
+
name: "le-member-level-sub",
|
|
17
|
+
components: {
|
|
18
|
+
LeEditor,
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
rowData: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
isAdd: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
form: {
|
|
33
|
+
id: "",
|
|
34
|
+
title: "",
|
|
35
|
+
note: "",
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
title: [
|
|
39
|
+
{ required: true, message: "请输入会员等级", trigger: "blur" },
|
|
40
|
+
{
|
|
41
|
+
min: 1,
|
|
42
|
+
max: 50,
|
|
43
|
+
message: "长度在 1 到 50 个字符",
|
|
44
|
+
trigger: "blur",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
note: [
|
|
48
|
+
{
|
|
49
|
+
max: 100,
|
|
50
|
+
message: "长度在 0 到 100",
|
|
51
|
+
trigger: "blur",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
mounted() {
|
|
58
|
+
this.form = this.rowData;
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
onSubmit() {
|
|
62
|
+
this.$refs["form"].validate((valid) => {
|
|
63
|
+
if (valid) {
|
|
64
|
+
let param = {
|
|
65
|
+
note: this.form.note,
|
|
66
|
+
id: this.form.id,
|
|
67
|
+
title: this.form.title,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
if (this.isAdd) {
|
|
71
|
+
levelAdd(param).then((response) => {
|
|
72
|
+
this.$message.success(response.data.info);
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
levelEdit(param).then((res) => {
|
|
76
|
+
this.$message.success(res.data.info);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
</script>
|