|
|
|
@ -361,7 +361,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 自动分配人员 |
|
|
|
|
async automaticAllocation (assignOrNot, next) { |
|
|
|
|
await this.$post(this.api.automaticAllocationSave, { |
|
|
|
|
await this.$post(this.api.updateEventAllocationRecord, { |
|
|
|
|
assignOrNot, |
|
|
|
|
competitionId: this.competitionId, |
|
|
|
|
}) |
|
|
|
@ -369,18 +369,40 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 自动分配人员弹框 |
|
|
|
|
async autoAllocationConfirm (next) { |
|
|
|
|
// 新增 |
|
|
|
|
this.$confirm('<p>团队赛已发布,是否要自动分配阶段人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会给报名的团队自动分配阶段参赛人员</p>', '提示', { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否', |
|
|
|
|
type: 'success', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
}).then(() => { |
|
|
|
|
this.automaticAllocation(1, next) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.automaticAllocation(0, next) |
|
|
|
|
}); |
|
|
|
|
if (this.form[0].contentId) { |
|
|
|
|
// 编辑的时候查询是否需要弹框选择重新分配 |
|
|
|
|
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.id}`) |
|
|
|
|
if (res.popupState) { |
|
|
|
|
this.$confirm('报名的团队将按照新设置的规则进行自动分配阶段参赛人员,当前已分配的阶段参赛人员是否需要保留?', '提示', { |
|
|
|
|
cancelButtonText: '已分配的保留', |
|
|
|
|
confirmButtonText: '全部重新分配', |
|
|
|
|
type: 'success', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
showClose: false, |
|
|
|
|
}).then(async () => { |
|
|
|
|
await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
// this.automaticAllocation(0, next) |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 新增 |
|
|
|
|
this.$confirm('<p>团队赛已发布,是否要自动分配阶段人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', { |
|
|
|
|
confirmButtonText: '是', |
|
|
|
|
cancelButtonText: '否', |
|
|
|
|
type: 'success', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
}).then(() => { |
|
|
|
|
this.automaticAllocation(1, next) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.automaticAllocation(0, next) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
save (status, next = 0) { |
|
|
|
@ -477,7 +499,8 @@ export default { |
|
|
|
|
// 新增赛事,并且点的是发布按钮,则发布该赛事 |
|
|
|
|
status && this.publish(status) |
|
|
|
|
util.successMsg((status ? '发布' : '保存') + '成功') |
|
|
|
|
if (this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && !form[0].contentId) { |
|
|
|
|
this.updateTime = 0 |
|
|
|
|
if (this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType) { |
|
|
|
|
this.autoAllocationConfirm() // 团队并且第一次发布才需要弹框询问是否自动分配人员 |
|
|
|
|
} else { |
|
|
|
|
this.$emit('next', next) |
|
|
|
|