提交 d1f79543 authored 作者: matian's avatar matian

bug fixes

上级 5cd51775
...@@ -112,6 +112,14 @@ export default { ...@@ -112,6 +112,14 @@ export default {
}, },
// 下一步 // 下一步
nextStep() { nextStep() {
if (this.name === '') {
this.$message.warning('请输入考试名称')
return
}
if ((!this.start_time && !this.end_time) || !this.start_time || !this.end_time) {
this.$message.warning('请选择考试时间')
return
}
const params = { const params = {
name: this.name, name: this.name,
start_time: this.start_time, start_time: this.start_time,
...@@ -125,26 +133,19 @@ export default { ...@@ -125,26 +133,19 @@ export default {
waiting_message: this.config.waiting_message waiting_message: this.config.waiting_message
} }
} }
if (params.name === '') {
this.$message.warning('请输入考试名称')
return
} else if (params.start_time === '' || params.end_time === '') {
this.$message.warning('请选择考试时间')
return
}
// const startTime = new Date(params.start_time)
// const endTime = new Date(params.end_time)
// const day = (endTime - startTime) / 86400000
// console.log(day)
// if ((endTime - startTime) / 86400000 >= 40) {
// this.$message.warning('考试时间不能超过40天')
// return
// }
this.$emit('getBaseInfo', params) this.$emit('getBaseInfo', params)
this.$parent.$parent.nextStep() this.$parent.$parent.nextStep()
}, },
// 保存/更新基本信息 // 保存/更新基本信息
saveExamInfo() { saveExamInfo() {
if (this.name === '') {
this.$message.warning('请输入考试名称')
return
}
if ((!this.start_time && !this.end_time) || !this.start_time || !this.end_time) {
this.$message.warning('请选择考试时间')
return
}
const params = { const params = {
id: this.exam_id, id: this.exam_id,
type: 'basic', type: 'basic',
...@@ -160,11 +161,7 @@ export default { ...@@ -160,11 +161,7 @@ export default {
waiting_message: this.config.waiting_message waiting_message: this.config.waiting_message
} }
} }
if (params.name === '') {
this.$message.warning('请输入考试名称')
} else if (params.start_time === '' || params.end_time === '') {
this.$message.warning('请选择考试时间')
}
updateExam(params).then(res => { updateExam(params).then(res => {
history.go(-1) history.go(-1)
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论