diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index 6ca210a..21be398 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -429,7 +429,7 @@ export default { let signUpStartTime = new Date(form.signUpStartTime).getTime(); let signUpEndTime = new Date(form.signUpEndTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime(); - if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); + // if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情"); diff --git a/src/views/match/manage/matchDetail.vue b/src/views/match/manage/matchDetail.vue index af21e8c..59de8eb 100644 --- a/src/views/match/manage/matchDetail.vue +++ b/src/views/match/manage/matchDetail.vue @@ -464,7 +464,7 @@ export default { let signUpStartTime = new Date(form.signUpStartTime).getTime(); let signUpEndTime = new Date(form.signUpEndTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime(); - if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); + // if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情"); diff --git a/src/views/match/manage/notice.vue b/src/views/match/manage/notice.vue index 6402c43..a0a0cfa 100644 --- a/src/views/match/manage/notice.vue +++ b/src/views/match/manage/notice.vue @@ -103,11 +103,24 @@ export default { }); }, switchOff(val, row, index) { - this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`) - .then(res => { - }) - .catch(err => { - }); + if (val) { + this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {}) + } else if (!row.status) { + this.$confirm('是否发布该公告?', '提示', { + type: 'success' + }).then(() => { + this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => { + this.$post(this.api.amendmentAnnouncement, { + id: row.id, + status: 1 + }).then(res => { + this.getData() + }).catch(err => {}) + }).catch(err => {}) + }).catch(() => { + row.isOpen = 1 + }) + } }, add() { this.$router.push(`/noticeDetail?contestId=${this.id}`) diff --git a/src/views/match/manage/noticeDetail.vue b/src/views/match/manage/noticeDetail.vue index 2f6f0f1..e6403b3 100644 --- a/src/views/match/manage/noticeDetail.vue +++ b/src/views/match/manage/noticeDetail.vue @@ -63,7 +63,8 @@ export default { contestId: this.$route.query.contestId, announcementText: '', announcementTitle: '', - announcementAnnexList: [] + announcementAnnexList: [], + isOpen: 1 }, updateTime: 0, fileName: '', @@ -119,6 +120,7 @@ export default { this.$router.back() }).catch(err => {}) } else { + form.isOpen = status ? 0 : 1 this.$post(this.api.addAnnouncement, form).then(res => { util.successMsg("创建成功") this.$router.back()