|
|
|
@ -85,6 +85,16 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<set v-if="setVisible" :form.sync="form[curStep]" :step1.sync="step1" @hideSet="hideSet" /> |
|
|
|
|
|
|
|
|
|
<el-dialog title="提示" :visible.sync="tipsVisible" width="500px" :close-on-click-modal="false"> |
|
|
|
|
<p style="margin-bottom: 15px;line-height: 1.6"> |
|
|
|
|
团队赛发布成功,若有修改报名时间、赛程与规则,修改不会影响已经分配的阶段参赛人员,但后面加入报名的将不再自动分配,如需将已分配的重新分配和新加入报名的进行分配,请前往报名人员列表设置全部重新分配</p> |
|
|
|
|
<el-checkbox v-model="closeStatus">不再提示</el-checkbox> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button size="small" type="primary" @click="closePopup">关闭</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -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('<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) |
|
|
|
|
}) |
|
|
|
|
} 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>', '提示', { |
|
|
|
|
const now = await Util.getNow() |
|
|
|
|
// 报名结束时间还没到 |
|
|
|
|
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) { |
|
|
|
|
this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</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) |
|
|
|
|
}).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) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|