大赛修复

Branch_d40a2540
yujialong 2 years ago
parent 7f861789d1
commit 23f779cfa0
  1. 55
      src/api/index.js
  2. 6
      src/const/match.js
  3. 86
      src/pages/match/add/index.vue
  4. 16
      src/pages/match/add/step1.vue
  5. 31
      src/pages/match/add/step2.vue
  6. 17
      src/pages/match/add/step3.vue
  7. 132
      src/pages/match/list/index.vue
  8. 39
      src/pages/match/manage/index.vue
  9. 5
      src/pages/match/manage/matchArch.vue
  10. 28
      src/pages/match/manage/matchArchList.vue
  11. 89
      src/pages/match/manage/matchInfo.vue
  12. 13
      src/pages/match/manage/matchRank.vue
  13. 4
      src/pages/match/manage/matchReport.vue
  14. 35
      src/pages/match/manage/matchSignup.vue
  15. 58
      src/pages/match/preview/index.vue
  16. 22
      src/router/modules/match.js
  17. 2
      src/setting.js

@ -76,7 +76,7 @@ export default {
// 成绩管理 // 成绩管理
deleteExperimentalReport: `occupationlab/occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告 deleteExperimentalReport: `occupationlab/occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告
exportAssessmentInfo: `${host}occupationlab/occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩 exportAssessmentInfo: `${host}occupationlab/occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
exportPracticeInfo: `${host}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩 exportPracticeInfo: `${host2}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
getAchievementInfo: `occupationlab/occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理 getAchievementInfo: `occupationlab/occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理
getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情 getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情
getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情 getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
@ -122,7 +122,7 @@ export default {
getCompetition: `competition/competition/management/getCompetition`, getCompetition: `competition/competition/management/getCompetition`,
getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`, getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`,
publishCompetition: `competition/competition/management/publishCompetition`, publishCompetition: `competition/competition/management/publishCompetition`,
detailsOfCompetitionStage: `${host1}competition/competition/management/detailsOfCompetitionStage`, detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`, entryInformation: `competition/competition/team/entryInformation`,
getCustomerOrder: `nakadai/nakadai/valueModuleManagement/getCustomerOrder`, getCustomerOrder: `nakadai/nakadai/valueModuleManagement/getCustomerOrder`,
curriculumList: `nakadai/nakadai/curriculum/schoolCourse`, curriculumList: `nakadai/nakadai/curriculum/schoolCourse`,
@ -133,6 +133,10 @@ export default {
editCompetitionContent: `competition/competition/content/editCompetitionContent`, editCompetitionContent: `competition/competition/content/editCompetitionContent`,
getCompetitionContent: `competition/competition/content/getCompetitionContent`, getCompetitionContent: `competition/competition/content/getCompetitionContent`,
// 赛事附件 // 赛事附件
delComAnnex: `competition/competition/annex/delete`,
saveComAnnex: `competition/competition/annex/save`,
updateComAnnex: `competition/competition/annex/update`,
// 赛事公告附件
delAnnex: `competition/competition/announcementAnnex/delete`, delAnnex: `competition/competition/announcementAnnex/delete`,
saveAnnex: `competition/competition/announcementAnnex/save`, saveAnnex: `competition/competition/announcementAnnex/save`,
updateAnnex: `competition/competition/announcementAnnex/update`, updateAnnex: `competition/competition/announcementAnnex/update`,
@ -168,6 +172,7 @@ export default {
stageSelectParticipants: `competition/competition/teamParticipant/stageSelectParticipants`, stageSelectParticipants: `competition/competition/teamParticipant/stageSelectParticipants`,
updateUser: `users/users/userInfo/updateUser`, updateUser: `users/users/userInfo/updateUser`,
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`, enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`,
// 赛事公告 // 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`, addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`, amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
@ -177,26 +182,26 @@ export default {
queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`, queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`,
saveAnnouncementAnnex: `competition/competition/announcementAnnex/save`, saveAnnouncementAnnex: `competition/competition/announcementAnnex/save`,
// 赛事成绩 // 赛事成绩
batchDeleteContestGrade: `${host1}competition/competition/performance/batchDeleteContestGrade`, batchDeleteContestGrade: `competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`, batchImportGrades: `competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host1}competition/competition/performance/exportExperimentalResultsInBatch`, exportExperimentalResultsInBatch: `competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `${host1}competition/competition/performance/exportFailure`, performanceExportFailure: `competition/competition/performance/exportFailure`,
rankExportFailure: `${host1}competition/competition/rank/exportFailure`, rankExportFailure: `competition/competition/rank/exportFailure`,
stageGradeManagementList: `${host1}competition/competition/performance/stageGradeManagementList`, stageGradeManagementList: `competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `${host1}competition/competition/rank/stageRaceRanking`, stageRaceRanking: `competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `${host1}competition/competition/rank/overallStandingsInThePointsRace`, overallStandingsInThePointsRace: `competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `${host1}competition/competition/rank/batchImportRanking`, batchImportRanking: `competition/competition/rank/batchImportRanking`,
publishRanking: `${host1}competition/competition/rank/publishRanking`, publishRanking: `competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `${host1}competition/competition/rank/stageTeamScoreDetails`, stageTeamScoreDetails: `competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `${host1}competition/competition/rank/multipleStageTeamScoreDetails`, multipleStageTeamScoreDetails: `competition/competition/rank/multipleStageTeamScoreDetails`,
detailsOfTotalTeamScores: `${host1}competition/competition/rank/detailsOfTotalTeamScores`, detailsOfTotalTeamScores: `competition/competition/rank/detailsOfTotalTeamScores`,
cancelRanking: `${host1}competition/competition/rank/cancelRanking`, cancelRanking: `competition/competition/rank/cancelRanking`,
reportDetail: `${host1}occupationlab/occupationlab/achievement/reportDetail`, reportDetail: `occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `${host1}competition/competition/rank/deleteLastPublication`, deleteLastPublication: `competition/competition/rank/deleteLastPublication`,
whetherToPublish: `${host1}competition/competition/rank/whetherToPublish`, whetherToPublish: `competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`, manuallyRankTheUploadList: `competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`, queryPublicationSource: `competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`, releaseVerification: `competition/competition/rank/releaseVerification`,
gradeImport: `${host2}template/赛事成绩导入模板.xlsx`, gradeImport: `${host2}template/赛事成绩导入模板.xlsx`,
rankImportTeam: `${host2}template/赛事排名导入模板(团队赛).xlsx`, rankImportTeam: `${host2}template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `${host2}template/赛事排名导入模板(个人赛).xlsx`, rankImportPerson: `${host2}template/赛事排名导入模板(个人赛).xlsx`,
@ -329,8 +334,8 @@ export default {
querySubject: `kdSys/querySubject`, querySubject: `kdSys/querySubject`,
queryItem: `kdSys/queryItem`, queryItem: `kdSys/queryItem`,
// 川大 // 川大
firstLevel: `${host1}sichuan/point/firstLevel`, firstLevel: `sichuan/point/firstLevel`,
secondaryLevel: `${host1}sichuan/point/secondaryLevel`, secondaryLevel: `sichuan/point/secondaryLevel`,
thirdLevel: `${host1}sichuan/point/thirdLevel` thirdLevel: `sichuan/point/thirdLevel`
}; };

@ -34,15 +34,15 @@
teamCalculationMethods: [ teamCalculationMethods: [
{ {
id: 0, id: 0,
name: '最高分' name: '最高分'
}, },
{ {
id: 1, id: 1,
name: '平均分' name: '平均分'
}, },
{ {
id: 2, id: 2,
name: '总分' name: '求和'
} }
], ],
} }

@ -5,17 +5,17 @@
<el-page-header @back="back" :content="'创建赛事'"></el-page-header> <el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px"> <div v-if="hasPer">
<template v-if="step === 1 || (id && !editing)"> <div v-if="step === 1 || (id && !editing)" :class="['type-wrap', {pd: !id}]">
<div class="p-title">大赛发布类型</div> <div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''"> <el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型"> <el-form-item label="请选择类型">
<el-radio v-model="releaseType" :label="0">仅发布信息</el-radio> <el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name }}</el-radio>
<el-radio v-model="releaseType" :label="1">设置完整比赛</el-radio>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1">编辑</el-button> <el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
</template> </div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id}]"> <ul :class="['steps', {pointer: !editing && id}]">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)"> <li :class="{active: step === 1,done: step > 1}" @click="toStep(1)">
<span class="circle">1</span> <span class="circle">1</span>
@ -37,6 +37,8 @@
</li> </li>
</ul> </ul>
</el-card> </el-card>
</div>
<el-button v-else-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" /> <step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
@ -46,14 +48,14 @@
<div v-if="step !== 4 && showBtns" class="btns"> <div v-if="step !== 4 && showBtns" class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 --> <!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id"> <div v-if="editing || !id" class="m-r-10">
<el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button> <el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button> <el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button>
<el-button v-if="!releaseType || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button> <el-button v-if="releaseType == 0" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button> <el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</template> </div>
<el-button type="danger" @click="preview">预览</el-button> <el-button type="danger" @click="preview" v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button>
<el-button @click="back">取消</el-button> <el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -73,6 +75,17 @@ export default {
data() { data() {
return { return {
id: this.$route.query.id || '', id: this.$route.query.id || '',
hasPer: false,
releaseTypes: [
{
id: 0,
name: '仅发布信息'
},
{
id: 1,
name: '设置完整比赛'
}
],
publishStatus: 0, publishStatus: 0,
competitionId: '', competitionId: '',
step: 1, step: 1,
@ -93,9 +106,20 @@ export default {
step4 step4
}, },
mounted() { mounted() {
this.getPer()
}, },
methods: { methods: {
// true
getPer() {
this.$get(this.api.isClient).then(({ customerId }) => {
customerId && this.$get(this.api.getCustomerOrder, {
customerId
}).then(({ show }) => {
this.hasPer = show
show || this.$parent.hideArch()
}).catch(err => {})
}).catch(res => {})
},
// loading // loading
showLoad() { showLoad() {
this.loadIns = Loading.service() this.loadIns = Loading.service()
@ -112,12 +136,11 @@ export default {
prev() { prev() {
// //
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (updateTime) { if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.save(0) this.save(0, 1)
}).catch(() => { }).catch(() => {
this.step-- this.step--
}) })
@ -137,6 +160,8 @@ export default {
this.competitionId = competitionId this.competitionId = competitionId
} }
this.step++ this.step++
} else if (next === 1) {
this.step--
} }
}, },
// //
@ -148,6 +173,27 @@ export default {
util.local.set('match', this.$refs.step1.form) util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/matchPreview').href) window.open(this.$router.resolve('/matchPreview').href)
}, },
//
cancel() {
//
if (this.editing && this.$route.query.name) {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0, 3)
}).catch(() => {
this.editing = false
})
} else {
this.editing = false
}
} else {
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}
},
back() { back() {
// //
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
@ -165,13 +211,21 @@ export default {
} }
}, },
backPage() { backPage() {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) this.$router.push(`/match?page=${this.$store.state.match.page}`)
} }
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.type-wrap {
position: relative;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
}
.edit { .edit {
position: absolute; position: absolute;
top: 30px; top: 30px;
@ -246,6 +300,8 @@ export default {
} }
} }
.btns { .btns {
display: flex;
justify-content: center;
text-align: center; text-align: center;
} }
</style> </style>

@ -369,6 +369,7 @@ export default {
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => { id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => {
this.$parent.publishStatus = competition.publishStatus this.$parent.publishStatus = competition.publishStatus
this.$parent.releaseType = competition.releaseType this.$parent.releaseType = competition.releaseType
if (!competition.releaseType) this.$parent.editing = 1 //
this.$parent.setupId = competition.completeCompetitionSetup.setupId this.$parent.setupId = competition.completeCompetitionSetup.setupId
if (competition.signUpStartTime) this.signupTime = [competition.signUpStartTime, competition.signUpEndTime] if (competition.signUpStartTime) this.signupTime = [competition.signUpStartTime, competition.signUpEndTime]
if (competition.playStartTime) this.playTime = [competition.playStartTime, competition.playEndTime] if (competition.playStartTime) this.playTime = [competition.playStartTime, competition.playEndTime]
@ -522,13 +523,13 @@ export default {
const file = res.data.filesResult const file = res.data.filesResult
const { id } = this.form const { id } = this.form
const data = { const data = {
contestId: id || '', competitionId: id || '',
fileName: this.fileName, fileName: this.fileName,
filePath: file.fileUrl || file.fileId filePath: file.fileUrl || file.fileId
} }
this.form.competitionAnnexList.push(data) this.form.competitionAnnexList.push(data)
// //
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {}) id && this.$post(this.api.saveComAnnex, data).then(res => {}).catch(res => {})
}, },
// //
beforeUpload(file) { beforeUpload(file) {
@ -565,7 +566,7 @@ export default {
const { url, name } = file const { url, name } = file
url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {}) url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {})
const id = this.form.competitionAnnexList.find(e => e.fileName === name).id const id = this.form.competitionAnnexList.find(e => e.fileName === name).id
id && this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {}) id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => {}).catch(res => {})
}, },
// //
randomInv() { randomInv() {
@ -586,8 +587,8 @@ export default {
form.sponsor = this.sponsorList.filter(d => d).join(); form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join(); form.undertaker = this.undertakerList.filter(d => d).join();
if (!form.name) return util.warningMsg("请填写竞赛名称"); if (!form.name) return util.warningMsg("请填写竞赛名称");
// //
// if (status) { if (next === 2) {
if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校') if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return util.warningMsg("请填写主办方"); if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间"); if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
@ -613,14 +614,16 @@ export default {
} }
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码') if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return util.warningMsg("请填写竞赛详情"); if (!form.description) return util.warningMsg("请填写竞赛详情");
// } }
this.$parent.showLoad() this.$parent.showLoad()
form.publishStatus = status form.publishStatus = status
form.ztOpen = status ? 0 : 1 // form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id form.id = this.$route.query.id
if (form.id) { if (form.id) {
this.$post(this.api.editCompetition, form).then(res => { this.$post(this.api.editCompetition, form).then(res => {
this.updateTime = 0
this.$parent.hideLoad() this.$parent.hideLoad()
util.successMsg("修改成功"); util.successMsg("修改成功");
this.$emit('next', next) this.$emit('next', next)
@ -629,6 +632,7 @@ export default {
}); });
} else { } else {
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => { this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => {
this.updateTime = 0
this.$parent.hideLoad() this.$parent.hideLoad()
util.successMsg("创建成功"); util.successMsg("创建成功");
this.$emit('next', next, setupId, competitionId) this.$emit('next', next, setupId, competitionId)

@ -92,7 +92,7 @@
<span class="req">*</span> <span class="req">*</span>
成绩公布时间 成绩公布时间
阶段比赛结束后 阶段比赛结束后
<el-input v-model="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input> <el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
</div> </div>
<div class="line"> <div class="line">
@ -124,7 +124,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="resultAnnouncementTime" label="成绩公布时间"> <el-form-item prop="resultAnnouncementTime" label="成绩公布时间">
阶段比赛结束后 阶段比赛结束后
<el-input v-model="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input> <el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
</el-form-item> </el-form-item>
<el-form-item prop="resultsDetails" label="是否公布成绩详情"> <el-form-item prop="resultsDetails" label="是否公布成绩详情">
@ -290,12 +290,16 @@ export default {
}, },
// //
save(status, next = 0) { save(status, next = 0) {
const { form } = this let { form } = this
const { rule } = form const { rule } = form
let invalid = 0 let invalid = 0
let pointWeight = 0 let pointWeight = 0
const { step1 } = this const { step1 } = this
for (const e of form.competitionStageList) { //
if (next === 2) {
const stages = form.competitionStageList
for (const i in stages) {
const e = stages[i]
if (rule !== 2 && !e.stageName) { if (rule !== 2 && !e.stageName) {
invalid = 1 invalid = 1
util.errorMsg('请输入阶段名称') util.errorMsg('请输入阶段名称')
@ -313,6 +317,12 @@ export default {
} }
pointWeight += e.pointWeight // pointWeight += e.pointWeight //
} else if (rule === 1) { // } else if (rule === 1) { //
// ()
if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') {
invalid = 1
util.errorMsg('请至少填写一条晋级规则')
break
}
if (e.score !== '') e.scoreLimit = e.operator + e.score if (e.score !== '') e.scoreLimit = e.operator + e.score
} }
if (rule !== 2 && competitionType && e.teamNumLimitOpt) { if (rule !== 2 && competitionType && e.teamNumLimitOpt) {
@ -331,7 +341,6 @@ export default {
} }
} }
if (!e.resultsDetails) { if (!e.resultsDetails) {
e.resultAnnouncementTime = +e.resultAnnouncementTime
if (e.resultAnnouncementTime === '') { if (e.resultAnnouncementTime === '') {
invalid = 1 invalid = 1
util.errorMsg('请填写成绩公布时间') util.errorMsg('请填写成绩公布时间')
@ -342,10 +351,22 @@ export default {
util.errorMsg('成绩公布时间不得小于0') util.errorMsg('成绩公布时间不得小于0')
break break
} }
if (e.resultAnnouncementTime % 1) {
invalid = 1
util.errorMsg('成绩公布时间须为整数')
break
}
e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
} }
if (invalid) return if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
}
for (const e of form.competitionStageList) {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0
}
this.$parent.showLoad() this.$parent.showLoad()
if (form.ruleId) { if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {

@ -136,7 +136,11 @@ export default {
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => { this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => {
res.competitionStages.map(e => { res.competitionStages.map(e => {
const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm)) const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm))
if (form.startTime) form.time = [form.startTime, form.endTime] if (form.startTime) {
form.time = [form.startTime, form.endTime]
} else {
form.time = []
}
form.offlineButton = !!form.offlineButton form.offlineButton = !!form.offlineButton
form.onlineButton = !!form.onlineButton form.onlineButton = !!form.onlineButton
form.method = e.method form.method = e.method
@ -193,6 +197,14 @@ export default {
// //
save(status, next = 0) { save(status, next = 0) {
const { form } = this const { form } = this
if (!form.length) {
this.$parent.hideLoad()
util.successMsg('保存成功')
this.$emit('next', next)
return
}
//
if (status) {
let invalid = 0 let invalid = 0
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
for (const e of form) { for (const e of form) {
@ -238,6 +250,7 @@ export default {
} }
} }
if (invalid) return if (invalid) return
}
// //
for (const e of form) { for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0 e.offlineButton = e.offlineButton ? 1 : 0
@ -247,9 +260,9 @@ export default {
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form competitionContents: form
}).then(res => { }).then(res => {
this.$parent.hideLoad()
// //
!form[0].contentId && status && this.publish(status) !form[0].contentId && status && this.publish(status)
this.$parent.hideLoad()
util.successMsg((status ? '发布' : '保存') + '成功') util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next) this.$emit('next', next)
}).catch(err => { }).catch(err => {

@ -39,8 +39,8 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="add">创建竞赛</el-button> <el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div> </div>
</div> </div>
@ -71,11 +71,13 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.playingStages && scope.row.playingStages.length" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
<el-button v-auth type="text" @click="manage(scope.row)">管理</el-button> <el-button v-auth type="text" @click="manage(scope.row)">管理</el-button>
<el-button v-auth type="text" @click="delData(scope.row)">删除</el-button> <el-button v-auth type="text" @click="delData(scope.row)">删除</el-button>
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 --> <!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 -->
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 --> <!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 -->
<el-switch <el-switch
v-if="scope.row.publishStatus"
v-auth="'禁用'" v-auth="'禁用'"
v-model="scope.row.isOpen" v-model="scope.row.isOpen"
:active-value="0" :active-value="0"
@ -91,6 +93,32 @@
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false">
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center">
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column>
<el-table-column label="竞赛起止时间" width="300" align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="结束时间调整为" align="center" width="280">
<template slot-scope="scope">
<el-date-picker
popper-class="no-atTheMoment"
v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="modifyVisible = false"> </el-button>
<el-button size="small" type="primary" @click="modifySubmit"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -149,7 +177,20 @@ export default {
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
transferPublishStatus: [ "未发布", "已发布"] transferPublishStatus: [ "未发布", "已发布"],
modifyVisible: false,
curRow: {
playingStages: []
},
timer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
onClick(picker) {
picker.$emit('pick', new Date(Date.now() + 5000))
}
}]
}
}; };
}, },
watch: { watch: {
@ -200,11 +241,34 @@ export default {
startTime: form.startTime || null, startTime: form.startTime || null,
publishStatus: form.publishStatus === '' ? null : form.publishStatus publishStatus: form.publishStatus === '' ? null : form.publishStatus
}).then(({ data }) => { }).then(({ data }) => {
const { records } = data const list = data.records
records.map(e => { //
this.timer = setInterval(() => {
const now = new Date()
list.map(e => {
if (!e.playingStages) {
this.$set(e, 'playingStages', [])
} else {
e.playingStages = []
}
//
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
//
if (e.competitionStageList) {
for (const n of e.competitionStageList) {
//
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) {
e.playingStages.push(n)
}
}
}
}
})
}, 1000)
list.map(e => {
if (e.ztOpen) e.isOpen = 1 if (e.ztOpen) e.isOpen = 1
}) })
this.matchData = records this.matchData = list
this.total = data.total this.total = data.total
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) { if (!this.matchData.length && this.total) {
@ -215,10 +279,6 @@ export default {
}, },
getData() { getData() {
this.getList() this.getList()
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getList, 1000 * 60)
// }
}, },
initData() { initData() {
this.page = 1; this.page = 1;
@ -227,6 +287,29 @@ export default {
add() { add() {
this.$router.push("/match/add"); this.$router.push("/match/add");
}, },
//
editEndTime(row) {
this.modifyVisible = true
row.newEndTime = ''
this.curRow = row
},
//
modifySubmit() {
const row = this.curRow
const data = []
row.competitionStageList.map(e => {
const stage = row.playingStages.find(n => n.contentId === e.contentId && n.newEndTime)
if (stage && stage.newEndTime) stage.endTime = this.formatDate('yyyy-MM-dd hh:mm:ss', stage.newEndTime)
data.push(stage || e)
})
this.$post(this.api.editCompetitionContent, {
competitionContents: data
}).then(res => {
util.successMsg('修改成功')
this.modifyVisible = false
this.getData()
}).catch(err => {})
},
manage(row) { manage(row) {
this.$router.push(`/match/manage?id=${row.id}&name=${row.competitionName}`) this.$router.push(`/match/manage?id=${row.id}&name=${row.competitionName}`)
}, },
@ -281,40 +364,15 @@ export default {
if (date == "0000-00-00 00:00:00") return "---"; if (date == "0000-00-00 00:00:00") return "---";
return date; return date;
}, },
disable(val, row) { switchOff(val, row) {
this.$post(this.api.disabledEventsCompetition, { this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id, competitionId: row.id,
isOpen: val, isOpen: val,
type: 1 // (01) type: 1 // (01)
}).then(res => { }).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => {}) }).catch(err => {})
}, },
switchOff(val, row, index) {
if (val) {
this.disable(val, row)
} else if (!row.publishStatus) {
this.$confirm('是否发布该大赛?', '提示', {
type: 'success'
}).then(() => {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
row.publishStatus = 1
this.$post(this.api.editContest, row).then(res => {
this.getData()
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.isOpen = 1
})
} else {
this.disable(val, row)
}
}
} }
}; };
</script> </script>

@ -27,6 +27,7 @@ import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress"; import MatchProgress from "./matchProgress";
import notice from "./notice"; import notice from "./notice";
import MatchSignup from "./matchSignup"; import MatchSignup from "./matchSignup";
import { mapState } from "vuex";
export default { export default {
name: "matchManage", name: "matchManage",
data() { data() {
@ -39,7 +40,7 @@ export default {
tab3: "竞赛进展", tab3: "竞赛进展",
tab4: "公告通知", tab4: "公告通知",
tab5: "报名人员" tab5: "报名人员"
} },
}; };
}, },
components: { components: {
@ -49,25 +50,40 @@ export default {
notice, notice,
MatchSignup MatchSignup
}, },
computed: {
...mapState("user", [
'page'
]),
...mapState('auth', [
'btns'
])
},
mounted() { mounted() {
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs()
}, },
methods: { methods: {
initTabs() { initTabs() {
const btns = this.$store.state.btns const { btns } = this
const tab1 = btns.includes('/match:管理:大赛详情') console.log("🚀 ~ file: index.vue:67 ~ initTabs ~ btns", btns)
const tab2 = btns.includes('/match:管理:竞赛进展') const tab1 = btns.includes('/match/list:管理:大赛详情')
const tab3 = btns.includes('/match:管理:公告通知') const tab2 = btns.includes('/match/list:管理:大赛成绩管理')
const tab4 = btns.includes('/match:管理:报名人员') const tab3 = btns.includes('/match/list:管理:竞赛进展')
const tab4 = btns.includes('/match/list:管理:公告通知')
const tab5 = btns.includes('/match/list:管理:报名人员')
tab1 || delete this.tabs.tab1 tab1 || this.$delete(this.tabs, 'tab1')
tab2 || delete this.tabs.tab2 tab2 || this.$delete(this.tabs, 'tab2')
tab3 || delete this.tabs.tab3 tab3 || this.$delete(this.tabs, 'tab3')
tab4 || delete this.tabs.tab4 tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5')
const type = this.$route.query.tab const type = this.$route.query.tab
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0] this.active = keys.includes(type) ? type : keys[0]
}, },
//
hideArch() {
this.$delete(this.tabs, 'tab2')
},
back() { back() {
this.handleSave(0) && this.backPage() this.handleSave(0) && this.backPage()
}, },
@ -95,7 +111,8 @@ export default {
}, },
// //
backPage(){ backPage(){
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) console.log(444, this.$store.state)
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}, },
// tab // tab
tabSwitch(i) { tabSwitch(i) {

@ -79,15 +79,14 @@ export default {
} }
} }
}) })
console.log("🚀 ~ file: matchArch.vue:87 ~ handleStatus ~ this.status", this.list)
}, },
// //
toRank(row, i) { toRank(row, i) {
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`) this.$router.push(`rank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)
}, },
// //
toArch(row) { toArch(row) {
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`) this.$router.push(`archList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`)
} }
} }
}; };

@ -61,7 +61,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="160"> <el-table-column label="操作" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看成绩报告</el-button> <el-button v-if="scope.row.reportId" type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -87,9 +87,13 @@
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="this.api.importStaff" :action="this.api.batchImportGrades"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers"
:data="{
competitionId: this.id,
stageId: this.stageId,
}"
> >
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> <el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
@ -206,9 +210,13 @@ export default {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.reportId; return this.method == 2 ? item.scoreId : item.reportId
}); });
this.$post(this.api.deleteExperimentalReport, ids).then(res => { this.$post(this.api.batchDeleteContestGrade, {
ids,
competitionId: this.id,
stageId: this.stageId
}).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
util.successMsg("删除成功"); util.successMsg("删除成功");
@ -276,7 +284,12 @@ export default {
}, },
// //
showFaild() { showFaild() {
location.href = `${this.api.performanceExportFailure}?exportCode=${this.exportCode}` axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => {})
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false this.uploadFaild = false
@ -306,10 +319,7 @@ export default {
}, },
uploadSure() { uploadSure() {
this.importVisible = false this.importVisible = false
this.studentType = 1 this.getData()
this.keyWord = ''
this.$refs.orgTree.setCurrentKey(null)
this.getOrg()
} }
} }
}; };

@ -1,5 +1,5 @@
<template> <template>
<div> <div style="padding: 0 100px;">
<el-card shadow="hover" class="m-b-20 head-card"> <el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header> <el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header>
@ -7,7 +7,8 @@
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20"> <div style="display: flex;align-items: center">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10">
<tr> <tr>
<th width="150">团队名称</th> <th width="150">团队名称</th>
<td> <td>
@ -22,6 +23,7 @@
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center"> <div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center">
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button> <el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
</div> </div>
</div>
<table class="table"> <table class="table">
<tr> <tr>
<th width="150">姓名</th> <th width="150">姓名</th>
@ -77,7 +79,7 @@
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th> <th width="110">参赛人数限制</th>
<th>允许参赛人员</th> <th>允许参赛人员</th>
<th v-if="info.team.captain === 0 && form.rule === 0">总分</th> <th v-if="form.rule === 0">总分</th>
</template> </template>
<th>竞赛成绩</th> <th>竞赛成绩</th>
</tr> </tr>
@ -87,11 +89,24 @@
<td>{{ item.stageName }}</td> <td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.teamNumLimit || '不限制' }}</td> <td>{{ item.teamNumLimit || '不限制' }}</td>
<td>{{ item.teamParticipantIds || '无' }}</td> <td>
<td v-if="info.team.captain === 0 && form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td> <template v-if="item.participants">
<el-tag
v-for="tag in item.participants"
:key="tag.name"
class="m-r-5"
closable
@close="removePar(tag, item)">
{{tag.name}}
</el-tag>
</template>
<span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i>
</td>
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
</template> </template>
<td> <td>
<span v-if="item.score" class="m-r-10">分数{{item.score}}</span> <span v-if="item.score > 0" class="m-r-10">分数{{item.score}}</span>
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button> <el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button>
</td> </td>
</tr> </tr>
@ -144,7 +159,7 @@
<el-checkbox-group v-model="checkedMembers"> <el-checkbox-group v-model="checkedMembers">
<el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox> <el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<p v-if="info.teamLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制1人参赛且此竞赛每个成员只能参加一个阶段赛项</p> <p v-if="info.teamLimit && curRow.teamNumLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.teamNumLimit }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button> <el-button size="small" type="primary" @click="chooseSubmit">确定</el-button>
<el-button size="small" @click="chooseVisible = false">取消</el-button> <el-button size="small" @click="chooseVisible = false">取消</el-button>
@ -280,6 +295,21 @@ export default {
info.caption = caption ? caption : {} info.caption = caption ? caption : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.originInfo = JSON.parse(JSON.stringify(info)) this.originInfo = JSON.parse(JSON.stringify(info))
// accountId
info.stages && info.stages.map(e => {
if (e.participantAccountIds && e.teamParticipantIds) {
const accountIds = e.participantAccountIds.split(',').map(n => +n)
const names = e.teamParticipantIds.split(',')
const participants = []
accountIds.map((n, i) => {
participants.push({
id: n,
name: names[i]
})
})
e.participants = participants
}
})
// //
const now = Date.now() const now = Date.now()
this.form.competitionStage.map(e => { this.form.competitionStage.map(e => {
@ -329,8 +359,9 @@ export default {
teamId, teamId,
teamName, teamName,
invitationCode, invitationCode,
whetherSignUp: 1 whetherSignUp: 0
}).then(res => { }).then(res => {
this.editing = false
this.getInfo() this.getInfo()
showMsg && util.successMsg('保存成功') showMsg && util.successMsg('保存成功')
}).catch(res => {}) }).catch(res => {})
@ -419,16 +450,41 @@ export default {
} }
} }
if (!start) { if (!start) {
this.$confirm('确定要踢出该成员吗?', '提示', { let include
for (const e of this.info.stages) {
if (e.participantAccountIds) {
const ids = e.participantAccountIds.split(',').map(n => +n)
if (ids.includes(row.accountId)) {
include = e.stageName
break
}
}
}
this.$confirm(include ? `该成员已被指定参加${include},踢出后需重新指定成员参加,是否确认踢出团队?` : '确定要踢出该成员吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => { this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => {
util.successMsg('移除成功') util.successMsg('移除成功')
this.getInfo() this.getInfo()
if (row.accountId == this.accountId) this.$router.back()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
} }
},
//
removePar(e, stage) {
this.$confirm('确定要移除该成员吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.cancelParticipant, {
accountId: e.id,
competitionId: this.id,
stageId: stage.stageId,
teamId: this.info.teamId
}).then(res => {
util.successMsg('移除成功')
this.getInfo()
}).catch(res => {})
}).catch(() => {})
}, },
// //
selectPar(row) { selectPar(row) {
@ -447,7 +503,7 @@ export default {
// accountId // accountId
stages.map(e => { stages.map(e => {
const id = e.participantAccountIds const id = e.participantAccountIds
id && ids.push(...id.split(',').map(n => +n)) if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n))
}) })
ids = [...new Set(ids)] ids = [...new Set(ids)]
teamDetail.map(e => { teamDetail.map(e => {
@ -458,6 +514,7 @@ export default {
this.chooses = this.info.teamDetail this.chooses = this.info.teamDetail
} }
this.curRow = row this.curRow = row
this.checkedMembers = []
this.chooseVisible = true this.chooseVisible = true
} }
} }
@ -467,7 +524,7 @@ export default {
const accountIds = this.checkedMembers const accountIds = this.checkedMembers
if (!accountIds.length) return util.errorMsg('请选择参赛成员!') if (!accountIds.length) return util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit // const limit = this.curRow.teamNumLimit //
if (accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) // if (limit && accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, { this.$post(this.api.stageSelectParticipants, {
accountIds, accountIds,
competitionId: this.id, competitionId: this.id,
@ -483,7 +540,7 @@ export default {
// //
show(row) { show(row) {
// //
if (this.form.completeCompetitionSetup.competitionType && this.info.team.captain === 0) { // if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row this.curRow = row
this.memberVisible = true this.memberVisible = true
const teamId = this.form.competitionRegistration.teamId const teamId = this.form.competitionRegistration.teamId
@ -513,6 +570,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-r-5 {
margin-right: 5px;
}
.l-title { .l-title {
margin-top: 20px; margin-top: 20px;
font-size: 18px; font-size: 18px;
@ -536,6 +596,9 @@ export default {
font-size: 16px; font-size: 16px;
color: #7a7a7a; color: #7a7a7a;
cursor: pointer; cursor: pointer;
&:hover {
color: #007EFF;
}
} }
.plus { .plus {
margin-bottom: 10px; margin-bottom: 10px;

@ -20,8 +20,8 @@
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button> <el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
</div> </div>
<div> <div>
<el-button v-if="(type && uploadData.length) || (!type && !published)" type="primary" @click="cancelPublish(1)">发布排名</el-button> <el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button> <el-button v-if="published && ((!type && sourceType === '0') || (type && sourceType == 1))" type="primary" @click="cancelPublish(0)">取消发布</el-button>
</div> </div>
</div> </div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"> <el-table :data="list" class="table" ref="table" stripe header-align="center">
@ -358,10 +358,10 @@ export default {
// //
publish() { publish() {
// //
if (this.published && this.sourceType != !this.type) { if (this.published && this.sourceType != this.type) {
this.$confirm(this.sourceType && !this.type ? this.$confirm(this.sourceType == 1 && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' : '手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' :
'默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', { '默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', {
type: 'success' type: 'success'
}).then(() => { }).then(() => {
this.publishSubmit() this.publishSubmit()
@ -390,6 +390,7 @@ export default {
}).catch(res => {}) }).catch(res => {})
} else { } else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => { this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
this.sourceType = ''
this.getData() this.getData()
util.successMsg('取消发布成功!') util.successMsg('取消发布成功!')
}).catch(res => {}) }).catch(res => {})

@ -40,8 +40,8 @@
</li> </li>
<li> <li>
<label>学生班级</label> <label>学生班级</label>
<el-input v-if="editing" v-model="infoData.workNumber"></el-input> <el-input v-if="editing" v-model="infoData.className"></el-input>
<span v-else>{{ infoData.workNumber }}</span> <span v-else>{{ infoData.className }}</span>
</li> </li>
<li> <li>
<label>指导老师</label> <label>指导老师</label>

@ -15,7 +15,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button> <el-button type="primary" round @click="add">新增</el-button>
<el-button type="primary" round @click="exportAll" v-auth="'/match:管理:报名人员:导出'">批量导出</el-button> <el-button type="primary" round @click="exportAll" v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="320"> <el-table-column label="操作" align="center" width="320">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-if="scope.row.identification" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button> <el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button>
<el-switch <el-switch
v-model="scope.row.isDisable" v-model="scope.row.isDisable"
@ -58,7 +58,7 @@
</div> </div>
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd"> <el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'> <el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'>
<el-form-item prop="schoolId" label="院校"> <el-form-item prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable style="width: 100%"> <el-select v-model="form.schoolId" filterable style="width: 100%">
@ -105,7 +105,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">确定并报名</el-button> <el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button> <el-button size="small" @click="teamVisible = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -188,7 +188,8 @@ export default {
whetherSignUp: 1, whetherSignUp: 1,
identification: 1 identification: 1
}, },
originForm: {} originForm: {},
exitMember: 0
}; };
}, },
watch: { watch: {
@ -252,6 +253,7 @@ export default {
this.isAdd = false this.isAdd = false
this.addVisible = true this.addVisible = true
row.userName = row.username row.userName = row.username
this.exitMember = 0
row.id = row.accountId row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row)) this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
@ -259,18 +261,28 @@ export default {
// //
workNumberChange() { workNumberChange() {
const { form } = this const { form } = this
form.schoolId && form.schoolId && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}`).then(({ account }) => { if (this.originForm.workNumber !== form.workNumber) {
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => {
this.exitMember = 0
if (account) { if (account) {
account
this.form = account this.form = account
} }
this.formEnable = !account this.formEnable = !account
}).catch(res => {}) }).catch(res => {
if (!this.isAdd) this.exitMember = 1
})
} else {
this.exitMember = 0
}
}, },
// //
submitForm() { submitForm() {
const { form } = this const { form } = this
if (!this.isAdd) { // if (!this.isAdd) { //
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
this.$post(this.api.updateUser, { this.$post(this.api.updateUser, {
hrUserAccount: { hrUserAccount: {
...form, ...form,
@ -335,7 +347,7 @@ export default {
const team = this.teams.find(e => e.teamId == form.teamId) const team = this.teams.find(e => e.teamId == form.teamId)
if (team && team.invitationCode) form.invitationCode = team.invitationCode if (team && team.invitationCode) form.invitationCode = team.invitationCode
// id-id-schoolId-workNumber // id-id-schoolId-workNumber
form.account = `${Setting.platformId}-0-${form.schoolId}-${form.workNumber}` form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone } = form const { phone } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) { if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号/邮箱") return util.errorMsg("请输入正确的手机号/邮箱")
@ -376,10 +388,11 @@ export default {
}, },
// //
getClient() { getClient() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.$post(this.api.queryCustomer,{ this.$post(this.api.queryCustomer,{
page: 1, page: 1,
size: 1000, size: 1000,
supplierId: '' supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => { }).then(res => {
this.clients = res.message.list this.clients = res.message.list
}).catch(res => {}) }).catch(res => {})
@ -408,7 +421,7 @@ export default {
}, },
// //
info(row) { info(row) {
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`) this.$router.push(`info?id=${this.id}&accountId=${row.accountId}`)
}, },
exportAll() { exportAll() {
const data = this.multipleSelection const data = this.multipleSelection

@ -17,17 +17,17 @@
<div class="l-title" id="part1"><img src="@/assets/img/label.png" alt=""> 竞赛信息</div> <div class="l-title" id="part1"><img src="@/assets/img/label.png" alt=""> 竞赛信息</div>
<div v-if="form.description" class="texts ql-editor" v-html="form.description"></div> <div v-if="form.description" class="texts ql-editor" v-html="form.description"></div>
<template v-if="form.contestAnnexList && form.contestAnnexList.length"> <template v-if="form.competitionAnnexList && form.competitionAnnexList.length">
<h6 class="p-title">附件下载</h6> <h6 class="p-title">附件下载</h6>
<ul class="files"> <ul class="files">
<li v-for="(item, i) in form.contestAnnexList" :key="i"> <li v-for="(item, i) in form.competitionAnnexList" :key="i">
<el-link v-if="item.canPreview" class="m-r-10" type="primary" @click="previewFile(item)">{{ item.fileName }}</el-link> <el-link v-if="item.canPreview" class="m-r-10" type="primary" @click="previewFile(item)">{{ item.fileName }}</el-link>
<span v-else class="file-name">{{ item.fileName }}</span> <span v-else class="file-name">{{ item.fileName }}</span>
<el-link type="primary" :underline="false" @click="download(item)">下载</el-link> <el-link type="primary" :underline="false" @click="download(item)">下载</el-link>
</li> </li>
</ul> </ul>
</template> </template>
<template v-if="!form.description && (!form.contestAnnexList || !form.contestAnnexList.length )"> <template v-if="!form.description && (!form.competitionAnnexList || !form.competitionAnnexList.length )">
<div class="empty"> <div class="empty">
<div> <div>
<img src="@/assets/img/none.png" alt=""> <img src="@/assets/img/none.png" alt="">
@ -36,6 +36,38 @@
</div> </div>
</template> </template>
<template v-if="form.releaseType && form.competitionStage.length">
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
<p style="font-size: 16px;color: #333;">{{ rule.stageName }}</p>
<p>比赛时间{{ rule.startTime && rule.startTime + ' ~ ' + rule.endTime }}</p>
<p>比赛方式{{ methods.find(e => e.id == rule.method) && methods.find(e => e.id == rule.method).name }}</p>
<p v-if="!rule.method">课程系统{{ rule.systemName }}</p>
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2">
<p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template>
<p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1" class="flex">
<p>晋级规则</p>
<div>
<p v-if="rule.peopleLimit">本阶段成绩排名前{{ rule.peopleLimit }}可晋级下一阶段比赛</p>
<p v-if="rule.percentageLimit">本阶段成绩排名前{{ rule.percentageLimit }}%可晋级下一阶段比赛</p>
<p v-if="rule.scoreLimit">本阶段成绩{{ rule.scoreLimit }}可晋级下一阶段比赛</p>
</div>
</div>
</div>
</template>
<!-- 进展 --> <!-- 进展 -->
<div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div> <div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div>
<ul class="progress" v-if="progress.length"> <ul class="progress" v-if="progress.length">
@ -80,10 +112,14 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
import Const from '@/const/match'
export default { export default {
name: "match", name: "match",
data() { data() {
return { return {
rules: Const.rules,
methods: Const.methods,
teamCalculationMethods: Const.teamCalculationMethods,
curType: '1', curType: '1',
typeList: [ typeList: [
{ {
@ -117,7 +153,7 @@ export default {
methods: { methods: {
// //
handleAnnex() { handleAnnex() {
const list = this.form.contestAnnexList const list = this.form.competitionAnnexList
if (list) { if (list) {
list.map(e => { list.map(e => {
const { filePath } = e const { filePath } = e
@ -481,4 +517,18 @@ export default {
color: rgba(0, 0, 0, 0.25); color: rgba(0, 0, 0, 0.25);
} }
} }
.rule-title {
margin-bottom: 10px;
font-size: 16px;
}
.rule {
padding: 15px;
margin-bottom: 15px;
border: 1px solid #dfdfdf;
p {
font-size: 14px;
line-height: 30px;
color: #6e6e6e;
}
}
</style> </style>

@ -36,6 +36,26 @@ export default {
path: `noticeDetail`, path: `noticeDetail`,
component: () => import("@/pages/match/manage/noticeDetail"), component: () => import("@/pages/match/manage/noticeDetail"),
meta: { title: "通知公告" } meta: { title: "通知公告" }
} },
{
path: 'archList',
component: () => import( '@/pages/match/manage/matchArchList'),
meta: { title: '成绩管理' }
},
{
path: 'rank',
component: () => import( '@/pages/match/manage/matchRank'),
meta: { title: '排名管理' }
},
{
path: 'report',
component: () => import( '@/pages/match/manage/matchReport'),
meta: { title: '实验报告' }
},
{
path: 'info',
component: () => import( '@/pages/match/manage/matchInfo'),
meta: { title: '参赛信息与成绩' }
},
] ]
}; };

@ -87,7 +87,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新 // 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false, sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮) // 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false, dynamicRoute: true,
// 文件上传 // 文件上传
upload: { upload: {
apiURL: uploadURL, apiURL: uploadURL,

Loading…
Cancel
Save