From 94ed77777db6ae383f195303f80747e1f7ad92f5 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 3 Jun 2024 18:50:59 +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/api/index.js | 1 + src/pages/match/add/step3.vue | 62 +++++++++++++++++--------- src/pages/match/manage/matchSignup.vue | 7 +-- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 5a9747a..15761b2 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -230,6 +230,7 @@ export default { batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`, deleteAllData: `competition/competition/registration/deleteAllData`, whetherThereIsReport: `competition/competitionAutomaticAllocationRecord/whetherThereIsReport`, + closePopup: `competition/competitionAutomaticAllocationRecord/closePopup`, competionPersonTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E6%95%99%E5%B8%88%E7%AB%AF%E4%B8%AA%E4%BA%BA%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 教师端个人报名人员模板 competionTeamTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E6%95%99%E5%B8%88%E7%AB%AF%E5%9B%A2%E9%98%9F%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 教师端团队报名人员导入模板 exportAbnormalData: `${host}competition/teamAbnormalInformation/exportAbnormalData`, diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index 395d227..f89698f 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -85,6 +85,16 @@ + + +

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

+ 不再提示 + + + 关闭 + +
@@ -139,6 +149,9 @@ export default { curStep: 0, pass: 0, curOriginForm: {}, + + closeStatus: false, + tipsVisible: false, }; }, components: { @@ -300,6 +313,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, { @@ -310,41 +329,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) } }, // 提交 diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue index 2b512a1..66976bd 100644 --- a/src/pages/match/manage/matchSignup.vue +++ b/src/pages/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)