编辑查看用户联调

dev_2022-04-07
yujialong 3 years ago
parent 54b57b3bc2
commit e8deac4d8b
  1. 513
      src/views/user/AddUser.vue

@ -83,17 +83,14 @@
</el-form-item> </el-form-item>
<el-form-item label="证件类型" prop="documentType"> <el-form-item label="证件类型" prop="documentType">
<!-- <el-input v-model="form.documentType" placeholder="请输入"></el-input> -->
<el-select <el-select
v-model="form.documentType" value="1"
clearable clearable
placeholder="请选择证件类型" placeholder="请选择证件类型"
> >
<el-option <el-option
v-for="(item,index) in documentTypeList" label="身份证"
:key="index" value="1"
:label="item.name"
:value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -128,72 +125,6 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>已绑定的平台和用户信息</span> <span>已绑定的平台和用户信息</span>
</div> </div>
<div>
<el-dialog :title="isShow ? '查看系统' : '编辑系统'" :visible.sync="dialogFormVisible" :center="!isIE()" :close-on-click-modal="false">
<el-form :class="{region: !isIE()}" ref="chooseList" :rules="rules" :disabled="isDetail">
<el-form-item label="系统选择" label-width="100px">
<el-select
v-model="region"
placeholder="请选择系统"
>
<el-option
v-for="(item,index) in regionOption"
:key="index"
:label="item.regionName"
:value="item.regionId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div style="margin-bottom: 20px;">
<span class="radio">组织关系</span>
<el-radio v-model="radio" label="1">绑定组织关系</el-radio>
<el-radio v-model="radio" label="2" disabled>不绑定组织关系</el-radio>
</div>
<el-card shadow="hover" v-for="(item,index) in chooseList" :key="index" class="school-item">
<p class="school-name">{{index}}</p>
<div class="card" :class="{isie: isIE()}">
<div class="port" v-for="(item1,index1) in item" :key="index1">
<p class="port-name">{{typeList.find(n => n.id == item1.type) ? typeList.find(n => n.id == item1.type).label : ''}}</p>
<el-card shadow="hover">
<ul class="fields">
<div class="line">
<li>
<span class="name">工号</span>
<p class="val">{{item1.workNumber}}</p>
</li>
<li>
<span class="name">账号</span>
<p class="val">{{item1.account}}</p>
</li>
<li>
<el-switch v-model="item1.isEnable" :active-value="1" :inactive-value="0" :active-text="item1.isEnable ? '启用' : '禁用'" :disabled="isShow" @change="switchOff($event,item1)"></el-switch>
</li>
</div>
<div class="line">
<li>
<span class="name">该工号所绑定角色</span>
<p class="val">管理员</p>
</li>
</div>
</ul>
</el-card>
</div>
</div>
</el-card>
<span slot="footer" class="dialog-footer">
<template v-if="isShow">
<el-button type="primary" @click="dialogFormVisible = false">返回</el-button>
</template>
<template v-else>
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="dialogFormVisible = false">确定</el-button>
</template>
</span>
</el-dialog>
</div>
</div> </div>
<el-table <el-table
@ -205,13 +136,13 @@
> >
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="platformName" label="平台名称" align="center"></el-table-column> <el-table-column prop="platformName" label="平台名称" align="center"></el-table-column>
<el-table-column prop="platformName" label="绑定组织名称" align="center"></el-table-column> <el-table-column prop="schoolName" label="绑定组织名称" align="center"></el-table-column>
<el-table-column prop="platformName" label="姓名" align="center"></el-table-column> <el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="platformName" label="工号/学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column>
<el-table-column prop="platformName" label="角色" align="center"></el-table-column> <el-table-column prop="roleName" label="角色" align="center"></el-table-column>
<el-table-column prop="platformName" label="绑定时间" align="center"></el-table-column> <el-table-column prop="logInNumber" label="绑定时间" align="center"></el-table-column>
<el-table-column prop="domainName" label="登录次数" align="center"></el-table-column> <el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="createTime" label="上一次的登录时间" align="center"></el-table-column> <el-table-column prop="lastLoginTime" label="上一次的登录时间" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row,true)">查看</el-button> <el-button type="text" @click="show(scope.row,true)">查看</el-button>
@ -232,430 +163,33 @@ export default {
return { return {
userId: this.$route.query.userId, userId: this.$route.query.userId,
isDetail: this.$route.query.show, // isDetail: this.$route.query.show, //
typeList: [
{
id: 0,
label: '教师端'
},{
id: 1,
label: '学生端'
}
],
region: '', //
checkList: [{
label: '管理员',
id: 13
},
{
label: '教师',
id: 14
},
{
label: '学生',
id: 4
}], //
radio: '1', //
innerVisible: false,
dialogFormVisible: false,
form: { form: {
// //
userId: '', userId: '',
userName: '', // userName: '', //
uniqueIdentification: '', // uniqueIdentification: '', //
documentType: '居民身份证', //
idNumber: '', // idNumber: '', //
cityId: '', //
countries: '中国', //
provinceId: '', //
dateBirth: '', // dateBirth: '', //
educationDegree: '', //
sex: '', //
schoolId: '', //
//
phone: '', // phone: '', //
WeChatID: '', //
email: '', //
},
occupationList: [{
value: 1,
label: '学生'
}, },
{
value: 2,
label: '老师'
}],
roleIds: [],
archivesForm: {
//
personalCareerId: '', //
schoolId: '', //
schoolName: '', //
professionalClassId: '', //
professionalClassName: '', //
disciplineId: '', //
disciplineName: '', //
professionalId: '', //
professionalName: '', //
userId: this.$route.query.userId
},
archivesList: [],
rules: { rules: {
userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }], userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }]
schoolId: [{ required: true, message: '请选择当前院校', trigger: 'change' }],
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
idNumber: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/,
message: '请输入正确的证件号码',
trigger: 'blur'
}
],
email: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
]
}, },
sexList: [
{
name: '男',
value: 1
},
{
name: '女',
value: 2
}
],
documentTypeList: [
{
name: '居民身份证',
value: 1
}
],
//
educationDegreeList: [
{
name: '专科',
value: 1
},
{
name: '本科',
value: 2
},
{
name: '硕士',
value: 3
},
{
name: '博士',
value: 4
},
{
name: '其他',
value: 5
}
],
subjectList: [], //
ProfessionalClassList: [], //
ProfessionalList: [], //
//
countryList: [
{
name: '中国'
}
],
schoolList: [],
cityList: [], //
provinceList: this.$store.state.provinceList, //
IDdisabled: false,
regionOption: [{
regionName: '职站',
regionId: 1
},
{
regionName: '数据平台',
regionId: 2
}], //
secondaryDepartmentsList: [], //
secondaryDepartmentsList_T: [], //
majorList: [], //
yearList: [], //
classList: [], //
multipleSelection: [],
customerList: [], //
cusSearch: '',
chooseCusList: [],
choosecusArr: '',
chooseList: [],
NoAdd: true,
AccountNoAdd: true,
NumberNoAdd: true,
teaNumberNoAdd: true,
stuNumberNoAdd: true,
platformList: [], // platformList: [], //
saveList: [],
roldform: {
},
clickFlag: true,
searchTimer: null,
showArch: false,
isShow: false
}; };
}, },
mounted() { mounted() {
if(this.userId){ this.userId && this.getdata()
this.getdata();
}
this.getSchoolData();
this.getSubject();
}, },
methods: { methods: {
getdata() { getdata() {
this.$get(this.api.queryUserInfoDetails,{ userId: this.userId }).then(res => { this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => {
const { result } = res this.form = result.hrUserInfo
const { hrUserInfo } = result this.platformList = result.bindingPlatformAndUserList
let { userAccountList } = result }).catch((res) => {})
if (userAccountList.length) userAccountList = userAccountList[0]
const { platformList } = result
let form = this.form
form = Object.assign(form, hrUserInfo, userAccountList)
this.originAccount = userAccountList.account
this.archivesList = result.personalFileList
this.$nextTick(() => {
if(this.form.provinceId){
this.getCityData(1)
}
if(this.archivesList.length){
this.archivesList.forEach((e,k) =>{
this.$set(e, 'subjectList', this.subjectList);
this.$set(e, 'disciplineId', e.disciplineName ? e.disciplineName : '');
this.$set(e, 'disciplineName', e.disciplineName ? e.disciplineName : '');
this.$set(e, 'professionalClassId', e.professionalClassName ? e.professionalClassName : '');
this.$set(e, 'professionalClassName', e.professionalClassName ? e.professionalClassName : '');
this.$set(e, 'professionalId', e.professionalName ? e.professionalName : '');
this.$set(e, 'professionalName', e.professionalName ? e.professionalName : '');
this.$set(e, 'schoolId', e.schoolName ? e.schoolName : '');
this.$set(e, 'schoolName', e.schoolName ? e.schoolName : '');
// if(e.disciplineId){
// this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => {
// this.$set(e, 'ProfessionalClassList', res.list);
// }).catch(res => {});
// }else{
// this.$set(e, 'ProfessionalClassList', []);
// }
// if(e.professionalClassId){
// this.$get(this.api.queryCourseProfessional,{ professionalClassId: e.professionalClassId }).then(res => {
// this.$set(e, 'ProfessionalList', res.list);
// }).catch(res => {});
// }else{
// this.$set(e, 'ProfessionalList', []);
// }
})
}else{
// this.concatArch(1)
}
});
//
platformList.map(e =>{
this.regionOption.map((r,index) =>{
if(r.regionId == e.platformId){
this.regionOption.splice(index,1)
}
})
})
this.platformList = platformList
}).catch((res) => {})
},
concatArch() {
this.archivesList = this.archivesList.concat({
isNew: true,
personalCareerId: '',
schoolId: '',
schoolName: '',
subjectList: this.subjectList,
disciplineId: '',
disciplineName: '',
ProfessionalClassList: [],
professionalClassId: '',
professionalClassName: '',
ProfessionalList: [],
professionalId: '',
professionalName: '',
personalFileId: ''
})
},
getCity(){
if(this.form.provinceId){
this.getCityData()
}
},
getCityData(){
this.$get(this.api.queryCity,{provinceId: this.form.provinceId}).then(res => {
this.cityList = res.list
}).catch(res => {});
},
getSchoolName(id,index){
this.archivesList[index].schoolName = this.schoolList[id-1].schoolName
},
//
getSchoolData(){
this.$get(this.api.querySchoolData,{
schoolName: '',
provinceId: '',
cityId: ''
}).then(res => {
this.schoolList = res.list
}).catch(res => {});
}, },
goback(){ goback(){
this.$router.back() this.$router.back()
},
//
getSubject(){
this.$get(this.api.queryCourseDiscipline).then(res => {
this.subjectList = res.list
}).catch(res => {});
},
//
clearClass(){
this.archivesForm.professionalClassId = '',
this.archivesForm.professionalId = ''
},
//
getProfessionalClass(val){
this.clearClass()
if(val){
let obj = {};
obj = this.subjectList.find((item)=>{
return item.disciplineId === val;
});
this.archivesForm.disciplineName = obj.disciplineName
this.getProfessionalClassData(val)
}
},
clearItemClass(index){
this.archivesList[index].professionalClassId = ''
this.archivesList[index].professionalClassName = ''
this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = ''
// this.archivesList.map(e =>{
// if(e.disciplineId == item){
// e.professionalClassId = '',
// e.professionalClassName = '',
// e.professionalId = '',
// e.professionalName = ''
// }
// })
},
getItemProfessionalClass(item,index){
this.clearItemClass(index)
if(item){
let obj = {};
obj = this.subjectList.find(r =>{
return r.disciplineId === item;
});
this.$get(this.api.queryCourseProfessionalClass,{disciplineId: item}).then(res => {
this.archivesList.map(e =>{
if(e.disciplineId == item){
e.ProfessionalClassList = res.list
e.disciplineName = obj.disciplineName
}
})
}).catch(res => {});
}
},
getProfessionalClassData(value){
this.$get(this.api.queryCourseProfessionalClass,{disciplineId: value}).then(res => {
this.ProfessionalClassList = res.list
}).catch(res => {});
},
//
clearProfess(){
this.archivesForm.professionalId = ''
},
//
getProfessional(val){
this.clearProfess()
if(val){
let obj = {};
obj = this.ProfessionalClassList.find((item)=>{
return item.professionalClassId === val;
});
this.archivesForm.professionalClassName = obj.professionalClassName
this.getProfessionalData(val)
}
},
clearItemProfess(index){
this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = ''
// this.archivesList.map(e =>{
// if(e.professionalClassId == item){
// e.professionalId = '',
// e.professionalName = ''
// }
// })
},
getItemProfessional(item,index){
this.clearItemProfess(index)
if(item){
this.$get(this.api.queryCourseProfessional,{ professionalClassId: item }).then(res => {
this.archivesList.map(e =>{
if(e.professionalClassId == item){
let obj = {};
obj = e.ProfessionalClassList.find(r =>{
return r.professionalClassId === item;
});
e.ProfessionalList = res.list
e.professionalClassName = obj.professionalClassName
}
})
}).catch(res => {});
}
},
getProfessionalData(value){
this.$get(this.api.queryCourseProfessional,{professionalClassId: value}).then(res => {
this.ProfessionalList = res.list
}).catch(res => {});
},
//
getStuGrade(val){
if(val){
let obj = {};
obj = this.ProfessionalList.find(r =>{
return r.professionalId === val;
});
this.archivesForm.professionalName = obj.professionalName
}
},
getItemStuGrade(item){
if(item){
this.archivesList.map(e =>{
if(e.professionalId == item){
let obj = {};
obj = e.ProfessionalList.find(r =>{
return r.professionalId === item;
});
e.professionalName = obj.professionalName
}
})
}
}, },
switchUser(val,row,index) { switchUser(val,row,index) {
this.$get(this.api.updateAccountAllEnable,{ this.$get(this.api.updateAccountAllEnable,{
@ -692,18 +226,7 @@ export default {
} }
this.chooseList = list this.chooseList = list
}).catch(res => {}) }).catch(res => {})
}, }
switchOff(val,row){
this.$get(this.api.updateAccountEnable,{
id: row.id,
isEnable: val
}).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => {})
},
foldArch() {
this.showArch = !this.showArch
},
} }
}; };
</script> </script>

Loading…
Cancel
Save