|
@@ -26,7 +26,7 @@
|
|
placeholder="请选择组织架构"
|
|
placeholder="请选择组织架构"
|
|
v-model="ruleForm.group"
|
|
v-model="ruleForm.group"
|
|
:options="groupData"
|
|
:options="groupData"
|
|
- :show-all-levels="false"
|
|
|
|
|
|
+ :show-all-levels="false"
|
|
clearable
|
|
clearable
|
|
></el-cascader>
|
|
></el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -48,15 +48,15 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
-
|
|
|
|
- <el-form-item v-if="isView" label="密码" prop="password">
|
|
|
|
|
|
+
|
|
|
|
+ <el-form-item v-if="isView" label="密码" prop="password">
|
|
<el-input
|
|
<el-input
|
|
type="password"
|
|
type="password"
|
|
v-model="ruleForm.password"
|
|
v-model="ruleForm.password"
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item v-if="isView" label="确认密码" prop="comPassword">
|
|
|
|
|
|
+ <el-form-item v-if="isView" label="确认密码" prop="comPassword">
|
|
<el-input
|
|
<el-input
|
|
type="password"
|
|
type="password"
|
|
v-model="ruleForm.comPassword"
|
|
v-model="ruleForm.comPassword"
|
|
@@ -68,9 +68,7 @@
|
|
<!-- <el-button type="success" round @click="submitForm('ruleForm')"
|
|
<!-- <el-button type="success" round @click="submitForm('ruleForm')"
|
|
>提交</el-button
|
|
>提交</el-button
|
|
> -->
|
|
> -->
|
|
- <el-button type="success" round @click="submitCom()"
|
|
|
|
- >提交</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button type="success" round @click="submitCom()">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -116,8 +114,9 @@ export default {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
return {
|
|
return {
|
|
|
|
+ userInfo: "",
|
|
//编辑返回的值
|
|
//编辑返回的值
|
|
- userDetailData:{},
|
|
|
|
|
|
+ userDetailData: {},
|
|
//组织架构名字
|
|
//组织架构名字
|
|
groupName: "",
|
|
groupName: "",
|
|
ppData: [],
|
|
ppData: [],
|
|
@@ -166,16 +165,11 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- let userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
|
|
|
|
- this.ruleForm.parentCode = userInfo.invitationCode;
|
|
|
|
-
|
|
|
|
//获取渠道信息
|
|
//获取渠道信息
|
|
-
|
|
|
|
// this.ruleForm.type = "3";
|
|
// this.ruleForm.type = "3";
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
- resetData(){
|
|
|
|
|
|
+ resetData() {
|
|
this.$refs["ruleForm"].clearValidate();
|
|
this.$refs["ruleForm"].clearValidate();
|
|
//清空表单
|
|
//清空表单
|
|
this.ruleForm.group = "";
|
|
this.ruleForm.group = "";
|
|
@@ -190,7 +184,6 @@ export default {
|
|
this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
|
|
this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
|
|
// this.$toast.success({message:'成功'});
|
|
// this.$toast.success({message:'成功'});
|
|
if (res && res.code == 200) {
|
|
if (res && res.code == 200) {
|
|
-
|
|
|
|
//将值赋值给list
|
|
//将值赋值给list
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
let resAdd = this.addPro(res.data);
|
|
let resAdd = this.addPro(res.data);
|
|
@@ -199,8 +192,6 @@ export default {
|
|
// console.log('格式化的结构')
|
|
// console.log('格式化的结构')
|
|
// console.log(forRes)
|
|
// console.log(forRes)
|
|
let resultRes = this.deleteChildren(forRes);
|
|
let resultRes = this.deleteChildren(forRes);
|
|
- console.log("格式化的结构且去掉children");
|
|
|
|
- console.log(resultRes);
|
|
|
|
this.groupData = resultRes;
|
|
this.groupData = resultRes;
|
|
} else {
|
|
} else {
|
|
this.groupData = [];
|
|
this.groupData = [];
|
|
@@ -222,12 +213,20 @@ export default {
|
|
},
|
|
},
|
|
//非递归方式:将平铺数据转换为树形结构数据
|
|
//非递归方式:将平铺数据转换为树形结构数据
|
|
arrToTree(arr) {
|
|
arrToTree(arr) {
|
|
|
|
+ console.log("arr----");
|
|
|
|
+ console.log(arr);
|
|
|
|
+ console.log(this.userInfo);
|
|
|
|
+ console.log(this.userInfo.orgNo);
|
|
let data = arr.filter((item) => {
|
|
let data = arr.filter((item) => {
|
|
item.children = arr.filter((e) => {
|
|
item.children = arr.filter((e) => {
|
|
return item.orgNo === e.parentOrgNo;
|
|
return item.orgNo === e.parentOrgNo;
|
|
});
|
|
});
|
|
- return !item.parentOrgNo;
|
|
|
|
|
|
+
|
|
|
|
+ return this.userInfo.orgNo == item.orgNo;
|
|
|
|
+ //return !item.parentOrgNo;
|
|
});
|
|
});
|
|
|
|
+ console.log("data------");
|
|
|
|
+ console.log(data);
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|
|
//去除转换树形结构数据后存在的空children
|
|
//去除转换树形结构数据后存在的空children
|
|
@@ -246,7 +245,7 @@ export default {
|
|
},
|
|
},
|
|
queryOrgName() {
|
|
queryOrgName() {
|
|
for (let i = 0; i < this.ppData.length; i++) {
|
|
for (let i = 0; i < this.ppData.length; i++) {
|
|
- if (this.ruleForm.group[this.ruleForm.group.length-1] == this.ppData[i].orgNo) {
|
|
|
|
|
|
+ if (this.ruleForm.group[this.ruleForm.group.length - 1] == this.ppData[i].orgNo) {
|
|
this.groupName = this.ppData[i].orgName;
|
|
this.groupName = this.ppData[i].orgName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -275,9 +274,9 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
open(val) {
|
|
open(val) {
|
|
- this.cancle();
|
|
|
|
|
|
+ this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
|
|
|
|
+ this.cancle();
|
|
this.getChannel();
|
|
this.getChannel();
|
|
-
|
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
this.isView = val;
|
|
this.isView = val;
|
|
|
|
|
|
@@ -286,45 +285,47 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
edit(val) {
|
|
edit(val) {
|
|
- debugger;
|
|
|
|
|
|
+ this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
|
|
this.getChannel();
|
|
this.getChannel();
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
this.isView = false;
|
|
this.isView = false;
|
|
- this.queryUserDetail(val.id)
|
|
|
|
|
|
+ this.queryUserDetail(val.id);
|
|
//调用查询详情的接口
|
|
//调用查询详情的接口
|
|
},
|
|
},
|
|
//调用查询详情的接口
|
|
//调用查询详情的接口
|
|
- queryUserDetail(val){
|
|
|
|
- let url = `/user/findUserById?id=${val}`
|
|
|
|
-
|
|
|
|
- this.$http.get(url,
|
|
|
|
- {
|
|
|
|
- },
|
|
|
|
- (res) => {
|
|
|
|
-
|
|
|
|
- console.log(res)
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
- //获取返回值
|
|
|
|
- //根据将数据存储
|
|
|
|
- this.userDetailData=res.data;
|
|
|
|
- let a =[]
|
|
|
|
- for(let i=res.data.orgList.length;i>0;i--){
|
|
|
|
- //
|
|
|
|
- a.push(res.data.orgList[i-1].orgNo)
|
|
|
|
- }
|
|
|
|
- //回显学号
|
|
|
|
- this.ruleForm.studentNumber=res.data.userNo;
|
|
|
|
- //回显姓名
|
|
|
|
- this.ruleForm.name=res.data.userName
|
|
|
|
- //回显性别
|
|
|
|
- this.ruleForm.sex=res.data.gender
|
|
|
|
- this.ruleForm.group=a;
|
|
|
|
- } else {
|
|
|
|
- // this.$toast.fail(res.msg);
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
- }
|
|
|
|
|
|
+ queryUserDetail(val) {
|
|
|
|
+ let url = `/user/findUserById?id=${val}`;
|
|
|
|
+
|
|
|
|
+ this.$http.get(url, {}, (res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res && res.code == 200) {
|
|
|
|
+ //获取返回值
|
|
|
|
+ //根据将数据存储
|
|
|
|
+ this.userDetailData = res.data;
|
|
|
|
+ let a = [];
|
|
|
|
+ a.push(this.userInfo.orgNo);
|
|
|
|
+ a.push(res.data.orgNo);
|
|
|
|
+
|
|
|
|
+ console.log("a------------------");
|
|
|
|
+ console.log(a);
|
|
|
|
+ // debugger;
|
|
|
|
+ // for (let i = res.data.orgList.length; i > 0; i--) {
|
|
|
|
+ // //
|
|
|
|
+ // a.push(res.data.orgList[i - 1].orgNo);
|
|
|
|
+ // }
|
|
|
|
+ //回显学号
|
|
|
|
+ this.ruleForm.studentNumber = res.data.userNo;
|
|
|
|
+ //回显姓名
|
|
|
|
+ this.ruleForm.name = res.data.userName;
|
|
|
|
+ //回显性别
|
|
|
|
+ this.ruleForm.sex = res.data.gender;
|
|
|
|
+ //
|
|
|
|
+ this.ruleForm.group = a;
|
|
|
|
+ } else {
|
|
|
|
+ // this.$toast.fail(res.msg);
|
|
|
|
+ this.$message.error(res.msg);
|
|
}
|
|
}
|
|
- );
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
cancle() {
|
|
cancle() {
|
|
this.$refs["ruleForm"].clearValidate();
|
|
this.$refs["ruleForm"].clearValidate();
|
|
@@ -380,30 +381,36 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
register() {
|
|
register() {
|
|
|
|
+ if (this.ruleForm.group.length == 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "请选择专业节点",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.queryOrgName();
|
|
this.queryOrgName();
|
|
-
|
|
|
|
- console.log( this.ruleForm.group)
|
|
|
|
|
|
+
|
|
|
|
+ console.log(this.ruleForm.group);
|
|
let that = this;
|
|
let that = this;
|
|
// this.ruleForm.password = md5(this.ruleForm.password);
|
|
// this.ruleForm.password = md5(this.ruleForm.password);
|
|
this.$http.post(
|
|
this.$http.post(
|
|
`/user/addOrUpdateUser`,
|
|
`/user/addOrUpdateUser`,
|
|
{
|
|
{
|
|
- orgNo:this.ruleForm.group[this.ruleForm.group.length-1] ,
|
|
|
|
|
|
+ orgNo: this.ruleForm.group[this.ruleForm.group.length - 1],
|
|
orgName: this.groupName,
|
|
orgName: this.groupName,
|
|
userNo: this.ruleForm.studentNumber,
|
|
userNo: this.ruleForm.studentNumber,
|
|
userName: this.ruleForm.name,
|
|
userName: this.ruleForm.name,
|
|
gender: this.ruleForm.sex,
|
|
gender: this.ruleForm.sex,
|
|
password: md5(this.ruleForm.password),
|
|
password: md5(this.ruleForm.password),
|
|
//roleType 1普通用户 roleType 管理员
|
|
//roleType 1普通用户 roleType 管理员
|
|
- roleType:'1'
|
|
|
|
|
|
+ roleType: "1",
|
|
},
|
|
},
|
|
(res) => {
|
|
(res) => {
|
|
-
|
|
|
|
this.disableFlagStatus();
|
|
this.disableFlagStatus();
|
|
// this.disableFlag = false;
|
|
// this.disableFlag = false;
|
|
if (res && res.code == 200) {
|
|
if (res && res.code == 200) {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
-
|
|
|
|
|
|
+
|
|
// this.$toast.success({ message: "成功" });
|
|
// this.$toast.success({ message: "成功" });
|
|
//调用父组件的查询方法
|
|
//调用父组件的查询方法
|
|
that.$emit("search");
|
|
that.$emit("search");
|
|
@@ -417,18 +424,17 @@ export default {
|
|
);
|
|
);
|
|
},
|
|
},
|
|
editUserFun() {
|
|
editUserFun() {
|
|
-
|
|
|
|
let that = this;
|
|
let that = this;
|
|
this.queryOrgName();
|
|
this.queryOrgName();
|
|
- this.userDetailData.orgNo=this.ruleForm.group[this.ruleForm.group.length-1];
|
|
|
|
- this.userDetailData.orgName=this.groupName;
|
|
|
|
- this.userDetailData.userName= this.ruleForm.name;
|
|
|
|
- this.userDetailData.gender= this.ruleForm.sex;
|
|
|
|
- this.userDetailData.userNo= this.ruleForm.studentNumber;
|
|
|
|
|
|
+ this.userDetailData.orgNo = this.ruleForm.group[this.ruleForm.group.length - 1];
|
|
|
|
+ this.userDetailData.orgName = this.groupName;
|
|
|
|
+ this.userDetailData.userName = this.ruleForm.name;
|
|
|
|
+ this.userDetailData.gender = this.ruleForm.sex;
|
|
|
|
+ this.userDetailData.userNo = this.ruleForm.studentNumber;
|
|
this.$http.post(
|
|
this.$http.post(
|
|
- `/user/addOrUpdateUser`,
|
|
|
|
|
|
+ `/user/addOrUpdateUser`,
|
|
{
|
|
{
|
|
- ...this.userDetailData
|
|
|
|
|
|
+ ...this.userDetailData,
|
|
},
|
|
},
|
|
(res) => {
|
|
(res) => {
|
|
this.disableFlagStatus();
|
|
this.disableFlagStatus();
|