|
|
|
@ -319,7 +319,7 @@ export default { |
|
|
|
|
// 自动分配人员弹框 |
|
|
|
|
async autoAllocationConfirm (next) { |
|
|
|
|
const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`) |
|
|
|
|
if (data.assignOrNot === undefined || !this.form[0].contentId) { |
|
|
|
|
if (!data || data.assignOrNot === undefined || !this.form[0].contentId) { |
|
|
|
|
// 首次发布 or 新增 才需要弹框 |
|
|
|
|
this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
@ -333,31 +333,25 @@ export default { |
|
|
|
|
this.automaticAllocation(0, next) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
const now = await Util.getNow() |
|
|
|
|
// 报名结束时间>当前时间 |
|
|
|
|
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) { |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
} else { |
|
|
|
|
// 查询是否需要弹框 |
|
|
|
|
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) |
|
|
|
|
if (res.popupState) { |
|
|
|
|
this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', { |
|
|
|
|
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) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.automaticAllocation(0, next) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
// 无需弹框 |
|
|
|
|
// 查询是否需要弹框 |
|
|
|
|
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) |
|
|
|
|
if (res.popupState) { |
|
|
|
|
this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', { |
|
|
|
|
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) |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.automaticAllocation(0, next) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
// 无需弹框 |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|