From e8deac4d8b27cc9eaf353288aa0c6e7e94864180 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 19 Apr 2022 18:05:03 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=9F=A5=E7=9C=8B=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E8=81=94=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/user/AddUser.vue | 513 ++-----------------------------------
1 file changed, 18 insertions(+), 495 deletions(-)
diff --git a/src/views/user/AddUser.vue b/src/views/user/AddUser.vue
index 4d8ea36..d909601 100644
--- a/src/views/user/AddUser.vue
+++ b/src/views/user/AddUser.vue
@@ -83,17 +83,14 @@
-
@@ -128,72 +125,6 @@
已绑定的平台和用户信息
-
-
-
-
-
-
-
-
-
-
- 组织关系
- 绑定组织关系
- 不绑定组织关系
-
-
-
- {{index}}
-
-
-
{{typeList.find(n => n.id == item1.type) ? typeList.find(n => n.id == item1.type).label : ''}}
-
-
-
-
-
- 工号:
-
{{item1.workNumber}}
-
-
-
- 账号:
-
{{item1.account}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
查看
@@ -232,430 +163,33 @@ export default {
return {
userId: this.$route.query.userId,
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: {
//个人信息
userId: '',
userName: '', //用户姓名
uniqueIdentification: '', //唯一识别码
- documentType: '居民身份证', //证件类型
idNumber: '', //证件号码
- cityId: '', //省份
- countries: '中国', //国家
- provinceId: '', //城市
dateBirth: '', //出生日期
- educationDegree: '', //教育程度
- sex: '', //性别
- schoolId: '', //学校
-
- //账号信息
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: {
- 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
+ userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }]
},
- {
- 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: [], //平台系统列表
- saveList: [],
- roldform: {
-
- },
- clickFlag: true,
- searchTimer: null,
- showArch: false,
- isShow: false
};
},
mounted() {
- if(this.userId){
- this.getdata();
- }
- this.getSchoolData();
- this.getSubject();
+ this.userId && this.getdata()
},
methods: {
getdata() {
- this.$get(this.api.queryUserInfoDetails,{ userId: this.userId }).then(res => {
- const { result } = res
- const { hrUserInfo } = result
- let { userAccountList } = result
- 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 => {});
+ this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => {
+ this.form = result.hrUserInfo
+ this.platformList = result.bindingPlatformAndUserList
+ }).catch((res) => {})
},
goback(){
- 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
- }
- })
- }
+ this.$router.back()
},
switchUser(val,row,index) {
this.$get(this.api.updateAccountAllEnable,{
@@ -692,18 +226,7 @@ export default {
}
this.chooseList = list
}).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
- },
+ }
}
};