|
|
|
@ -132,7 +132,13 @@ |
|
|
|
|
<!-- 个人报名(有赛事邀请码的情况,没有赛事邀请码的情况不用弹框,直接报名成功) --> |
|
|
|
|
<el-dialog title="报名" :visible.sync="peopleSignupVisible" :close-on-click-modal="false" width="300px"> |
|
|
|
|
<el-form class="dia-form"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-form-item label="来自学校"> |
|
|
|
|
<el-select v-model="peopleSignupForm.realSchoolId" filterable style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="curItem.isNeedCode"> |
|
|
|
|
<el-input placeholder="请输入4位数大赛邀请码" maxlength="4" |
|
|
|
|
v-model="peopleSignupForm.registrationInvitationCode"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
@ -209,8 +215,13 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog v-else title="报名" :visible.sync="enterVisible" :close-on-click-modal="false" width="300px"> |
|
|
|
|
<el-form class="dia-form"> |
|
|
|
|
<p style="margin-bottom: 5px">请选择要加入的团队</p> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-form-item label="来自学校"> |
|
|
|
|
<el-select v-model="enterForm.realSchoolId" filterable style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="请选择要加入的团队"> |
|
|
|
|
<el-select class="w-100" v-model="enterForm.teamId" filterable> |
|
|
|
|
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -350,6 +361,7 @@ export default { |
|
|
|
|
curItem: {}, |
|
|
|
|
peopleSignupVisible: false, |
|
|
|
|
peopleSignupForm: { |
|
|
|
|
realSchoolId: '', |
|
|
|
|
registrationInvitationCode: '' |
|
|
|
|
}, |
|
|
|
|
curRow: {}, |
|
|
|
@ -375,7 +387,7 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
this.$once('hook:beforeDestroy', this.clearTimer) |
|
|
|
|
|
|
|
|
|
if (this.fromOffical && this.token) { |
|
|
|
|
if (this.token) { |
|
|
|
|
this.getCurSchool() |
|
|
|
|
this.getSchool() |
|
|
|
|
} |
|
|
|
@ -569,7 +581,7 @@ export default { |
|
|
|
|
async peopleSignupSubmit () { |
|
|
|
|
await this.$post(this.api.addCompetitionRegistration, { |
|
|
|
|
competitionId: this.curRow.id, |
|
|
|
|
registrationInvitationCode: this.peopleSignupForm.registrationInvitationCode |
|
|
|
|
...this.peopleSignupForm |
|
|
|
|
}) |
|
|
|
|
this.peopleSignupVisible = false |
|
|
|
|
this.getData() |
|
|
|
@ -654,6 +666,7 @@ export default { |
|
|
|
|
if (this.teamNameRepeat) return Util.errorMsg('团队名称重复,请重新输入') |
|
|
|
|
if (form.invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码') |
|
|
|
|
if (this.curItem.isNeedCode && !form.registrationInvitationCode) return Util.errorMsg('请输入大赛邀请码') |
|
|
|
|
form.realSchoolId = this.enterForm.realSchoolId |
|
|
|
|
this.$post(this.api.addCompetitionTeam, form).then(res => { |
|
|
|
|
this.teamVisible = false |
|
|
|
|
this.enterVisible = false |
|
|
|
@ -741,30 +754,21 @@ export default { |
|
|
|
|
if (competitionType || this.fromOffical) { |
|
|
|
|
this.getTeam() |
|
|
|
|
this.enterForm = { |
|
|
|
|
realSchoolId: '', |
|
|
|
|
realSchoolId: this.curRealSchoolId, |
|
|
|
|
competitionId: id, |
|
|
|
|
teamId: '', |
|
|
|
|
invitationCode: '', |
|
|
|
|
registrationInvitationCode: '' |
|
|
|
|
} |
|
|
|
|
this.enterVisible = true |
|
|
|
|
if (this.fromOffical) { |
|
|
|
|
this.agreeCheck = false |
|
|
|
|
this.enterForm.realSchoolId = this.curRealSchoolId |
|
|
|
|
} |
|
|
|
|
this.agreeCheck = false |
|
|
|
|
} else { // 个人赛报名 |
|
|
|
|
if (item.isNeedCode) { |
|
|
|
|
this.curRow = item |
|
|
|
|
this.peopleSignupForm.registrationInvitationCode = '' |
|
|
|
|
this.peopleSignupVisible = true |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.addCompetitionRegistration, { |
|
|
|
|
competitionId: id |
|
|
|
|
}).then(res => { |
|
|
|
|
this.getData() |
|
|
|
|
this.$message.success('报名成功') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
this.curRow = item |
|
|
|
|
this.peopleSignupForm = { |
|
|
|
|
realSchoolId: this.curRealSchoolId, |
|
|
|
|
registrationInvitationCode: '', |
|
|
|
|
} |
|
|
|
|
this.peopleSignupVisible = true |
|
|
|
|
} |
|
|
|
|
} else if (status == 1) { |
|
|
|
|
// 已报名,点击取消报名 |
|
|
|
|