Commit 35870687 authored by 赵啸非's avatar 赵啸非

添加用户所属员工

parent 6da7355c
......@@ -54,7 +54,6 @@ export default {
el.validate((valid) => {
if (!valid) return;
this.loading = true;
console.log("提交了");
this.$post(
this.urls.saveUrl || this.pageInfo.saveUrl,
this.beforeSubmit(this.form)
......
......@@ -75,7 +75,7 @@
:title="userPasswordDialog.title"
hei
:visible.sync="userPasswordDialog.open"
width="60%"
width="40%"
>
<el-form
ref="form"
......@@ -91,8 +91,10 @@
v-model="userPasswordDialog.data.loginName"
/>
<Field
label="登录密码"
:span="20"
label="重置密码"
prop="loginPwd"
v-model="userPasswordDialog.data.loginPwd"
/>
......@@ -108,9 +110,8 @@
<el-dialog
:title="userLoginDialog.title"
hei
:visible.sync="userLoginDialog.open"
width="60%"
width="40%"
>
<el-form
ref="form"
......@@ -118,11 +119,19 @@
label-position="right"
>
<el-row>
<Field
:span="20"
label="登录名称"
prop="loginName"
v-model="userPasswordDialog.data.loginName"
disabled
v-model="userLoginDialog.data.sourceloginName"
/>
<Field
:span="20"
label="修改登录名称"
prop="loginName"
v-model="userLoginDialog.data.loginName"
/>
</el-row>
</el-form>
......@@ -235,29 +244,29 @@ export default {
async distributeDept(row) {
console.log("分配部门");
try {
this.tableData.loading = true;
this.userDeptDialog.data = row;
this.$nextTick(() => {
this.$get("/dept/getListByParentId", {
parentId: 0,
}).then(({data}) => {
this.data = data.result;
this.node = {};
console.log("data", this.data);
});
this.userDeptDialog.open = true;
this.tableData.loading = true;
this.userDeptDialog.data = row;
this.$nextTick(() => {
this.$get("/dept/getListByParentId", {
parentId: 0,
}).then(({data}) => {
this.data = data.result;
this.node = {};
});
} catch (error) {
this.userDeptDialog.open = true;
}).catch(error => {
this.$message.error(error.message);
}
})
this.tableData.loading = false;
},
updatePassword(row) {
console.log("修改密码");
try {
this.userPasswordDialog.data = row;
const dataCopy = Object.assign({}, row);
this.userPasswordDialog.data = dataCopy;
this.userPasswordDialog.data.loginPwd = "";
this.userPasswordDialog.open = true;
} catch (error) {
......@@ -267,55 +276,59 @@ export default {
updatePasswordConfirm() {
console.log("修改密码");
try {
this.$post("/user/save", {
"id": userPasswordDialog.data.id,
"loginPwd": userPasswordDialog.data.loginPwd,
}).then((res) => {
if (res && res.code == 1) {
this.userPasswordDialog.data = {};
this.$message.success("修改密码成功!");
} else {
this.$message.error(res.message);
}
this.userRoleDialog.open = false;
})
} catch (error) {
this.tableData.loading = true;
this.$post("/user/save", {
"id": this.userPasswordDialog.data.id,
"loginPwd": this.userPasswordDialog.data.loginPwd,
}).then((res) => {
if (res && res.code == 1) {
this.userPasswordDialog.data = {};
this.$message.success("修改密码成功!");
this.getData();
this.userPasswordDialog.open = false;
} else {
this.$message.error(res.msg);
}
this.tableData.loading = false;
}).catch(error => {
this.$message.error(error.message);
}
})
},
updateLoginName(row) {
console.log("修改登录名");
try {
this.userLoginDialog.data = row;
const dataCopy = Object.assign({}, row);
this.userLoginDialog.data = dataCopy;
this.userLoginDialog.data.sourceloginName = dataCopy.loginName;
this.userLoginDialog.data.loginName = "";
this.userLoginDialog.open = true;
} catch (error) {
this.$message.error(error.message);
this.$message.error(error.msg);
}
},
updateLoginConfirm() {
console.log("修改登录名");
try {
this.$post("/user/save", {
"id": user.data.id,
"loginName": userLoginDialog.data.loginName,
}).then((res) => {
if (res && res.code == 1) {
this.userLoginDialog.data = {};
this.$message.success("修改登录名成功!");
} else {
this.$message.error(res.message);
}
this.tableData.loading = true;
this.$post("/login/reLoginName", {
"id": this.userLoginDialog.data.id,
"loginName": this.userLoginDialog.data.loginName,
"userType": this.userLoginDialog.data.userType
}).then((res) => {
if (res && res.code == 1) {
this.userLoginDialog.data = {};
this.$message.success("修改登录名成功!");
this.getData();
this.userLoginDialog.open = false;
})
} catch (error) {
} else {
this.$message.error(res.msg);
}
this.tableData.loading = false;
}).catch(error => {
this.$message.error(error.message);
}
})
},
// 获取用户角色列表
......
......@@ -217,13 +217,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
Long id = userEntity.getId();
String loginName = userEntity.getLoginName();
Integer userType = userEntity.getUserType();
if (ObjectUtils.isEmpty(userEntity.getId())) {
throw new AppException("修改的用户id不能为空");
}
if (ObjectUtils.isEmpty(loginName)) {
throw new AppException("修改的登录名不能空!");
throw new AppException("修改的登录名不能空!");
}
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment