项目权限

dev_2022-05-11
yujialong 4 years ago
parent 57e2aba97e
commit 711b73ae1b
  1. 2
      src/components/page/AddProject.vue
  2. 52
      src/components/page/Staff.vue
  3. 9
      src/components/page/project.vue

@ -1034,7 +1034,7 @@
// if(systemId == 4 || systemId == 5) systemId = 1 // if(systemId == 4 || systemId == 5) systemId = 1
this.handleCacheData() this.handleCacheData()
this.setCookie("systemId",systemId) this.setCookie("systemId",systemId)
this.setCookie("userId",this.userId) this.setCookie("userId",this.userLoginId)
this.setCookie("projectId",this.id) this.setCookie("projectId",this.id)
this.setCookie("token",this.token) this.setCookie("token",this.token)
let href = '' let href = ''

@ -291,9 +291,6 @@ export default {
emailNoAdd: '', emailNoAdd: '',
managerNumberNoAdd: true, managerNumberNoAdd: true,
teacherNumberNoAdd: true, teacherNumberNoAdd: true,
studentNumberNoAdd: true,
managerNumberNoAdd1: true,
teacherNumberNoAdd1: true,
platformId: this.$store.state.platformId, platformId: this.$store.state.platformId,
isManager: false, isManager: false,
isTeacher: false, isTeacher: false,
@ -584,45 +581,31 @@ export default {
} }
}, },
async OnlyId(type){ async OnlyId(type){
let workNumber = type == 13 ? this.encodeString(this.teacherForm.managerWorkNumber) : this.encodeString(this.teacherForm.teacherWorkNumber) let data = {};
let data = { let msg = '';
workNumber, if(type == 13){
data = {
workNumber: this.encodeString(this.teacherForm.managerWorkNumber),
roleId: 13, roleId: 13,
schoolId: this.teacherForm.schoolId schoolId: this.teacherForm.schoolId
} }
let data1 = { msg = '该管理员工号已存在'
workNumber, }else if(type == 14){
data = {
workNumber: this.encodeString(this.teacherForm.teacherWorkNumber),
roleId: 14, roleId: 14,
schoolId: this.teacherForm.schoolId schoolId: this.teacherForm.schoolId
} }
let data2 = { msg = '该老师工号已存在'
workNumber,
roleId: 4,
schoolId: this.teacherForm.schoolId
} }
let res = await this.$get(this.api.queryWorkNumberIsExist, data) let res = await this.$get(this.api.queryWorkNumberIsExist, data);
let res1 = await this.$get(this.api.queryWorkNumberIsExist, data1) if(JSON.stringify(res.message) != '{}'){
let res2 = await this.$get(this.api.queryWorkNumberIsExist, data2) this.$message.warning(msg);
if(type == 13 && JSON.stringify(res.message) != '{}'){ type == 2 ? (this.managerNumberNoAdd = false) : (this.teacherNumberNoAdd = false)
this.$message.warning('该工号已存在'); }else{
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
}
if(JSON.stringify(res.message) == '{}' && JSON.stringify(res1.message) == '{}' && JSON.stringify(res2.message) == '{}'){
let timestamp = Date.parse(new Date()); let timestamp = Date.parse(new Date());
this.teacherForm.uniqueIdentificationAccount = `${this.schoolId}${this.teacherForm.uniqueIdentificationAccount}${timestamp}` this.teacherForm.uniqueIdentificationAccount = `${this.schoolId}${this.teacherForm.uniqueIdentificationAccount}${timestamp}`
type == 13 ? (this.managerNumberNoAdd = true) : (this.teacherNumberNoAdd = true) type == 2 ? (this.managerNumberNoAdd = true) : (this.teacherNumberNoAdd = true)
} }
}, },
async saveSure(teacherForm){ async saveSure(teacherForm){
@ -644,9 +627,6 @@ export default {
} }
if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在'); if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在');
if(!this.teacherNumberNoAdd) 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 = [] let roleId = []
this.teacherForm.roleValue.forEach((n,k) => { this.teacherForm.roleValue.forEach((n,k) => {

@ -98,10 +98,10 @@
{{transferStatus(scope.row.state)}} {{transferStatus(scope.row.state)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button> <el-button type="text" @click="edit(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">编辑</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">删除</el-button>
<el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button> <el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button>
<el-switch <el-switch
v-model="scope.row.enable" v-model="scope.row.enable"
@ -140,7 +140,7 @@ export default {
data() { data() {
return { return {
showBack: JSON.stringify(this.$store.state.addClass) == '{}' ? false : true, 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, userId: this.$store.state.userLoginId,
systemId: this.$store.state.systemId ? this.$store.state.systemId : this.$config.systemId, systemId: this.$store.state.systemId ? this.$store.state.systemId : this.$config.systemId,
systemList: this.$config.systemList, systemList: this.$config.systemList,
@ -225,6 +225,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(11,this.roleId)
this.getData() this.getData()
}, },
methods: { methods: {

Loading…
Cancel
Save