From 951a69cfad51a44aa5102a32ccd97c40343c5158 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 28 Jun 2022 11:46:27 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/match/add/index.vue | 2 +- src/views/match/manage/matchDetail.vue | 2 +- src/views/match/manage/notice.vue | 23 ++++++++++++++++++----- src/views/match/manage/noticeDetail.vue | 4 +++- 4 files changed, 23 insertions(+), 8 deletions(-) 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()