diff --git a/src/views/publish/examRule/draft/examFrom.vue b/src/views/publish/examRule/draft/examFrom.vue index 3aef4c25c..5528e74b7 100644 --- a/src/views/publish/examRule/draft/examFrom.vue +++ b/src/views/publish/examRule/draft/examFrom.vue @@ -231,8 +231,12 @@ export default { submitForm() { this.$refs['form'].validate((valid) => { if (valid) { - this.form.startDate = this.getDate(this.form.startDate); - this.form.endDate = this.getDate(this.form.endDate); + if (this.form.startDate) { + this.form.startDate = this.getDate(this.form.startDate); + } + if (this.form.endDate) { + this.form.endDate = this.getDate(this.form.endDate); + } this.form['trial'] = this.trial; this.$store.dispatch('exam/setCourseDetail', this.form); this.$emit('definition', this.form);