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

添加用户所属员工

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