|
@@ -372,7 +372,7 @@
|
|
|
</el-row>
|
|
|
<el-row
|
|
|
v-if="
|
|
|
- roleOptions.filter(item => {
|
|
|
+ roleOptions.filter((item) => {
|
|
|
return (
|
|
|
item.roleName === '代理商' && form.roleIds.includes(item.roleId)
|
|
|
);
|
|
@@ -407,6 +407,25 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row
|
|
|
+ v-if="
|
|
|
+ roleOptions.filter((item) => {
|
|
|
+ return (
|
|
|
+ item.roleName === '驾校' && form.roleIds.includes(item.roleId)
|
|
|
+ );
|
|
|
+ }).length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="推荐码">
|
|
|
+ <el-input
|
|
|
+ v-model="form.referralCode"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入推荐码"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="备注">
|
|
@@ -453,11 +472,11 @@
|
|
|
<el-checkbox
|
|
|
v-model="upload.updateSupport"
|
|
|
/>是否更新已经存在的用户数据
|
|
|
- <el-link type="info" style="font-size:12px" @click="importTemplate"
|
|
|
+ <el-link type="info" style="font-size: 12px" @click="importTemplate"
|
|
|
>下载模板</el-link
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="el-upload__tip" style="color:red" slot="tip">
|
|
|
+ <div class="el-upload__tip" style="color: red" slot="tip">
|
|
|
提示:仅允许导入“xls”或“xlsx”格式文件!
|
|
|
</div>
|
|
|
</el-upload>
|
|
@@ -479,7 +498,7 @@ import {
|
|
|
exportUser,
|
|
|
resetUserPwd,
|
|
|
changeUserStatus,
|
|
|
- importTemplate
|
|
|
+ importTemplate,
|
|
|
} from "@/api/system/user";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
@@ -529,7 +548,7 @@ export default {
|
|
|
form: {},
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
- label: "label"
|
|
|
+ label: "label",
|
|
|
},
|
|
|
// 用户导入参数
|
|
|
upload: {
|
|
@@ -544,7 +563,7 @@ export default {
|
|
|
// 设置上传的请求头部
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
// 上传的地址
|
|
|
- url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
|
|
},
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
@@ -553,56 +572,56 @@ export default {
|
|
|
userName: undefined,
|
|
|
phonenumber: undefined,
|
|
|
status: undefined,
|
|
|
- deptId: undefined
|
|
|
+ deptId: undefined,
|
|
|
},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
userName: [
|
|
|
- { required: true, message: "用户名称不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "用户名称不能为空", trigger: "blur" },
|
|
|
],
|
|
|
nickName: [
|
|
|
- { required: true, message: "用户昵称不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "用户昵称不能为空", trigger: "blur" },
|
|
|
],
|
|
|
deptId: [
|
|
|
- { required: true, message: "归属部门不能为空", trigger: "change" }
|
|
|
+ { required: true, message: "归属部门不能为空", trigger: "change" },
|
|
|
],
|
|
|
password: [
|
|
|
- { required: true, message: "用户密码不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
|
],
|
|
|
email: [
|
|
|
{
|
|
|
type: "email",
|
|
|
message: "'请输入正确的邮箱地址",
|
|
|
- trigger: ["blur", "change"]
|
|
|
- }
|
|
|
+ trigger: ["blur", "change"],
|
|
|
+ },
|
|
|
],
|
|
|
phonenumber: [
|
|
|
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
|
|
{
|
|
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
message: "请输入正确的手机号码",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
// 根据名称筛选部门树
|
|
|
deptName(val) {
|
|
|
this.$refs.tree.filter(val);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.getTreeselect();
|
|
|
- this.getDicts("sys_normal_disable").then(response => {
|
|
|
+ this.getDicts("sys_normal_disable").then((response) => {
|
|
|
this.statusOptions = response.data;
|
|
|
});
|
|
|
- this.getDicts("sys_user_sex").then(response => {
|
|
|
+ this.getDicts("sys_user_sex").then((response) => {
|
|
|
this.sexOptions = response.data;
|
|
|
});
|
|
|
- this.getConfigKey("sys.user.initPassword").then(response => {
|
|
|
+ this.getConfigKey("sys.user.initPassword").then((response) => {
|
|
|
this.initPassword = response.msg;
|
|
|
});
|
|
|
},
|
|
@@ -611,7 +630,7 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
|
|
|
- response => {
|
|
|
+ (response) => {
|
|
|
this.userList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
@@ -620,7 +639,7 @@ export default {
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
|
- treeselect().then(response => {
|
|
|
+ treeselect().then((response) => {
|
|
|
this.deptOptions = response.data;
|
|
|
});
|
|
|
},
|
|
@@ -643,16 +662,16 @@ export default {
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
}
|
|
|
)
|
|
|
- .then(function() {
|
|
|
+ .then(function () {
|
|
|
return changeUserStatus(row.userId, row.status);
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.msgSuccess(text + "成功");
|
|
|
})
|
|
|
- .catch(function() {
|
|
|
+ .catch(function () {
|
|
|
row.status = row.status === "0" ? "1" : "0";
|
|
|
});
|
|
|
},
|
|
@@ -675,7 +694,7 @@ export default {
|
|
|
status: "0",
|
|
|
remark: undefined,
|
|
|
postIds: [],
|
|
|
- roleIds: []
|
|
|
+ roleIds: [],
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -692,7 +711,7 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.userId);
|
|
|
+ this.ids = selection.map((item) => item.userId);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -700,7 +719,7 @@ export default {
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
this.getTreeselect();
|
|
|
- getUser().then(response => {
|
|
|
+ getUser().then((response) => {
|
|
|
this.postOptions = response.data.posts;
|
|
|
this.roleOptions = response.data.roles;
|
|
|
this.open = true;
|
|
@@ -713,7 +732,7 @@ export default {
|
|
|
this.reset();
|
|
|
this.getTreeselect();
|
|
|
const userId = row.userId || this.ids;
|
|
|
- getUser(userId).then(response => {
|
|
|
+ getUser(userId).then((response) => {
|
|
|
this.form = response.data.user;
|
|
|
this.postOptions = response.data.posts;
|
|
|
this.roleOptions = response.data.roles;
|
|
@@ -728,27 +747,27 @@ export default {
|
|
|
handleResetPwd(row) {
|
|
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消"
|
|
|
+ cancelButtonText: "取消",
|
|
|
})
|
|
|
.then(({ value }) => {
|
|
|
- resetUserPwd(row.userId, value).then(response => {
|
|
|
+ resetUserPwd(row.userId, value).then((response) => {
|
|
|
this.msgSuccess("修改成功,新密码是:" + value);
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ submitForm: function () {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.userId != undefined) {
|
|
|
- updateUser(this.form).then(response => {
|
|
|
+ updateUser(this.form).then((response) => {
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addUser(this.form).then(response => {
|
|
|
+ addUser(this.form).then((response) => {
|
|
|
this.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -766,10 +785,10 @@ export default {
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
}
|
|
|
)
|
|
|
- .then(function() {
|
|
|
+ .then(function () {
|
|
|
return delUser(userIds);
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -783,12 +802,12 @@ export default {
|
|
|
this.$confirm("是否确认导出所有用户数据项?", "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
- .then(function() {
|
|
|
+ .then(function () {
|
|
|
return exportUser(queryParams);
|
|
|
})
|
|
|
- .then(response => {
|
|
|
+ .then((response) => {
|
|
|
this.download(response.data);
|
|
|
});
|
|
|
},
|
|
@@ -799,7 +818,7 @@ export default {
|
|
|
},
|
|
|
/** 下载模板操作 */
|
|
|
importTemplate() {
|
|
|
- importTemplate().then(response => {
|
|
|
+ importTemplate().then((response) => {
|
|
|
this.download(response.data);
|
|
|
});
|
|
|
},
|
|
@@ -818,7 +837,7 @@ export default {
|
|
|
// 提交上传文件
|
|
|
submitFileForm() {
|
|
|
this.$refs.upload.submit();
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|