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,423 @@
|
|
|
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
|
+
<el-form-item label="账号">
|
|
8
|
+
<el-input v-model="searchData.account" placeholder="账号"></el-input>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<el-form-item label="手机号">
|
|
11
|
+
<el-input v-model="searchData.phone" placeholder="手机号"></el-input>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
<el-form-item label="昵称">
|
|
14
|
+
<el-input v-model="searchData.nick" placeholder="昵称"></el-input>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
<el-form-item label="会员">
|
|
17
|
+
<el-select v-model="searchData.membered" clearable placeholder="请选择">
|
|
18
|
+
<el-option label="否" value="0" key="0"></el-option>
|
|
19
|
+
<el-option label="是" value="1" key="1"></el-option>
|
|
20
|
+
</el-select>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<el-form-item>
|
|
23
|
+
<el-button type="primary" @click="list">查询</el-button>
|
|
24
|
+
<el-button type="primary" @click="addUser">新建</el-button>
|
|
25
|
+
</el-form-item>
|
|
26
|
+
</el-form>
|
|
27
|
+
<el-table
|
|
28
|
+
:data="resultData"
|
|
29
|
+
border
|
|
30
|
+
ref="eltablemain"
|
|
31
|
+
:max-height="elTableMaxHeight"
|
|
32
|
+
row-key="id"
|
|
33
|
+
stripe
|
|
34
|
+
style="width: 100%"
|
|
35
|
+
>
|
|
36
|
+
<el-table-column
|
|
37
|
+
prop="id"
|
|
38
|
+
align="center"
|
|
39
|
+
label="ID"
|
|
40
|
+
width="100"
|
|
41
|
+
show-overflow-tooltip
|
|
42
|
+
>
|
|
43
|
+
</el-table-column>
|
|
44
|
+
<el-table-column prop="nick" align="center" label="昵称(手机号)">
|
|
45
|
+
<template slot-scope="scope">
|
|
46
|
+
<span v-if="scope.row.nick">{{ scope.row.nick }}</span>
|
|
47
|
+
<span v-else-if="scope.row.managered && scope.row.account">{{
|
|
48
|
+
scope.row.account
|
|
49
|
+
}}</span>
|
|
50
|
+
<span v-else>{{ scope.row.phone }}</span>
|
|
51
|
+
</template>
|
|
52
|
+
</el-table-column>
|
|
53
|
+
<el-table-column prop="utname" align="center" label="身份">
|
|
54
|
+
</el-table-column>
|
|
55
|
+
<el-table-column prop="membered" align="center" label="会员">
|
|
56
|
+
<template slot-scope="scope">
|
|
57
|
+
<span v-if="scope.row.membered == 0">否</span>
|
|
58
|
+
<span v-if="scope.row.membered == 1">会员</span>
|
|
59
|
+
</template>
|
|
60
|
+
</el-table-column>
|
|
61
|
+
<el-table-column prop="lip" align="center" label="登录ip">
|
|
62
|
+
</el-table-column>
|
|
63
|
+
<el-table-column
|
|
64
|
+
prop="cdate"
|
|
65
|
+
align="center"
|
|
66
|
+
label="时间"
|
|
67
|
+
:formatter="dateFormat"
|
|
68
|
+
>
|
|
69
|
+
</el-table-column>
|
|
70
|
+
<el-table-column
|
|
71
|
+
label="操作"
|
|
72
|
+
fixed="right"
|
|
73
|
+
align="center"
|
|
74
|
+
:key="guid()"
|
|
75
|
+
:render-header="renderHeader"
|
|
76
|
+
>
|
|
77
|
+
<template slot-scope="scope">
|
|
78
|
+
<div class="le-table-btn-container">
|
|
79
|
+
<el-button
|
|
80
|
+
type="primary"
|
|
81
|
+
id="btnEdit"
|
|
82
|
+
v-permission="$route.params.btns"
|
|
83
|
+
size="small"
|
|
84
|
+
@click="openEditWindow(scope.row)"
|
|
85
|
+
>编辑</el-button
|
|
86
|
+
>
|
|
87
|
+
<le-button-msg
|
|
88
|
+
v-if="scope.row.managered == 0"
|
|
89
|
+
id="btnMember"
|
|
90
|
+
type="primary"
|
|
91
|
+
:isDispSlot="true"
|
|
92
|
+
title="确定设置该会员?"
|
|
93
|
+
v-permission="$route.params.btns"
|
|
94
|
+
@click="memberManager(scope.row)"
|
|
95
|
+
>
|
|
96
|
+
<span v-if="scope.row.membered == 0">设置会员</span>
|
|
97
|
+
<span v-if="scope.row.membered == 1">取消会员</span>
|
|
98
|
+
</le-button-msg>
|
|
99
|
+
<le-button-msg
|
|
100
|
+
id="btnPwd"
|
|
101
|
+
text="重置密码"
|
|
102
|
+
type="danger"
|
|
103
|
+
title="该操作不可逆,确定重置?"
|
|
104
|
+
v-permission="$route.params.btns"
|
|
105
|
+
@click="resetPwd(scope.row)"
|
|
106
|
+
></le-button-msg>
|
|
107
|
+
<el-button
|
|
108
|
+
type="danger"
|
|
109
|
+
v-if="scope.row.managered == 0"
|
|
110
|
+
id="btnYhj"
|
|
111
|
+
v-permission="$route.params.btns"
|
|
112
|
+
@click="sendYhj(scope.row)"
|
|
113
|
+
>
|
|
114
|
+
赠送优惠券
|
|
115
|
+
</el-button>
|
|
116
|
+
<!-- <el-button
|
|
117
|
+
id="btnXf"
|
|
118
|
+
v-if="scope.row.unionid"
|
|
119
|
+
v-permission="$route.params.btns"
|
|
120
|
+
type="danger"
|
|
121
|
+
@click="openOrder(scope.row)"
|
|
122
|
+
>
|
|
123
|
+
消费记录
|
|
124
|
+
</el-button> -->
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
127
|
+
</el-table-column>
|
|
128
|
+
</el-table>
|
|
129
|
+
<div style="text-align: center; margin-top: 25px">
|
|
130
|
+
<el-pagination
|
|
131
|
+
background
|
|
132
|
+
layout="prev, pager, next"
|
|
133
|
+
:total="searchData.total"
|
|
134
|
+
:page-size="10"
|
|
135
|
+
@current-change="current_change"
|
|
136
|
+
>
|
|
137
|
+
>
|
|
138
|
+
</el-pagination>
|
|
139
|
+
</div>
|
|
140
|
+
<le-dialog-container
|
|
141
|
+
title="编辑用户"
|
|
142
|
+
width="50%"
|
|
143
|
+
:showDialog="showEditUser"
|
|
144
|
+
@close="closeEditUser"
|
|
145
|
+
>
|
|
146
|
+
<le-user-sub
|
|
147
|
+
v-if="showEditUser"
|
|
148
|
+
@close="closeEditUser"
|
|
149
|
+
:currentUser="currentUser"
|
|
150
|
+
></le-user-sub>
|
|
151
|
+
</le-dialog-container>
|
|
152
|
+
<le-dialog-container
|
|
153
|
+
title="选择优惠券"
|
|
154
|
+
width="30%"
|
|
155
|
+
:showDialog="showYhj"
|
|
156
|
+
@close="cancelShowYhj"
|
|
157
|
+
>
|
|
158
|
+
<le-coupon-give
|
|
159
|
+
v-if="showYhj"
|
|
160
|
+
:uid="currentUser.id"
|
|
161
|
+
:unionid="currentUser.unionid"
|
|
162
|
+
@close="cancelShowYhj"
|
|
163
|
+
></le-coupon-give>
|
|
164
|
+
</le-dialog-container>
|
|
165
|
+
<le-dialog-container
|
|
166
|
+
title="创建后台用户"
|
|
167
|
+
width="50%"
|
|
168
|
+
:showDialog="showUserAdd"
|
|
169
|
+
@close="closeUserAdd"
|
|
170
|
+
>
|
|
171
|
+
<le-user-add v-if="showUserAdd" @close="closeUserAdd"></le-user-add>
|
|
172
|
+
</le-dialog-container>
|
|
173
|
+
</div>
|
|
174
|
+
</template>
|
|
175
|
+
<script>
|
|
176
|
+
import {
|
|
177
|
+
list as userList,
|
|
178
|
+
del as userDel,
|
|
179
|
+
open,
|
|
180
|
+
close,
|
|
181
|
+
userChangePwd,
|
|
182
|
+
} from "@/api/user";
|
|
183
|
+
import leMixins from "leisure-ui/le-libs/mixins/main";//
|
|
184
|
+
// import leMixins from "../../le-libs/mixins/main";
|
|
185
|
+
import guid from "leisure-js/common/util";
|
|
186
|
+
import moment from "moment";
|
|
187
|
+
import LeUserSub from "./sub.vue";
|
|
188
|
+
import LeUserAdd from "./add.vue";
|
|
189
|
+
export default {
|
|
190
|
+
name: "le-user",
|
|
191
|
+
mixins: [leMixins],
|
|
192
|
+
components: {
|
|
193
|
+
LeUserSub,
|
|
194
|
+
LeUserAdd,
|
|
195
|
+
},
|
|
196
|
+
data() {
|
|
197
|
+
return {
|
|
198
|
+
resultData: [],
|
|
199
|
+
tableHeight: 200,
|
|
200
|
+
searchData: {
|
|
201
|
+
id: "",
|
|
202
|
+
pid: "",
|
|
203
|
+
membered: "",
|
|
204
|
+
account: "",
|
|
205
|
+
phone: "",
|
|
206
|
+
nick: "",
|
|
207
|
+
dataValue: [],
|
|
208
|
+
pageNo: 1,
|
|
209
|
+
total: 1,
|
|
210
|
+
},
|
|
211
|
+
userTypelsShow: true,
|
|
212
|
+
showYhj: false,
|
|
213
|
+
currentUser: {},
|
|
214
|
+
showEditUser: false,
|
|
215
|
+
showProductOrder: false,
|
|
216
|
+
showUserAdd: false,
|
|
217
|
+
uphone: "",
|
|
218
|
+
unionid: "",
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
mounted() {
|
|
222
|
+
this.list();
|
|
223
|
+
},
|
|
224
|
+
methods: {
|
|
225
|
+
guid,
|
|
226
|
+
openUploadDialog() {
|
|
227
|
+
// this.$refs.upDiaImagWindow.imgDialogPageIsOpen = true;
|
|
228
|
+
},
|
|
229
|
+
closeEditUser() {
|
|
230
|
+
this.showEditUser = false;
|
|
231
|
+
this.currentUser = {};
|
|
232
|
+
this.list();
|
|
233
|
+
},
|
|
234
|
+
openEditWindow(item) {
|
|
235
|
+
this.currentUser = item;
|
|
236
|
+
this.currentUser.forbid_login = Boolean(item.forbid_login ?? 0);
|
|
237
|
+
this.currentUser.is_place_order = Boolean(item.is_place_order ?? 0);
|
|
238
|
+
this.showEditUser = true;
|
|
239
|
+
},
|
|
240
|
+
resetPwd(row) {
|
|
241
|
+
//重置密码
|
|
242
|
+
let params = {
|
|
243
|
+
uid: row.id,
|
|
244
|
+
};
|
|
245
|
+
userChangePwd(params).then((res) => {
|
|
246
|
+
if (res.data.code == "10000") {
|
|
247
|
+
this.$message.success("密码重置成功");
|
|
248
|
+
} else {
|
|
249
|
+
this.$message.error(res.data.info);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
openOrder(row) {
|
|
254
|
+
this.uphone = row.phone;
|
|
255
|
+
this.unionid = row.unionid;
|
|
256
|
+
this.showProductOrder = true;
|
|
257
|
+
},
|
|
258
|
+
closeProductOrderDialog() {
|
|
259
|
+
this.showProductOrder = false;
|
|
260
|
+
this.uphone = "";
|
|
261
|
+
},
|
|
262
|
+
sendYhj(row) {
|
|
263
|
+
this.currentUser = row;
|
|
264
|
+
this.showYhj = true;
|
|
265
|
+
},
|
|
266
|
+
cancelShowYhj() {
|
|
267
|
+
this.showYhj = false;
|
|
268
|
+
this.currentUser = {};
|
|
269
|
+
},
|
|
270
|
+
addUser() {
|
|
271
|
+
this.showUserAdd = true;
|
|
272
|
+
},
|
|
273
|
+
closeUserAdd() {
|
|
274
|
+
this.showUserAdd = false;
|
|
275
|
+
},
|
|
276
|
+
// bindTypeText(item) {
|
|
277
|
+
// if (item.utype == this.userTypeDict[2].id) {
|
|
278
|
+
// return "取消分销员";
|
|
279
|
+
// } else {
|
|
280
|
+
// return "设置分销员";
|
|
281
|
+
// }
|
|
282
|
+
// },
|
|
283
|
+
// bindUserType(item) {
|
|
284
|
+
// //设置分销员
|
|
285
|
+
// let uid = item.id;
|
|
286
|
+
// let param = {};
|
|
287
|
+
// if (item.utype == this.userTypeDict[2].id) {
|
|
288
|
+
// //已经是分销员,则取消
|
|
289
|
+
// param.id = uid;
|
|
290
|
+
// param.utype = this.userTypeDict[3].id;
|
|
291
|
+
// param.utname = this.userTypeDict[3].name;
|
|
292
|
+
// edit(param).then((res) => {
|
|
293
|
+
// item.utype = this.userTypeDict[3].id;
|
|
294
|
+
// item.utname = this.userTypeDict[3].name;
|
|
295
|
+
// });
|
|
296
|
+
// } else {
|
|
297
|
+
// param.id = uid;
|
|
298
|
+
// param.utype = this.userTypeDict[2].id;
|
|
299
|
+
// param.utname = this.userTypeDict[2].name;
|
|
300
|
+
// edit(param).then((res) => {
|
|
301
|
+
// item.utype = this.userTypeDict[2].id;
|
|
302
|
+
// item.utname = this.userTypeDict[2].name;
|
|
303
|
+
// });
|
|
304
|
+
// }
|
|
305
|
+
// },
|
|
306
|
+
// getBindUserText(item) {
|
|
307
|
+
// if (item.forbid_login == 0) {
|
|
308
|
+
// return "禁止登录";
|
|
309
|
+
// } else if (item.forbid_login == 1) {
|
|
310
|
+
// return "允许登录";
|
|
311
|
+
// }
|
|
312
|
+
// },
|
|
313
|
+
// getDispLimitLoginText(item) {
|
|
314
|
+
// if (item.forbid_login == 0) {
|
|
315
|
+
// return "禁止登录";
|
|
316
|
+
// } else if (item.forbid_login == 1) {
|
|
317
|
+
// return "允许登录";
|
|
318
|
+
// }
|
|
319
|
+
// },
|
|
320
|
+
// getDispLimitSpeakText(item) {
|
|
321
|
+
// if (item.forbid_speak == 0) {
|
|
322
|
+
// return "禁止评论";
|
|
323
|
+
// } else if (item.forbid_speak == 1) {
|
|
324
|
+
// return "允许评论";
|
|
325
|
+
// }
|
|
326
|
+
// },
|
|
327
|
+
// getDispMemberText(item) {
|
|
328
|
+
// if (item.membered == 0) {
|
|
329
|
+
// return "设置会员";
|
|
330
|
+
// } else if (item.membered == 1) {
|
|
331
|
+
// return "取消会员";
|
|
332
|
+
// }
|
|
333
|
+
// },
|
|
334
|
+
list() {
|
|
335
|
+
let params = {};
|
|
336
|
+
|
|
337
|
+
if (this.searchData.account.length > 0) {
|
|
338
|
+
params.account = this.searchData.account;
|
|
339
|
+
}
|
|
340
|
+
if (this.searchData.phone.length > 0) {
|
|
341
|
+
params.phone = this.searchData.phone;
|
|
342
|
+
}
|
|
343
|
+
if (this.searchData.nick.length > 0) {
|
|
344
|
+
params.nick = this.searchData.nick;
|
|
345
|
+
}
|
|
346
|
+
if (this.searchData.dataValue[0]) {
|
|
347
|
+
params.startDate = this.searchData.dataValue[0] / 1000;
|
|
348
|
+
}
|
|
349
|
+
if (this.searchData.dataValue[1]) {
|
|
350
|
+
params.endDate = this.searchData.dataValue[1] / 1000;
|
|
351
|
+
}
|
|
352
|
+
if (this.searchData.membered && this.searchData.membered.length > 0) {
|
|
353
|
+
params.membered = this.searchData.membered;
|
|
354
|
+
}
|
|
355
|
+
if (this.searchData.id && this.searchData.id.length > 0) {
|
|
356
|
+
params.id = this.searchData.id;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
params.pageNo = this.searchData.pageNo;
|
|
360
|
+
userList(params).then((res) => {
|
|
361
|
+
this.resultData = res.data.data.list;
|
|
362
|
+
this.searchData.total = res.data.data.count;
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
del(id) {
|
|
366
|
+
userDel(id).then((response) => {
|
|
367
|
+
this.list();
|
|
368
|
+
this.$message.success(response.data.info);
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
current_change(currentPage) {
|
|
372
|
+
this.searchData.pageNo = currentPage;
|
|
373
|
+
this.list();
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
memberManager(item) {
|
|
377
|
+
let uid = item.id;
|
|
378
|
+
let param = {};
|
|
379
|
+
if (!item.membered || item.membered == 0) {
|
|
380
|
+
param.uid = uid;
|
|
381
|
+
open(param).then(() => {
|
|
382
|
+
item.membered = 1;
|
|
383
|
+
});
|
|
384
|
+
} else if (item.membered == 1) {
|
|
385
|
+
param.uid = uid;
|
|
386
|
+
close(param).then(() => {
|
|
387
|
+
item.membered = 0;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
|
|
392
|
+
dateFormat(row, column, data) {
|
|
393
|
+
return moment.unix(data).format("YYYY-MM-DD HH:mm");
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
</script>
|
|
398
|
+
<style lang="scss" scoped>
|
|
399
|
+
.avatar-uploader {
|
|
400
|
+
width: 100px;
|
|
401
|
+
border: 1px dashed #d9d9d9;
|
|
402
|
+
border-radius: 6px;
|
|
403
|
+
cursor: pointer;
|
|
404
|
+
position: relative;
|
|
405
|
+
overflow: hidden;
|
|
406
|
+
}
|
|
407
|
+
.avatar-uploader:hover {
|
|
408
|
+
border-color: #409eff;
|
|
409
|
+
}
|
|
410
|
+
.avatar-uploader-icon {
|
|
411
|
+
font-size: 28px;
|
|
412
|
+
color: #8c939d;
|
|
413
|
+
width: 100px;
|
|
414
|
+
height: 100px;
|
|
415
|
+
line-height: 100px;
|
|
416
|
+
text-align: center;
|
|
417
|
+
}
|
|
418
|
+
.avatar {
|
|
419
|
+
width: 100px;
|
|
420
|
+
height: 100px;
|
|
421
|
+
display: block;
|
|
422
|
+
}
|
|
423
|
+
</style>
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form
|
|
3
|
+
:model="ruleUserForm"
|
|
4
|
+
status-icon
|
|
5
|
+
:rules="userRules"
|
|
6
|
+
ref="ruleUserForm"
|
|
7
|
+
label-width="100px"
|
|
8
|
+
>
|
|
9
|
+
<el-form-item label="ID">
|
|
10
|
+
<el-input v-model="ruleUserForm.id" disabled></el-input>
|
|
11
|
+
</el-form-item>
|
|
12
|
+
<el-form-item label="上级ID" v-if="false">
|
|
13
|
+
<el-input v-model="ruleUserForm.pid"></el-input>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="账号">
|
|
16
|
+
<el-input v-model="ruleUserForm.account"></el-input>
|
|
17
|
+
</el-form-item>
|
|
18
|
+
<el-form-item label="登录ip">
|
|
19
|
+
<el-input v-model="ruleUserForm.lip" disabled></el-input>
|
|
20
|
+
</el-form-item>
|
|
21
|
+
<el-form-item label="昵称">
|
|
22
|
+
<el-input v-model="ruleUserForm.nick"></el-input>
|
|
23
|
+
</el-form-item>
|
|
24
|
+
<el-form-item label="手机号">
|
|
25
|
+
<el-input v-model="ruleUserForm.phone"></el-input>
|
|
26
|
+
</el-form-item>
|
|
27
|
+
<el-form-item label="头像" v-if="false">
|
|
28
|
+
<div class="avatar-uploader" @click="openUploadDialog">
|
|
29
|
+
<img
|
|
30
|
+
v-if="ruleUserForm.wx_url"
|
|
31
|
+
:src="ruleUserForm.wx_url"
|
|
32
|
+
class="avatar"
|
|
33
|
+
/>
|
|
34
|
+
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
35
|
+
</div>
|
|
36
|
+
<el-input v-model="ruleUserForm.wx_url" disabled></el-input>
|
|
37
|
+
</el-form-item>
|
|
38
|
+
<el-form-item label="后台用户">
|
|
39
|
+
<span v-if="ruleUserForm.managered == 0">否</span>
|
|
40
|
+
<span v-if="ruleUserForm.managered == 1">是</span>
|
|
41
|
+
</el-form-item>
|
|
42
|
+
<el-form-item label="用户身份" v-if="ruleUserForm.managered == 0">
|
|
43
|
+
<el-radio v-model="ruleUserForm.utype" :label="this.userTypeDict[3].code"
|
|
44
|
+
>散客</el-radio
|
|
45
|
+
>
|
|
46
|
+
<el-radio v-model="ruleUserForm.utype" :label="this.userTypeDict[2].code"
|
|
47
|
+
>分销员</el-radio
|
|
48
|
+
>
|
|
49
|
+
<el-radio v-model="ruleUserForm.utype" :label="this.userTypeDict[5].code"
|
|
50
|
+
>导游(个人)</el-radio
|
|
51
|
+
>
|
|
52
|
+
</el-form-item>
|
|
53
|
+
<el-form-item label="所属部门" v-if="ruleUserForm.utype == 2">
|
|
54
|
+
<el-select
|
|
55
|
+
v-model="ruleUserForm.depart_id"
|
|
56
|
+
@change="changeDepart"
|
|
57
|
+
placeholder="请选择"
|
|
58
|
+
clearable
|
|
59
|
+
>
|
|
60
|
+
<el-option
|
|
61
|
+
v-for="depart in departs"
|
|
62
|
+
:key="depart.id"
|
|
63
|
+
:label="depart.dname"
|
|
64
|
+
:value="depart.id"
|
|
65
|
+
>
|
|
66
|
+
</el-option>
|
|
67
|
+
</el-select>
|
|
68
|
+
</el-form-item>
|
|
69
|
+
<el-row v-if="ruleUserForm.managered == 0">
|
|
70
|
+
<el-col :span="12">
|
|
71
|
+
<el-form-item label="禁止登录">
|
|
72
|
+
<el-checkbox v-model="ruleUserForm.forbid_login"></el-checkbox>
|
|
73
|
+
</el-form-item>
|
|
74
|
+
</el-col>
|
|
75
|
+
<el-col :span="12">
|
|
76
|
+
<el-form-item label="是否能代下单">
|
|
77
|
+
<el-checkbox v-model="ruleUserForm.is_place_order"></el-checkbox>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
</el-col>
|
|
80
|
+
</el-row>
|
|
81
|
+
<el-form-item v-rfooter="'center'">
|
|
82
|
+
<el-button type="info" @click="close()">取消</el-button>
|
|
83
|
+
<le-button type="primary" text="保存" @click="save"></le-button>
|
|
84
|
+
</el-form-item>
|
|
85
|
+
</el-form>
|
|
86
|
+
</template>
|
|
87
|
+
<script>
|
|
88
|
+
import { edit } from "@/api/user";
|
|
89
|
+
import { departList } from "@/api/depart";
|
|
90
|
+
export default {
|
|
91
|
+
name: "le-user-sub",
|
|
92
|
+
props: {
|
|
93
|
+
currentUser: {
|
|
94
|
+
type: Object,
|
|
95
|
+
default: () => {},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
departs: [],
|
|
101
|
+
ruleUserForm: {
|
|
102
|
+
id: "",
|
|
103
|
+
wx_url: "",
|
|
104
|
+
nick: "",
|
|
105
|
+
lip: "",
|
|
106
|
+
managered: 0,
|
|
107
|
+
utype: "",
|
|
108
|
+
utname: "",
|
|
109
|
+
account: "",
|
|
110
|
+
phone: "",
|
|
111
|
+
forbid_login: 0, //是否禁止登录
|
|
112
|
+
is_place_order: 0, //是否是代下单用户
|
|
113
|
+
depart_id: "",
|
|
114
|
+
depart_name: "",
|
|
115
|
+
},
|
|
116
|
+
userRules: {
|
|
117
|
+
// account: [{ required: true, message: "请输入账号", trigger: "blur" }],
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
watch: {
|
|
122
|
+
currentUser: {
|
|
123
|
+
handler(newValue) {
|
|
124
|
+
this.ruleUserForm = newValue;
|
|
125
|
+
},
|
|
126
|
+
immediate: true,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
mounted() {
|
|
130
|
+
this.getDepartList();
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
openUploadDialog() {
|
|
134
|
+
// this.$refs.upDiaImagWindow.imgDialogPageIsOpen = true;
|
|
135
|
+
},
|
|
136
|
+
getDepartList() {
|
|
137
|
+
departList().then((res) => {
|
|
138
|
+
this.departs = res.data.data;
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
changeDepart(val) {
|
|
142
|
+
for (let i = 0; i < this.departs.length; i++) {
|
|
143
|
+
if (val == this.departs[i].id) {
|
|
144
|
+
this.ruleUserForm.depart_name = this.departs[i].dname;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
close() {
|
|
150
|
+
this.$emit("close");
|
|
151
|
+
},
|
|
152
|
+
save() {
|
|
153
|
+
let utype = this.ruleUserForm.utype;
|
|
154
|
+
let types = this.userTypeDict.filter((item) => {
|
|
155
|
+
return item.code == utype;
|
|
156
|
+
});
|
|
157
|
+
this.$refs["ruleUserForm"].validate((valid) => {
|
|
158
|
+
if (valid) {
|
|
159
|
+
let params = this.ruleUserForm;
|
|
160
|
+
params.utname = types[0].name;
|
|
161
|
+
params.forbid_login = Number(this.ruleUserForm.forbid_login);
|
|
162
|
+
params.is_place_order = Number(this.ruleUserForm.is_place_order);
|
|
163
|
+
if (
|
|
164
|
+
params.utype == this.userTypeDict[2].code &&
|
|
165
|
+
(params.account.length == 0 || params.account == params.id)
|
|
166
|
+
) {
|
|
167
|
+
this.$message.error("必须输入账号并且账号不能与id相同");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (
|
|
171
|
+
params.utype == this.userTypeDict[2].code &&
|
|
172
|
+
(!params.depart_id ||
|
|
173
|
+
params.depart_id.length == 0 ||
|
|
174
|
+
!params.depart_name ||
|
|
175
|
+
params.depart_name.length == 0)
|
|
176
|
+
) {
|
|
177
|
+
this.$message.error("必须选择部门");
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (
|
|
181
|
+
params.utype == this.userTypeDict[5].code &&
|
|
182
|
+
(!params.phone || params.phone.length == 0)
|
|
183
|
+
) {
|
|
184
|
+
this.$message.error("必须输入手机号");
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (
|
|
188
|
+
params.utype == this.userTypeDict[5].code &&
|
|
189
|
+
params.phone.length > 0
|
|
190
|
+
) {
|
|
191
|
+
if (
|
|
192
|
+
!params.account ||
|
|
193
|
+
(params.account && params.account.length >= 30)
|
|
194
|
+
)
|
|
195
|
+
params.account = params.phone;
|
|
196
|
+
}
|
|
197
|
+
edit(params).then((res) => {
|
|
198
|
+
if (res.data.code == "10000") {
|
|
199
|
+
this.$message.success("修改用户信息成功");
|
|
200
|
+
} else {
|
|
201
|
+
this.$message.error(res.data.info);
|
|
202
|
+
}
|
|
203
|
+
this.close();
|
|
204
|
+
});
|
|
205
|
+
} else {
|
|
206
|
+
console.log("error submit!!");
|
|
207
|
+
this.close();
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
</script>
|
|
214
|
+
<style lang="less"></style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-table :data="tableData" border row-key="code" stripe style="width: 100%">
|
|
3
|
+
<el-table-column prop="name" label="名称" width="180"> </el-table-column>
|
|
4
|
+
<el-table-column prop="note" label="备注"> </el-table-column>
|
|
5
|
+
</el-table>
|
|
6
|
+
</template>
|
|
7
|
+
<script>
|
|
8
|
+
import { list, del } from "@/api/user_type";
|
|
9
|
+
export default {
|
|
10
|
+
name:'le-user-type',
|
|
11
|
+
data() {
|
|
12
|
+
return {
|
|
13
|
+
tableData: [],
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
computed: {},
|
|
17
|
+
mounted() {
|
|
18
|
+
this.list();
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
list() {
|
|
22
|
+
list().then((res) => {
|
|
23
|
+
this.tableData = res.data.data;
|
|
24
|
+
this.tableData.forEach((item) => {
|
|
25
|
+
if (item.status == 0) {
|
|
26
|
+
item.status = "否";
|
|
27
|
+
} else item.status = "是";
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
del(id) {
|
|
32
|
+
del(id).then((response) => {
|
|
33
|
+
this.list();
|
|
34
|
+
this.$message.success(response.data.info);
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
</script>
|