This commit is contained in:
yanran200730
2022-01-05 17:44:18 +08:00
parent 6328209ffc
commit a22e8fa0d5

View File

@@ -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')
}