员工学生账号判重等

dev_2022-05-11
yujialong 4 years ago
parent e40ec2d157
commit 7ef1c3fdb3
  1. 18
      src/components/page/AddClass.vue
  2. 7
      src/components/page/ShowExperiment.vue
  3. 15
      src/components/page/Staff.vue
  4. 8
      src/components/page/dashboard.vue
  5. 9
      src/components/page/student.vue

@ -248,11 +248,12 @@ export default {
pageSize: this.pageSize,
userId: this.userId,
systemId: this.systemId,
projectName: this.keyword
projectName: this.keyword,
projectPermissions: 1,
}
this.$get(this.api.queryManagements,data).then(res => {
this.projectData = res.message.rows
this.totals = res.message.total
this.$get(this.api.queryAllManagements,data).then(res => {
this.projectData = res.pageInfo.list
this.totals = res.pageInfo.total
}).catch(res => {});
},
initData(){
@ -313,14 +314,19 @@ export default {
isCode: this.isCode,
projectId: this.projectId,
projectName: this.projectName,
startTime: this.startTime,
status: Number(this.status),
stopTime: this.stopTime,
surplusTime: this.surplusTime,
type: Number(this.type),
userId: this.userId,
systemId: this.systemId
}
if(this.type == 2){
data.startTime = this.startTime
data.stopTime = this.stopTime
}else{
data.startTime = '0000-00-00 00:00:00'
data.stopTime = '0000-00-00 00:00:00'
}
if(this.id){
this.$post(this.api.expUpdate, data).then(res => {
this.$message.success('修改成功');

@ -155,6 +155,8 @@
let expData = res.data.data
let form = this.form
let score = form.score
if(expData){
if(score){
expData.map(n => {
if(n.isError){
@ -166,6 +168,8 @@
}
this.expData = expData
}
this.infoData.push({
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
@ -189,6 +193,8 @@
let expData = res.data.data
let form = this.form
let score = form.score
if(expData){
if(score){
expData.map(n => {
if(n.isError){
@ -200,6 +206,7 @@
}
this.expData = expData
}
this.infoData.push({
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,

@ -297,7 +297,8 @@ export default {
isNewUser: 1,
schoolList: [],
uploadFaild: false,
token: ''
token: '',
accountMsg: ''
};
},
components: {
@ -539,7 +540,8 @@ export default {
if(res.message.user.length != 0){
let user = res.message.user[0];
let or = res.message.OR;
this.$message.warning('该账号已存在');
this.accountMsg = user.roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${this.roleStatus(user.roleId)}`
this.$message.warning(this.accountMsg)
this.teacherForm.email = user.email
this.teacherForm.phone = user.phone
this.teacherForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount
@ -571,6 +573,7 @@ export default {
}else{
this.isNewUser = 1
this.AccountNoAdd = true
this.teacherForm.userName = ''
}
},
async submitOnlyId(){
@ -615,7 +618,7 @@ export default {
if(this.isManager && this.isTeacher) return this.$message.warning('该用户已经是老师和管理员,请重新添加');
if(this.isManager && !this.teacherForm.roleValue.some((n) => n == '老师')) return this.$message.warning('该用户已经是管理员');
if(this.isTeacher && !this.teacherForm.roleValue.some((n) => n == '管理员')) return this.$message.warning('该用户已经是老师');
if(!this.AccountNoAdd) return this.$message.warning('该账号已存在');
if(!this.AccountNoAdd) return this.$message.warning(this.accountMsg)
if(this.NoAdd == '' && this.teacherForm.phone){
this.phoneChange()
if(!this.NoAdd) return false
@ -629,10 +632,8 @@ export default {
if(!this.teacherNumberNoAdd) return this.$message.warning('该老师工号已存在');
let roleId = []
this.teacherForm.roleValue.forEach((n,k) => {
n == '老师' && roleId.push(14)
n == '管理员' && roleId.push(13)
})
this.teacherForm.roleValue.includes('管理员') && roleId.push(13)
this.teacherForm.roleValue.includes('老师') && roleId.push(14)
let data = {
userName: this.teacherForm.userName,
account: this.teacherForm.userAccount,

@ -260,6 +260,14 @@ export default {
}
},
watch: {
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.date = []
}
},
date: function(val){
if(val){
this.form.startTime = val[0]

@ -243,7 +243,8 @@ export default {
},
schoolList: [],
uploadFaild: false,
token: ''
token: '',
accountMsg: ''
};
},
mounted() {
@ -276,7 +277,7 @@ export default {
saveData() {
this.$refs.form.validate((valid) => {
if (valid) {
if(this.accountReapeat) return this.$message.warning('该账号已存在')
if(this.accountReapeat) return this.$message.warning(this.accountMsg)
if(this.workNumberReapeat) return this.$message.warning('该学生学号已存在')
if(this.phoneRepeat) return this.$message.warning('该手机号已存在')
this.form.schoolName = this.schoolList.find(n => n.schoolId == this.form.schoolId).schoolName
@ -313,7 +314,9 @@ export default {
schoolId: this.schoolId
});
if(res.message.user.length){
this.$message.warning('该账号已存在');
let roleId = res.message.user[0].roleId
this.accountMsg = roleId == 4 ? '该账号已存在' : (roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${this.roleStatus(roleId)}`)
this.$message.warning(this.accountMsg)
this.accountReapeat = true
}else{
this.accountReapeat = false

Loading…
Cancel
Save