|
@@ -94,7 +94,7 @@
|
|
|
width="540"
|
|
|
>
|
|
|
<el-form ref="form" :model="form" label-width="90px" class="user-from">
|
|
|
- <el-form-item label="用户姓名" class="mandatory" v-show="operRoleId">
|
|
|
+ <el-form-item label="用户姓名" class="mandatory" >
|
|
|
<el-input
|
|
|
v-model="editName"
|
|
|
placeholder="请输入"
|
|
@@ -119,6 +119,9 @@
|
|
|
<el-form-item label="用户角色" class="roleName mandatory">
|
|
|
<com-role v-model="newData.roleId" style="width: 100%" allText="请选择" hideAll :notDefault="true" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属架构:" v-if="user.roleKey == 'admin-hq'">
|
|
|
+ <com-select v-model="newData.deptId" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="用户账号" class="mandatory">
|
|
|
<el-input
|
|
|
v-model="newData.userName"
|
|
@@ -146,6 +149,7 @@ import comHead from "@/components/head";
|
|
|
import comCompany from "@/components/company-select";
|
|
|
import comPagination from "@/components/pagination";
|
|
|
import roleCompany from "@/components/role-select";
|
|
|
+import comSelect from "@/components/company-select";
|
|
|
import auth from "@/state/viewAuth";
|
|
|
import user from "@/state/user";
|
|
|
import axios from "axios";
|
|
@@ -153,7 +157,7 @@ import axios from "axios";
|
|
|
// import { PSW, PHONE } from "@/constant/REG";
|
|
|
import { ADMIN_USER_ID } from "@/constant";
|
|
|
|
|
|
-import { getUserList, updateUser, changeUserStatus,userAdd } from "@/request/config";
|
|
|
+import { getUserList, updateUser, changeUserStatus,userAdd,userEdit } from "@/request/config";
|
|
|
import { getApp } from "../../app";
|
|
|
|
|
|
export default {
|
|
@@ -209,6 +213,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async newSubmit(){
|
|
|
+ console.log('newSubmit',this.user,this.newData);
|
|
|
if (!this.newData.nickName) {
|
|
|
return this.$message.error("请输入用户姓名", "提示");
|
|
|
}
|
|
@@ -222,22 +227,32 @@ export default {
|
|
|
return this.$message.error("请输入登录密码", "提示");
|
|
|
}
|
|
|
await axios.post(userAdd, {
|
|
|
- ...this.newData
|
|
|
+ nickName:this.newData.nickName,
|
|
|
+ password:this.newData.psw,
|
|
|
+ userName:this.newData.userName,
|
|
|
+ roleId:this.newData.roleId,
|
|
|
+ deptId:this.newData.deptId
|
|
|
+ // ...this.newData
|
|
|
});
|
|
|
this.$message({message: '新增成功', type: 'success'});
|
|
|
// await this.$confirm('每个组织只能创建一个总管理员~', '新增用户')
|
|
|
- console.log('newData',this.newData)
|
|
|
+ this.newData = {}
|
|
|
+ this.newShow = false
|
|
|
+ this.dataList.refer();
|
|
|
},
|
|
|
async operItem() {
|
|
|
if (!this.editName) {
|
|
|
return this.$message.error("请输入用户名称", "提示");
|
|
|
}
|
|
|
console.log('state.oper',this.oper);
|
|
|
- await axios.post(userAdd, {
|
|
|
+ await axios.post(userEdit, {
|
|
|
id:this.oper.state.id,
|
|
|
nickName:this.editName,
|
|
|
});
|
|
|
this.$message({message: '编辑成功', type: 'success'});
|
|
|
+ this.oper.reset();
|
|
|
+ this.editName = ''
|
|
|
+ this.dataList.refer();
|
|
|
// const updatePhone = this.oper.state.__oldData
|
|
|
// ? this.oper.state.__oldData.userName !== this.oper.state.userName
|
|
|
// : true;
|
|
@@ -319,6 +334,7 @@ export default {
|
|
|
"com-company": comCompany,
|
|
|
"com-role": roleCompany,
|
|
|
"com-pagination": comPagination,
|
|
|
+ "com-select": comSelect
|
|
|
},
|
|
|
};
|
|
|
</script>
|