From 44212d8ce70a6c2a7cf0df7b430c5e4001db2d0f Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 29 Apr 2021 17:37:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/AddProject.vue | 4 +- src/components/page/Project.vue | 24 +++++++----- src/components/page/Staff.vue | 62 ++++++++++-------------------- 3 files changed, 37 insertions(+), 53 deletions(-) diff --git a/src/components/page/AddProject.vue b/src/components/page/AddProject.vue index b5bb2d6..1bb1f8a 100644 --- a/src/components/page/AddProject.vue +++ b/src/components/page/AddProject.vue @@ -1007,9 +1007,9 @@ this.handleCacheData() let systemId = this.pattern ? 12 : 11 if(row){ - location.href = `http://www.liuwanr.cn/jdTrials/#/programOptions?id=${row.judgmentPointsId}&systemId=${systemId}&userId=${this.userId}&projectId=${this.id}&token=${this.token}&pattern=${this.pattern}` + location.href = `http://www.liuwanr.cn/jdTrials/#/programOptions?id=${row.judgmentPointsId}&systemId=${systemId}&userId=${this.userLoginId}&projectId=${this.id}&token=${this.token}&pattern=${this.pattern}` }else{ - location.href = `http://www.liuwanr.cn/jdTrials/#/list?systemId=${systemId}&userId=${this.userId}&projectId=${this.id ? this.id : ''}&token=${this.token}&pattern=${this.pattern}` + location.href = `http://www.liuwanr.cn/jdTrials/#/list?systemId=${systemId}&userId=${this.userLoginId}&projectId=${this.id ? this.id : ''}&token=${this.token}&pattern=${this.pattern}` // location.href = `http://192.168.31.154:8080/#/list?systemId=${this.systemId}&userId=${this.userId}&projectId=${this.id ? this.id : ''}&token=${this.token}&pattern=${this.pattern}` } }, diff --git a/src/components/page/Project.vue b/src/components/page/Project.vue index 432ed07..06186fc 100644 --- a/src/components/page/Project.vue +++ b/src/components/page/Project.vue @@ -72,11 +72,7 @@ - - - + - + @@ -129,7 +125,7 @@ export default { return { systemId: this.$config.systemId, showBack: JSON.stringify(this.$store.state.addClass) == '{}' ? false : true, - roleId: this.$store.state.userRoleId, + roleId: this.$store.state.userRoleId.includes(',') ? 13 : Number(this.$store.state.userRoleId), userId: this.$store.state.userLoginId, queryData: { projectPermissions: "", @@ -232,7 +228,15 @@ export default { data.projectName = this.encodeString(this.keyword) data.systemId = this.systemId this.$get(this.api.queryAllManagements,data).then(res => { - this.projectData = res.pageInfo.list + let list = res.pageInfo.list + list.map(n => { + if(n.founder.includes(',')){ + n.founder = '管理员' + }else{ + n.founder = this.roleStatus(n.founder) + } + }) + this.projectData = list this.totals = res.pageInfo.total }).catch(res => {}); }, diff --git a/src/components/page/Staff.vue b/src/components/page/Staff.vue index d252dd7..6e8b414 100644 --- a/src/components/page/Staff.vue +++ b/src/components/page/Staff.vue @@ -291,9 +291,6 @@ export default { emailNoAdd: '', managerNumberNoAdd: true, teacherNumberNoAdd: true, - studentNumberNoAdd: true, - managerNumberNoAdd1: true, - teacherNumberNoAdd1: true, platformId: this.$store.state.platformId, isManager: false, isTeacher: false, @@ -585,42 +582,28 @@ export default { } }, async OnlyId(type){ - let workNumber = type == 13 ? this.encodeString(this.teacherForm.managerWorkNumber) : this.encodeString(this.teacherForm.teacherWorkNumber) - let data = { - workNumber, - roleId: 13, - schoolId: this.teacherForm.schoolId - } - let data1 = { - workNumber, - roleId: 14, - schoolId: this.teacherForm.schoolId - } - let data2 = { - workNumber, - roleId: 4, - schoolId: this.teacherForm.schoolId - } - let res = await this.$get(this.api.queryWorkNumberIsExist, data) - let res1 = await this.$get(this.api.queryWorkNumberIsExist, data1) - let res2 = await this.$get(this.api.queryWorkNumberIsExist, data2) - if(type == 13 && JSON.stringify(res.message) != '{}'){ - this.$message.warning('该工号已存在'); - this.managerNumberNoAdd = false - }else if(type == 14 && JSON.stringify(res1.message) != '{}'){ - this.$message.warning('该工号已存在'); - this.teacherNumberNoAdd = false - }else if(JSON.stringify(res2.message) != '{}'){ - this.$message.warning('该工号已绑定学生角色'); - this.studentNumberNoAdd = false - }else if(type == 14 && JSON.stringify(res.message) != '{}'){ - this.$message.warning('该工号已绑定管理员角色'); - this.managerNumberNoAdd1 = false - }else if(type == 13 && JSON.stringify(res1.message) != '{}'){ - this.$message.warning('该工号已绑定老师角色'); - this.teacherNumberNoAdd1 = false + let data = {}; + let msg = ''; + if(type == 13){ + data = { + workNumber: this.encodeString(this.teacherForm.managerWorkNumber), + roleId: 13, + schoolId: this.teacherForm.schoolId + } + msg = '该管理员工号已存在' + }else if(type == 14){ + data = { + workNumber: this.encodeString(this.teacherForm.teacherWorkNumber), + roleId: 14, + schoolId: this.teacherForm.schoolId + } + msg = '该老师工号已存在' } - if(JSON.stringify(res.message) == '{}' && JSON.stringify(res1.message) == '{}' && JSON.stringify(res2.message) == '{}'){ + let res = await this.$get(this.api.queryWorkNumberIsExist, data); + if(JSON.stringify(res.message) != '{}'){ + this.$message.warning(msg); + type == 13 ? (this.managerNumberNoAdd = false) : (this.teacherNumberNoAdd = false) + }else{ let timestamp = Date.parse(new Date()); this.teacherForm.uniqueIdentificationAccount = `${this.schoolId}${this.teacherForm.uniqueIdentificationAccount}${timestamp}` type == 13 ? (this.managerNumberNoAdd = true) : (this.teacherNumberNoAdd = true) @@ -645,9 +628,6 @@ export default { } if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在'); if(!this.teacherNumberNoAdd) return this.$message.warning('该老师工号已存在'); - if(!this.managerNumberNoAdd1) return this.$message.warning('该工号已绑定管理员角色'); - if(!this.teacherNumberNoAdd1) return this.$message.warning('该工号已绑定老师角色'); - if(!this.studentNumberNoAdd) return this.$message.warning('该工号已绑定学生角色'); let roleId = [] this.teacherForm.roleValue.forEach((n,k) => {