|
@@ -27,12 +27,11 @@
|
|
|
placeholder="请选择组织架构"
|
|
|
v-model="ruleForm.group"
|
|
|
:options="groupData"
|
|
|
- :props="{ checkStrictly: true }"
|
|
|
-
|
|
|
+ :props="{ checkStrictly: true }"
|
|
|
clearable
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="学号" prop="studentNumber">
|
|
|
+ <el-form-item label="账号" prop="studentNumber">
|
|
|
<el-input v-model="ruleForm.studentNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-row>
|
|
@@ -42,7 +41,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="性别" prop="name">
|
|
|
+ <el-form-item label="性别" prop="sex">
|
|
|
<el-radio-group v-model="ruleForm.sex" style="margin-left: 20px">
|
|
|
<el-radio label="1">男</el-radio>
|
|
|
<el-radio label="0">女</el-radio>
|
|
@@ -50,15 +49,15 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <el-form-item v-if="isView" label="密码" prop="password">
|
|
|
+
|
|
|
+ <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-form-item v-if="isView" label="确认密码" prop="comPassword">
|
|
|
<el-input
|
|
|
type="password"
|
|
|
v-model="ruleForm.comPassword"
|
|
@@ -70,9 +69,7 @@
|
|
|
<!-- <el-button type="success" round @click="submitForm('ruleForm')"
|
|
|
>提交</el-button
|
|
|
> -->
|
|
|
- <el-button type="success" round @click="submitCom()"
|
|
|
- >提交</el-button
|
|
|
- >
|
|
|
+ <el-button type="success" round @click="submitCom()">提交</el-button>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -119,7 +116,7 @@ export default {
|
|
|
};
|
|
|
return {
|
|
|
//编辑返回的值
|
|
|
- userDetailData:{},
|
|
|
+ userDetailData: {},
|
|
|
//组织架构名字
|
|
|
groupName: "",
|
|
|
ppData: [],
|
|
@@ -159,8 +156,9 @@ export default {
|
|
|
isView: true,
|
|
|
rules: {
|
|
|
group: [{ required: true, message: "请选择组织架构", trigger: "blur" }],
|
|
|
- studentNumber: [{ required: true, message: "请输入学号", trigger: "blur" }],
|
|
|
- name: [{ required: true, message: "请输入学号", trigger: "blur" }],
|
|
|
+ studentNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
|
|
|
+ name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
|
|
+ sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
|
|
// password: [{ required: true, message: "请输密码", trigger: "blur" }],
|
|
|
password: [{ required: true, validator: validatePass, trigger: "blur" }],
|
|
|
comPassword: [{ required: true, validator: validateComPass, trigger: "blur" }],
|
|
@@ -176,7 +174,7 @@ export default {
|
|
|
// this.ruleForm.type = "3";
|
|
|
},
|
|
|
methods: {
|
|
|
- resetData(){
|
|
|
+ resetData() {
|
|
|
this.$refs["ruleForm"].clearValidate();
|
|
|
//清空表单
|
|
|
this.ruleForm.group = "";
|
|
@@ -191,7 +189,6 @@ export default {
|
|
|
this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
|
|
|
// this.$toast.success({message:'成功'});
|
|
|
if (res && res.code == 200) {
|
|
|
-
|
|
|
//将值赋值给list
|
|
|
if (res.data.length > 0) {
|
|
|
let resAdd = this.addPro(res.data);
|
|
@@ -247,7 +244,7 @@ export default {
|
|
|
},
|
|
|
queryOrgName() {
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
@@ -276,9 +273,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
open(val) {
|
|
|
- this.cancle();
|
|
|
+ this.cancle();
|
|
|
this.getChannel();
|
|
|
-
|
|
|
+
|
|
|
this.dialogVisible = true;
|
|
|
this.isView = val;
|
|
|
|
|
@@ -290,41 +287,36 @@ export default {
|
|
|
this.getChannel();
|
|
|
this.dialogVisible = true;
|
|
|
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 = [];
|
|
|
+ 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() {
|
|
|
this.$refs["ruleForm"].clearValidate();
|
|
@@ -381,35 +373,34 @@ export default {
|
|
|
},
|
|
|
register() {
|
|
|
this.queryOrgName();
|
|
|
- if(this.ruleForm.group.length!=2){
|
|
|
+ if (this.ruleForm.group.length != 2) {
|
|
|
this.$message({
|
|
|
- message:'院管理员请选择二级组织架构',
|
|
|
- type:'error'
|
|
|
- })
|
|
|
- return
|
|
|
+ message: "院管理员请选择二级组织架构",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
- console.log( this.ruleForm.group)
|
|
|
+ console.log(this.ruleForm.group);
|
|
|
let that = this;
|
|
|
// this.ruleForm.password = md5(this.ruleForm.password);
|
|
|
this.$http.post(
|
|
|
`/user/addOrUpdateUser`,
|
|
|
{
|
|
|
- orgNo:this.ruleForm.group[this.ruleForm.group.length-1] ,
|
|
|
+ orgNo: this.ruleForm.group[this.ruleForm.group.length - 1],
|
|
|
orgName: this.groupName,
|
|
|
userNo: this.ruleForm.studentNumber,
|
|
|
userName: this.ruleForm.name,
|
|
|
gender: this.ruleForm.sex,
|
|
|
password: md5(this.ruleForm.password),
|
|
|
- //roleType 1普通用户 roleType 管理员
|
|
|
- roleType:'2'
|
|
|
+ //roleType 1普通用户 roleType 管理员
|
|
|
+ roleType: "2",
|
|
|
},
|
|
|
(res) => {
|
|
|
-
|
|
|
this.disableFlagStatus();
|
|
|
// this.disableFlag = false;
|
|
|
if (res && res.code == 200) {
|
|
|
this.dialogVisible = false;
|
|
|
-
|
|
|
+
|
|
|
// this.$toast.success({ message: "成功" });
|
|
|
//调用父组件的查询方法
|
|
|
that.$emit("search");
|
|
@@ -425,22 +416,22 @@ export default {
|
|
|
editUserFun() {
|
|
|
let that = this;
|
|
|
this.queryOrgName();
|
|
|
- if(this.ruleForm.group.length!=2){
|
|
|
+ if (this.ruleForm.group.length != 2) {
|
|
|
this.$message({
|
|
|
- message:'院管理员请选择二级组织架构',
|
|
|
- type:'error'
|
|
|
- })
|
|
|
- return
|
|
|
+ message: "院管理员请选择二级组织架构",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
- 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(
|
|
|
- `/user/addOrUpdateUser`,
|
|
|
+ `/user/addOrUpdateUser`,
|
|
|
{
|
|
|
- ...this.userDetailData
|
|
|
+ ...this.userDetailData,
|
|
|
},
|
|
|
(res) => {
|
|
|
this.disableFlagStatus();
|
|
@@ -525,6 +516,4 @@ export default {
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</style>
|