From a22e8fa0d5168c3aa171009ed2466b3f132c8b57 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Wed, 5 Jan 2022 17:44:18 +0800 Subject: [PATCH] 26352 --- .../3.0.0/AppVillagerDiscussion/components/Add.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) 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') }