赛事修复

dev_review
yujialong 6 months ago
parent d3c9cc9876
commit 23986d7b7e
  1. 2
      src/utils/api.js
  2. 3
      src/views/match/add/step1.vue
  3. 1
      src/views/match/add/step2.vue
  4. 44
      src/views/match/add/step3.vue
  5. 2
      src/views/match/manage/abnormalTeam.vue
  6. 10
      src/views/match/manage/matchInfo.vue
  7. 16
      src/views/match/manage/matchSignup.vue

@ -386,9 +386,11 @@ export default {
schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`, schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`,
batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`, batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`,
deleteAllData: `competition/competition/registration/deleteAllData`, deleteAllData: `competition/competition/registration/deleteAllData`,
whetherThereIsReport: `competition/competitionAutomaticAllocationRecord/whetherThereIsReport`,
batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`, batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`,
batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`, batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`,
TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`, TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`,
exportAbnormalData: `${host}competition/teamAbnormalInformation/exportAbnormalData`,
// 赛事公告 // 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`, addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`, amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,

@ -609,11 +609,12 @@ export default {
const now = await Util.getNow() const now = await Util.getNow()
// //
if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && new Date(signUpEndTime) < now) { if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && (new Date(signUpEndTime) < now || (new Date(this.originSignUpEndTime) < now && new Date(signUpEndTime) > now))) {
await this.$post(this.api.updateEventAllocationRecord, { await this.$post(this.api.updateEventAllocationRecord, {
competitionId: id, competitionId: id,
whetherToModifyTheRule: 1, whetherToModifyTheRule: 1,
}) })
this.originSignUpEndTime = signUpEndTime
} }
} }
}, },

@ -330,6 +330,7 @@ export default {
break break
} }
} }
// new Date(this.$parent.$refs.step1.form.signUpEndTime)
if (form.rule !== originForm.rule || form.stageNum !== originForm.stageNum || form.teamLimit !== originForm.teamLimit || changeLimit) { if (form.rule !== originForm.rule || form.stageNum !== originForm.stageNum || form.teamLimit !== originForm.teamLimit || changeLimit) {
await this.$post(this.api.updateEventAllocationRecord, { await this.$post(this.api.updateEventAllocationRecord, {
competitionId: +this.id, competitionId: +this.id,

@ -319,7 +319,7 @@ export default {
// //
async autoAllocationConfirm (next) { async autoAllocationConfirm (next) {
const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`) 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 // or
this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', { this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', {
confirmButtonText: '是', confirmButtonText: '是',
@ -333,31 +333,25 @@ export default {
this.automaticAllocation(0, next) this.automaticAllocation(0, next)
}) })
} else { } else {
const now = await Util.getNow() //
// > const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`)
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) { if (res.popupState) {
this.$emit('next', next) this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', {
} else { confirmButtonText: '是',
// cancelButtonText: '否',
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) type: 'success',
if (res.popupState) { closeOnClickModal: false,
this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', { showClose: false,
confirmButtonText: '是', dangerouslyUseHTMLString: true,
cancelButtonText: '否', }).then(async () => {
type: 'success', await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) //
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) this.$emit('next', next)
} }).catch(() => {
this.automaticAllocation(0, next)
})
} else {
//
this.$emit('next', next)
} }
} }
}, },

@ -563,7 +563,7 @@ export default {
this.exporting = false this.exporting = false
}) })
} else { } else {
axios.get(`${this.api.excelExport}?competitionId=${this.id}`, { axios.get(`${this.api.exportAbnormalData}?competitionId=${this.id}`, {
headers: { headers: {
token: this.token token: this.token
}, },

@ -6,7 +6,7 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20" v-loading="loading">
<div style="display: flex;align-items: center"> <div style="display: flex;align-items: center">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10"> <table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10">
<tr> <tr>
@ -229,6 +229,7 @@ export default {
return { return {
id: +this.$route.query.id, id: +this.$route.query.id,
accountId: +this.$route.query.accountId, accountId: +this.$route.query.accountId,
loading: false,
status: 5, status: 5,
form: { form: {
competitionStage: [], competitionStage: [],
@ -296,6 +297,7 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
this.loading = true
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition this.form = competition
this.timer = setInterval(this.handleStatus, 1000) this.timer = setInterval(this.handleStatus, 1000)
@ -335,6 +337,7 @@ export default {
}) })
this.info = info this.info = info
this.form.completeCompetitionSetup.competitionType && this.getErrorInfo() this.form.completeCompetitionSetup.competitionType && this.getErrorInfo()
this.loading = false
}).catch(err => { }); }).catch(err => { });
}, },
// //
@ -344,7 +347,8 @@ export default {
teamId: this.info.teamId teamId: this.info.teamId
}) })
this.teamErrors = res.teamTip.split(';').filter(e => e) this.teamErrors = res.teamTip.split(';').filter(e => e)
if (Object.keys(res.stageTip)) {
if (Object.keys(res.stageTip).length) {
this.stageTip = res.stageTip this.stageTip = res.stageTip
} }
}, },
@ -529,7 +533,7 @@ export default {
this.chooses = this.info.teamDetail this.chooses = this.info.teamDetail
} }
this.curRow = row this.curRow = row
this.checkedMembers = row.participants.map(e => e.id) this.checkedMembers = row.participants ? row.participants.map(e => e.id) : []
this.chooseVisible = true this.chooseVisible = true
} }
}, },

@ -18,7 +18,8 @@
</ul> </ul>
<div> <div>
<el-button v-if="loaded && info.completeCompetitionSetup.competitionType" type="primary" round <el-button v-if="loaded && info.completeCompetitionSetup.competitionType" type="primary" round
:loading="allocating" @click="autoAllocationConfirm">{{ !notBeginSign && allocated ? '取消' : '' :disabled="hasReport" :loading="allocating" @click="autoAllocationConfirm">{{ !notBeginSign && allocated ?
'取消' : ''
}}自动分配阶段成员</el-button> }}自动分配阶段成员</el-button>
<el-button type="primary" round @click="batchImport">导入</el-button> <el-button type="primary" round @click="batchImport">导入</el-button>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button> <el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
@ -284,6 +285,7 @@ export default {
now: '', now: '',
notBeginSign: true, notBeginSign: true,
allocated: true, allocated: true,
hasReport: false,
allocating: false, allocating: false,
loaded: 0, loaded: 0,
}; };
@ -348,21 +350,27 @@ export default {
// //
if (this.info.completeCompetitionSetup.competitionType) { if (this.info.completeCompetitionSetup.competitionType) {
this.getAutomaticAllocation()
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
// / // /
clearInterval(this.timer) clearInterval(this.timer)
this.now = await Util.getNow() this.now = await Util.getNow()
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
this.getAutomaticAllocation()
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
}, 1000) }, 1000)
} }
}, },
// //
async getAutomaticAllocation () { async getAutomaticAllocation () {
//
const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`) const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`)
this.allocated = res.data && res.data.assignOrNot this.allocated = res.data && res.data.assignOrNot
//
const res1 = await this.$post(`${this.api.whetherThereIsReport}?competitionId=${this.id}`)
this.hasReport = res1.hasReport
this.allocating = false this.allocating = false
this.loaded = 1 this.loaded = 1
}, },

Loading…
Cancel
Save