diff --git a/packages/3.0.0/AppVillagerDiscussion/components/Add.vue b/packages/3.0.0/AppVillagerDiscussion/components/Add.vue index f0cba550..812a0cf4 100644 --- a/packages/3.0.0/AppVillagerDiscussion/components/Add.vue +++ b/packages/3.0.0/AppVillagerDiscussion/components/Add.vue @@ -153,6 +153,17 @@ confirm () { this.$refs.form.validate((valid) => { if (valid) { + const endTime = new Date(this.form.discussDeadline).getTime() + const endPublicityTime = this.form.publicityDeadline ? new Date(this.form.publicityDeadline).getTime() : 0 + const nowTime = new Date().getTime() + if (endTime - nowTime < 0) { + return this.$message.error('议事截止时间不能早于当前时间') + } + + if (endPublicityTime && endPublicityTime - endTime < 0) { + return this.$message.error('公示截止时间不能早于议事截止时间') + } + if (this.form.type === '1' && this.form.voteItems.length < 2) { return this.$message.error('投票选项不能少于2') }