|
@@ -57,25 +57,26 @@
|
|
|
clearable
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="所属届" prop="grade">
|
|
|
+ <el-form-item label="职务" prop="position">
|
|
|
<el-select
|
|
|
- v-model="ruleForm.grade"
|
|
|
+ v-model="ruleForm.position"
|
|
|
clearable
|
|
|
- placeholder="请选择所属届"
|
|
|
+ placeholder="请选择职务"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in gradeOption"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in listOption"
|
|
|
+ :key="item.paramValue"
|
|
|
+ :label="item.paramName"
|
|
|
+ :value="item.paramValue"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="学号" prop="studentNumber">
|
|
|
<el-input v-model="ruleForm.studentNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="姓名" prop="name">
|
|
@@ -91,26 +92,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <!-- <el-form-item v-if="isView" label="密码" prop="password">
|
|
|
- <el-input
|
|
|
- type="password"
|
|
|
- v-model="ruleForm.password"
|
|
|
- autocomplete="off"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="isView" label="确认密码" prop="comPassword">
|
|
|
- <el-input
|
|
|
- type="password"
|
|
|
- v-model="ruleForm.comPassword"
|
|
|
- autocomplete="off"
|
|
|
- ></el-input>
|
|
|
- </el-form-item> -->
|
|
|
<div class="dig_button">
|
|
|
<el-button type="info" round @click="resetData()">清空</el-button>
|
|
|
- <!-- <el-button type="success" round @click="submitForm('ruleForm')"
|
|
|
- >提交</el-button
|
|
|
- > -->
|
|
|
<el-button type="success" round @click="submitCom()">提交</el-button>
|
|
|
</div>
|
|
|
</el-form>
|
|
@@ -188,6 +171,7 @@ export default {
|
|
|
//渠道列表
|
|
|
channelList: [{ name: "渠道天成", id: "1" }],
|
|
|
ruleForm: {
|
|
|
+ position: "",
|
|
|
//所属组织架构
|
|
|
group: "",
|
|
|
group3: "",
|
|
@@ -206,7 +190,9 @@ export default {
|
|
|
isView: true,
|
|
|
rules: {
|
|
|
group: [{ required: true, message: "请选择组织架构", trigger: "change" }],
|
|
|
+
|
|
|
group3: [{ required: true, message: "请选择组织架构", trigger: "change" }],
|
|
|
+ position: [{ required: true, message: "请选择职务", trigger: "change" }],
|
|
|
studentNumber: [{ required: true, message: "请输入学号", trigger: "blur" }],
|
|
|
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
|
|
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
|
@@ -215,6 +201,7 @@ export default {
|
|
|
// password: [{ required: true, validator: validatePass, trigger: "blur" }],
|
|
|
// comPassword: [{ required: true, validator: validateComPass, trigger: "blur" }],
|
|
|
},
|
|
|
+ listOption: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -222,6 +209,20 @@ export default {
|
|
|
// this.ruleForm.type = "3";
|
|
|
},
|
|
|
methods: {
|
|
|
+ getPotion() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let url = `/param/findAllByType?type=1`;
|
|
|
+ this.$http.get(url, {}, (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.listOption = res.data;
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ this.message.error(res.msg);
|
|
|
+ reject();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
//获取辅导员组织架构方法
|
|
|
getInstructor() {
|
|
|
this.options3 = [];
|
|
@@ -294,7 +295,10 @@ export default {
|
|
|
// console.log(forRes)
|
|
|
let resultRes = this.deleteChildren(forRes);
|
|
|
|
|
|
- this.groupData = resultRes[0].children;
|
|
|
+ let list = resultRes[0].children;
|
|
|
+ this.groupData = list.filter((item) => {
|
|
|
+ return item.extend != -1;
|
|
|
+ });
|
|
|
} else {
|
|
|
this.groupData = [];
|
|
|
}
|
|
@@ -380,7 +384,7 @@ export default {
|
|
|
},
|
|
|
open(val) {
|
|
|
this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
|
|
|
-
|
|
|
+ this.getPotion();
|
|
|
this.getGradeFun();
|
|
|
this.cancle();
|
|
|
|
|
@@ -397,7 +401,9 @@ export default {
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
});
|
|
|
},
|
|
|
- edit(val) {
|
|
|
+ async edit(val) {
|
|
|
+ this.ruleForm.position = "";
|
|
|
+ await this.getPotion();
|
|
|
this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
|
|
|
if (this.userInfo.roleType == "3") {
|
|
|
this.getInstructor();
|
|
@@ -413,43 +419,19 @@ export default {
|
|
|
//调用查询详情的接口
|
|
|
queryUserDetail(val) {
|
|
|
let url = `/user/findUserById?id=${val}`;
|
|
|
-
|
|
|
this.$http.get(url, {}, (res) => {
|
|
|
if (res && res.code == 200) {
|
|
|
//获取返回值
|
|
|
//根据将数据存储
|
|
|
this.userDetailData = res.data;
|
|
|
let a = [];
|
|
|
-
|
|
|
- //当角色等于2时
|
|
|
- // if (this.userInfo.roleType == "2") {
|
|
|
- // //
|
|
|
-
|
|
|
- // a.push(res.data.orgNo);
|
|
|
- // }
|
|
|
- // //当角色等于1时
|
|
|
- // if (this.userInfo.roleType == "3") {
|
|
|
- // for (let i = 0; i < res.data.orgList.length; i++) {
|
|
|
- // if (i < 2) {
|
|
|
- // a.push(res.data.orgList[i].orgNo);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // a.push(this.userInfo.orgNo);
|
|
|
- // a.push(res.data.orgNo);
|
|
|
- //判断用户登录类型
|
|
|
- // 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.position = res.data.position + "";
|
|
|
if (this.userInfo.roleType == "3") {
|
|
|
this.ruleForm.group3 = res.data.orgNo;
|
|
|
} else if (this.userInfo.roleType == "4") {
|
|
@@ -471,6 +453,7 @@ export default {
|
|
|
this.ruleForm.group3 = "";
|
|
|
this.ruleForm.group = "";
|
|
|
this.ruleForm.name = "";
|
|
|
+ this.ruleForm.position = "";
|
|
|
this.ruleForm.studentNumber = "";
|
|
|
// this.ruleForm.password = "";
|
|
|
// this.ruleForm.comPassword = "";
|
|
@@ -490,15 +473,15 @@ export default {
|
|
|
let validSp = [];
|
|
|
if (this.isView) {
|
|
|
if (this.userInfo.roleType == "3") {
|
|
|
- validSp = ["group3", "studentNumber", "name", "sex"];
|
|
|
+ validSp = ["group3", "studentNumber", "position", "name", "sex"];
|
|
|
} else if (this.userInfo.roleType == "4") {
|
|
|
- validSp = ["group", "studentNumber", "name", "sex"];
|
|
|
+ validSp = ["group", "studentNumber", "position", "name", "sex"];
|
|
|
}
|
|
|
} else {
|
|
|
if (this.userInfo.roleType == "3") {
|
|
|
- validSp = ["group3", "studentNumber", "name", "sex"];
|
|
|
+ validSp = ["group3", "studentNumber", "position", "name", "sex"];
|
|
|
} else if (this.userInfo.roleType == "4") {
|
|
|
- validSp = ["group", "studentNumber", "name", "sex"];
|
|
|
+ validSp = ["group", "studentNumber", "position", "name", "sex"];
|
|
|
}
|
|
|
}
|
|
|
let aa = [];
|
|
@@ -507,13 +490,13 @@ export default {
|
|
|
aa.push(valid);
|
|
|
//判断是编辑还是新增
|
|
|
if (this.isView) {
|
|
|
- if (aa.length == 4) {
|
|
|
+ if (aa.length == 5) {
|
|
|
this.register();
|
|
|
} else {
|
|
|
this.disableFlagStatus();
|
|
|
}
|
|
|
} else {
|
|
|
- if (aa.length == 4) {
|
|
|
+ if (aa.length == 5) {
|
|
|
this.editUserFun();
|
|
|
} else {
|
|
|
this.disableFlagStatus();
|
|
@@ -549,6 +532,7 @@ export default {
|
|
|
userNo: this.ruleForm.studentNumber,
|
|
|
userName: this.ruleForm.name,
|
|
|
gender: this.ruleForm.sex,
|
|
|
+ position: parseInt(this.ruleForm.position),
|
|
|
// password: md5(this.ruleForm.password),
|
|
|
//roleType 1学生
|
|
|
roleType: "1",
|
|
@@ -608,6 +592,7 @@ export default {
|
|
|
this.userDetailData.userName = this.ruleForm.name;
|
|
|
this.userDetailData.gender = this.ruleForm.sex;
|
|
|
this.userDetailData.userNo = this.ruleForm.studentNumber;
|
|
|
+ this.userDetailData.position = parseInt(this.ruleForm.position);
|
|
|
this.$http.post(
|
|
|
`/user/addOrUpdateUser`,
|
|
|
{
|