|
|
@ -430,13 +430,14 @@ |
|
|
|
self.$message.error("判分设置模块总分不足100分!"); |
|
|
|
self.$message.error("判分设置模块总分不足100分!"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// userType 0学生 1教师 2管理员 |
|
|
|
let user = JSON.parse(sessionStorage.getItem('user')); |
|
|
|
// if (self.formAction == 0 && self.$store.state.app.user.userType) { |
|
|
|
// userType 1教师 2超管 |
|
|
|
// self.dataForm.isAdmin = self.$store.state.app.user.userType == 1 ? 0 : 1; |
|
|
|
if (self.formAction == 0 && user) { |
|
|
|
// } |
|
|
|
self.dataForm.isAdmin = user.userType == 1 ? 0 : 1; |
|
|
|
if(this.formAction == 0){//新增 |
|
|
|
} |
|
|
|
|
|
|
|
if(self.formAction == 0){//新增 |
|
|
|
Train.insertCase(self.dataForm).then(res => { |
|
|
|
Train.insertCase(self.dataForm).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.status == 1) { |
|
|
|
// self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
// self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
self.$message.success("操作成功!"); |
|
|
|
self.$message.success("操作成功!"); |
|
|
|
self.goBackList(); |
|
|
|
self.goBackList(); |
|
|
@ -446,9 +447,9 @@ |
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
self.$message.error(error); |
|
|
|
self.$message.error(error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}else if(this.formAction == 1){//编辑 |
|
|
|
}else if(self.formAction == 1){//编辑 |
|
|
|
Train.updateCase(self.dataForm).then(res => { |
|
|
|
Train.updateCase(self.dataForm).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.status == 1) { |
|
|
|
self.$message.success("操作成功!"); |
|
|
|
self.$message.success("操作成功!"); |
|
|
|
self.goBackList(); |
|
|
|
self.goBackList(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|