From c11eb9ca6ba8ee7fbdb05291fb7e55e5d9f492fd Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 3 Jun 2024 18:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.js | 1 + src/views/match/add/step3.vue | 70 ++++++++++++++++++-------- src/views/match/manage/matchSignup.vue | 7 +-- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 46f2a0c..58a3cd0 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -387,6 +387,7 @@ export default { batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`, deleteAllData: `competition/competition/registration/deleteAllData`, whetherThereIsReport: `competition/competitionAutomaticAllocationRecord/whetherThereIsReport`, + closePopup: `competition/competitionAutomaticAllocationRecord/closePopup`, batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`, batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`, TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`, diff --git a/src/views/match/add/step3.vue b/src/views/match/add/step3.vue index d680493..8eed686 100644 --- a/src/views/match/add/step3.vue +++ b/src/views/match/add/step3.vue @@ -95,6 +95,18 @@ + + + +

+ 团队赛发布成功,若有修改报名时间、赛程与规则,修改不会影响已经分配的阶段参赛人员,但后面加入报名的将不再自动分配,如需将已分配的重新分配和新加入报名的进行分配,请前往报名人员列表设置全部重新分配

+ 不再提示 + + + 关闭 + +
@@ -147,6 +159,9 @@ export default { setVisible: false, curStep: 0, curOriginForm: {}, + + closeStatus: false, + tipsVisible: false, }; }, components: { @@ -308,6 +323,12 @@ export default { publish () { this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { }) }, + + // 关闭编辑的提示弹框 + async closePopup () { + if (this.closeStatus) await this.$post(`${this.api.closePopup}?competitionId=${this.competitionId}`) + this.$emit('next', 0) + }, // 自动分配人员 async automaticAllocation (assignOrNot, next) { await this.$post(this.api.updateEventAllocationRecord, { @@ -318,41 +339,40 @@ export default { }, // 自动分配人员弹框 async autoAllocationConfirm (next) { + // 查询是否有分配信息 const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`) if (!data || data.assignOrNot === undefined || !this.form[0].contentId) { // 首次发布 or 新增 才需要弹框 - this.$confirm('

团队赛发布成功,是否要自动分配阶段参赛人员?

(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员

', '提示', { - confirmButtonText: '是', - cancelButtonText: '否', - type: 'success', - closeOnClickModal: false, - dangerouslyUseHTMLString: true, - }).then(() => { - this.automaticAllocation(1, next) - }).catch(() => { - this.automaticAllocation(0, next) - }) - } else { - // 查询是否需要弹框 - const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) - if (res.popupState) { - this.$confirm('

团队赛发布成功,是否要重新自动分配阶段参赛人员?

(点击“是”将会立即给报名的团队自动分配阶段参赛人员

', '提示', { + const now = await Util.getNow() + // 报名结束时间还没到 + if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) { + this.$confirm('

团队赛发布成功,是否要自动分配阶段参赛人员?

(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员

', '提示', { confirmButtonText: '是', cancelButtonText: '否', type: 'success', closeOnClickModal: false, - showClose: false, dangerouslyUseHTMLString: true, - }).then(async () => { - await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // 立马分配 - this.$emit('next', next) + }).then(() => { + this.automaticAllocation(1, next) }).catch(() => { this.automaticAllocation(0, next) }) } else { - // 无需弹框 - this.$emit('next', next) + this.$confirm('团队赛发布成功,由于您设置的报名时间已结束,如需自动分配阶段参赛人员,请前往报名人员列表进行设置', '提示', { + confirmButtonText: '关闭', + type: 'success', + closeOnClickModal: false, + dangerouslyUseHTMLString: true, + showClose: false, + }).then(() => { + this.$emit('next', next) + }).catch(() => { }) } + } else if (data.whetherToHidePopUps) { + // 编辑的提示弹框如果没勾选不再提示,则弹框提示 + this.tipsVisible = true + } else { + this.$emit('next', next) } }, // 提交 @@ -507,4 +527,10 @@ export default { cursor: pointer; } } + +/deep/.tips-dia { + .el-dialog__body { + padding: 10px 20px; + } +} \ No newline at end of file diff --git a/src/views/match/manage/matchSignup.vue b/src/views/match/manage/matchSignup.vue index 57759fc..b86bb49 100644 --- a/src/views/match/manage/matchSignup.vue +++ b/src/views/match/manage/matchSignup.vue @@ -20,7 +20,7 @@ {{ !notBeginSign && allocated ? '取消' : '' - }}自动分配阶段成员 + }}重新自动分配阶段成员 导入 新增 { await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // 立马分配 }).catch(() => { }) } else { - this.$confirm(this.allocated ? '确定取消自动分配阶段成员?' : '确定开启自动分配阶段成员?开启后,将在报名结束后给所有报名的团队自动分配阶段参赛人员', { + this.$confirm(this.allocated ? '确定取消重新自动分配阶段成员?' : '

确定开启重新自动分配阶段成员?

开启后,将在报名结束后给所有报名的团队重新自动分配阶段参赛人员

', { type: 'success', closeOnClickModal: false, + dangerouslyUseHTMLString: true, }).then(async () => { this.allocating = true this.automaticAllocation(this.allocated ? 0 : 1)