dev_202303
yujialong 2 years ago
parent af27dd64a0
commit a825f18d15
  1. 1
      src/components/Sidebar.vue
  2. 2
      src/setting.js
  3. 25
      src/store/index.js
  4. 15
      src/utils/api.js
  5. 25
      src/views/course/AddCurriculum.vue
  6. 67
      src/views/match/add/index.vue
  7. 15
      src/views/match/add/step1.vue
  8. 118
      src/views/match/add/step2.vue
  9. 89
      src/views/match/add/step3.vue
  10. 34
      src/views/match/list/index.vue
  11. 29
      src/views/match/manage/matchArchList.vue
  12. 171
      src/views/match/manage/matchInfo.vue
  13. 47
      src/views/match/manage/matchRank.vue
  14. 4
      src/views/match/manage/matchReport.vue
  15. 39
      src/views/match/manage/matchSignup.vue
  16. 56
      src/views/match/preview/index.vue
  17. 1
      src/views/order/AddOrder.vue
  18. 5
      src/views/order/Order.vue
  19. 2
      src/views/serve/projectAdd.vue
  20. 14
      src/views/theoreticalCourse/add/index.vue

@ -134,6 +134,7 @@ export default {
methods:{ methods:{
handleSelect(index){ handleSelect(index){
this.onRoutes = index this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1') this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '') this.$store.commit('setColumnId', '')
sessionStorage.setItem('sideBar',index) sessionStorage.setItem('sideBar',index)

@ -45,7 +45,7 @@ const Setting = {
isDev, isDev,
isPro, isPro,
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: false, dynamicRoute: true,
/** /**
* @description 默认密码 * @description 默认密码
*/ */

@ -26,7 +26,8 @@ const store = new Vuex.Store({
platformSource: 0, platformSource: 0,
columnId: '', columnId: '',
tabId: '1', tabId: '1',
dataPer: [] dataPer: [],
orderParam: null
}, },
actions: { actions: {
setSystemId({ state,commit },systemId) { setSystemId({ state,commit },systemId) {
@ -52,6 +53,15 @@ const store = new Vuex.Store({
SET_USERNAME (state, userName) { SET_USERNAME (state, userName) {
state.userName = userName state.userName = userName
}, },
SET_C_PAGE: (state, page) => {
state.customerPage = page
},
SET_M_PAGE: (state, page) => {
state.matchPage = page
},
SET_M_SOURCE: (state, platformSource) => {
state.platformSource = platformSource
},
courseData (state, payload) { courseData (state, payload) {
state.courseId = payload.course_id state.courseId = payload.course_id
}, },
@ -88,21 +98,16 @@ const store = new Vuex.Store({
setDataPer(state, dataPer) { setDataPer(state, dataPer) {
state.dataPer = dataPer state.dataPer = dataPer
}, },
SET_C_PAGE: (state, page) => {
state.customerPage = page
},
SET_M_PAGE: (state, page) => {
state.matchPage = page
},
SET_M_SOURCE: (state, platformSource) => {
state.platformSource = platformSource
},
setColumnId: (state, columnId) => { setColumnId: (state, columnId) => {
state.columnId = columnId state.columnId = columnId
}, },
setInfoTab: (state, tabId) => { setInfoTab: (state, tabId) => {
state.tabId = tabId state.tabId = tabId
}, },
setOrderParam: (state, orderParam) => {
state.orderParam = orderParam
},
} }
}); });

@ -2,7 +2,6 @@ import Setting from "@/setting";
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
const host1 = 'http://192.168.31.51:9000/' const host1 = 'http://192.168.31.51:9000/'
const host2 = 'http://121.37.12.51/'
const uploadURL = Setting.uploadURL const uploadURL = Setting.uploadURL
export default { export default {
@ -147,7 +146,6 @@ export default {
deleteSubsection: `nakadai/nakadai/curriculum/subsection/deleteSubsection`, //根据id删除小节 deleteSubsection: `nakadai/nakadai/curriculum/subsection/deleteSubsection`, //根据id删除小节
editSubsection: `nakadai/nakadai/curriculum/subsection/editSubsection`, //修改小节 editSubsection: `nakadai/nakadai/curriculum/subsection/editSubsection`, //修改小节
getSubsection: `nakadai/nakadai/curriculum/subsection/getSubsection`, //根据小节id获取预览文件地址 getSubsection: `nakadai/nakadai/curriculum/subsection/getSubsection`, //根据小节id获取预览文件地址
// 理论课程 // 理论课程
delTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/batchDeletion`, delTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/batchDeletion`,
@ -158,6 +156,7 @@ export default {
disabledTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/disabledEvents`, disabledTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/disabledEvents`,
checkRepeatTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/checkRepeat`, checkRepeatTheoreticalCourse: `occupationlab/occupationlab/theoreticalCourse/checkRepeat`,
getRedisCache: `occupationlab/occupationlab/theoreticalCourse/getRedisCache`, getRedisCache: `occupationlab/occupationlab/theoreticalCourse/getRedisCache`,
getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`,
// 理论课程分类管理 // 理论课程分类管理
checkRepeatClassification: `occupationlab/occupationlab/theoreticalCourseClassification/checkRepeat`, checkRepeatClassification: `occupationlab/occupationlab/theoreticalCourseClassification/checkRepeat`,
delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/batchDeletion`, delClassification: `occupationlab/occupationlab/theoreticalCourseClassification/batchDeletion`,
@ -314,6 +313,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`,
@ -349,6 +352,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`,
@ -356,6 +360,7 @@ export default {
disableAnnouncement: `competition/competition/announcement/disableAnnouncement`, disableAnnouncement: `competition/competition/announcement/disableAnnouncement`,
queryAnnouncementByCompetitionId: `competition/competition/announcement/queryAnnouncementByCompetitionId`, queryAnnouncementByCompetitionId: `competition/competition/announcement/queryAnnouncementByCompetitionId`,
queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`, queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`,
saveAnnouncementAnnex: `competition/competition/announcementAnnex/save`,
// 赛事成绩 // 赛事成绩
batchDeleteContestGrade: `${host1}competition/competition/performance/batchDeleteContestGrade`, batchDeleteContestGrade: `${host1}competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`, batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`,
@ -377,7 +382,7 @@ export default {
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`, manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`, queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`, releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
gradeImport: `${host2}template/赛事成绩导入模板.xlsx`, gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `${host2}template/赛事排名导入模板(团队赛).xlsx`, rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `${host2}template/赛事排名导入模板(个人赛).xlsx`, rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`,
}; };

@ -187,6 +187,7 @@
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center"> <el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
@ -238,6 +239,7 @@
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center"> <el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
@ -284,7 +286,7 @@
<!-- 实训配置 --> <!-- 实训配置 -->
<div> <div>
<el-table :data="matches" class="table" stripe header-align="center" max-height="400" <el-table :data="matches" class="table" stripe header-align="center" max-height="400"
@selection-change="handleSelectionAssessment"> @selection-change="handleSelectionMatch">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
@ -491,9 +493,10 @@ export default {
assessmentData: [], assessmentData: [],
assessmentTotal: 0, assessmentTotal: 0,
multipleAssessment: [],
matches: [], matches: [],
matcheTotal: 0, matcheTotal: 0,
multipleAssessment: [], multipleMatch: [],
submiting: false, // submiting: false, //
loadIns: null, loadIns: null,
updateTime: 0, updateTime: 0,
@ -873,6 +876,9 @@ export default {
handleSelectionAssessment(val) { // handleSelectionAssessment(val) { //
this.multipleAssessment = val; this.multipleAssessment = val;
}, },
handleSelectionMatch(val) { //
this.multipleMatch = val;
},
handleBatchDelete(type) { // handleBatchDelete(type) { //
if (type == 1 && !this.multipleAssessment.length) { if (type == 1 && !this.multipleAssessment.length) {
this.$message.warning("请勾选考核项目!"); this.$message.warning("请勾选考核项目!");
@ -880,14 +886,14 @@ export default {
} else if (!type && !this.multiplePractice.length) { } else if (!type && !this.multiplePractice.length) {
this.$message.warning("请勾选练习项目!"); this.$message.warning("请勾选练习项目!");
return; return;
} else if (type == 2 && !this.multiplePractice.length) { } else if (type == 2 && !this.multipleMatch.length) {
this.$message.warning("请勾选竞赛项目!"); this.$message.warning("请勾选竞赛项目!");
return; return;
} }
this.$confirm("此操作将批量移除项目, 是否继续?", "提示", { this.$confirm("此操作将批量移除项目, 是否继续?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (type) { if (type == 1) {
let ids = this.multipleAssessment.map(i => i.projectId); let ids = this.multipleAssessment.map(i => i.projectId);
let tempArr = []; let tempArr = [];
for (let i = 0; i < this.assessmentData.length; i++) { for (let i = 0; i < this.assessmentData.length; i++) {
@ -896,7 +902,7 @@ export default {
} }
} }
this.assessmentData = tempArr; this.assessmentData = tempArr;
} else { } else if (!type) {
let ids = this.multiplePractice.map(i => i.projectId); let ids = this.multiplePractice.map(i => i.projectId);
let tempArr = []; let tempArr = [];
for (let i = 0; i < this.practiceData.length; i++) { for (let i = 0; i < this.practiceData.length; i++) {
@ -905,6 +911,15 @@ export default {
} }
} }
this.practiceData = tempArr; this.practiceData = tempArr;
} else {
let ids = this.multipleMatch.map(i => i.projectId);
let tempArr = [];
for (let i = 0; i < this.matches.length; i++) {
if (!ids.includes(this.matches[i].projectId)) {
tempArr.push(this.matches[i]);
}
}
this.matches = tempArr;
} }
this.$message.success("批量移除成功"); this.$message.success("批量移除成功");
}).catch(() => { }).catch(() => {

@ -5,18 +5,18 @@
<el-page-header @back="back" :content="'创建赛事'"></el-page-header> <el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div> </div>
</el-card> </el-card>
<div v-if="step === 1 || (id && !editing)" :class="['type-wrap', {pd: !id}]">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型">
<el-radio v-model="releaseType" :label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType" :label="1">设置完整比赛</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px"> <el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<template v-if="step === 1 || (id && !editing)"> <ul :class="['steps', {pointer: !editing && id && publishStatus}]">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型">
<el-radio v-model="releaseType" :label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType" :label="1">设置完整比赛</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1">编辑</el-button>
</template>
<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>
<p class="text">大赛信息填写</p> <p class="text">大赛信息填写</p>
@ -48,12 +48,12 @@
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 --> <!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id"> <template v-if="editing || !id">
<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" v-auth="'/match:管理:大赛详情:发布'">上一步</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)" v-auth="'/match:管理:大赛详情:发布'">发布</el-button> <el-button v-if="!releaseType || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)" v-auth="'/match:管理:大赛详情:保存并下一步'">保存并下一步</el-button> <el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</template> </template>
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button> <el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button @click="back">取消</el-button> <el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -112,12 +112,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,21 +136,43 @@ export default {
this.competitionId = competitionId this.competitionId = competitionId
} }
this.step++ this.step++
} else if (next === 1) {
this.step--
} }
}, },
// //
toStep(i) { toStep(i) {
if (this.id && !this.editing) this.step = i if (this.publishStatus && this.id && !this.editing) this.step = i
}, },
// //
preview() { preview() {
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.matchPage}&platformSource=${this.$store.state.platformSource}`)
}
},
back() { back() {
// //
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (this.step < 4 && updateTime) { if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning' type: 'warning'
@ -172,6 +193,14 @@ export default {
</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;

@ -522,13 +522,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 +565,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 +586,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("请选择报名时间");
@ -595,7 +595,6 @@ export default {
let signUpStartTime = new Date(form.signUpStartTime).getTime(); let signUpStartTime = new Date(form.signUpStartTime).getTime();
let signUpEndTime = new Date(form.signUpEndTime).getTime(); let signUpEndTime = new Date(form.signUpEndTime).getTime();
let playStartTime = new Date(form.playStartTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime();
// if (signUpStartTime && now > signUpStartTime) return util.warningMsg("");
if (!form.playStartTime) return util.warningMsg("请选择竞赛时间"); if (!form.playStartTime) return util.warningMsg("请选择竞赛时间");
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
@ -613,7 +612,7 @@ 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 //
@ -621,6 +620,7 @@ export default {
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 +629,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="是否公布成绩详情">
@ -259,7 +259,12 @@ export default {
e.operator = limit.replace(/\d+/, '') e.operator = limit.replace(/\d+/, '')
const num = limit.replace(/\D+/, '') const num = limit.replace(/\D+/, '')
if (num) e.score = num if (num) e.score = num
} else {
e.operator = '>'
e.score = ''
} }
if (!e.peopleLimit) e.peopleLimit = ''
if (!e.percentageLimit) e.percentageLimit = ''
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0 e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0
e.teamCalculationMethod = +e.teamCalculationMethod e.teamCalculationMethod = +e.teamCalculationMethod
}) })
@ -290,62 +295,83 @@ 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 (rule !== 2 && !e.stageName) { if (next === 2) {
invalid = 1 const stages = form.competitionStageList
util.errorMsg('请输入阶段名称') for (const i in stages) {
break const e = stages[i]
} if (rule !== 2 && !e.stageName) {
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
invalid = 1 invalid = 1
util.errorMsg('请输入权重') util.errorMsg('请输入阶段名称')
break break
} }
pointWeight += e.pointWeight // const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
} else if (rule === 1) { // // rule: 012
if (e.score !== '') e.scoreLimit = e.operator + e.score //
} if (!rule) {
if (rule !== 2 && competitionType && e.teamNumLimitOpt) { //
if (e.teamNumLimit === '') { if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
invalid = 1 invalid = 1
util.errorMsg('请输入团队参数人数限制') util.errorMsg('请输入权重')
break break
} else if (e.teamNumLimit < 0) { }
invalid = 1 pointWeight += e.pointWeight //
util.errorMsg('团队参数人数不得小于0') } else if (rule === 1) { //
break // ()
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) { if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') {
invalid = 1 invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限') util.errorMsg('请至少填写一条晋级规则')
break break
}
if (e.score !== '') e.scoreLimit = e.operator + e.score
} }
} if (rule !== 2 && competitionType && e.teamNumLimitOpt) {
if (!e.resultsDetails) { if (e.teamNumLimit === '') {
e.resultAnnouncementTime = +e.resultAnnouncementTime invalid = 1
if (e.resultAnnouncementTime === '') { util.errorMsg('请输入团队参数人数限制')
invalid = 1 break
util.errorMsg('请填写成绩公布时间') } else if (e.teamNumLimit < 0) {
break invalid = 1
util.errorMsg('团队参数人数不得小于0')
break
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) {
invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限')
break
}
} }
if (e.resultAnnouncementTime < 0) { if (!e.resultsDetails) {
invalid = 1 if (e.resultAnnouncementTime === '') {
util.errorMsg('成绩公布时间不得小于0') invalid = 1
break util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) {
invalid = 1
util.errorMsg('成绩公布时间不得小于0')
break
}
if (e.resultAnnouncementTime % 1) {
invalid = 1
util.errorMsg('成绩公布时间须为整数')
break
}
e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
} }
if (invalid) return
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
} }
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
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,51 +197,60 @@ export default {
// //
save(status, next = 0) { save(status, next = 0) {
const { form } = this const { form } = this
let invalid = 0 if (!form.length) {
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') this.$parent.hideLoad()
for (const e of form) { util.successMsg('保存成功')
if (!e.time.length) { this.$emit('next', next)
invalid = 1 return
util.errorMsg('请选择比赛时间') }
break //
} if (status) {
e.startTime = e.time[0] let invalid = 0
e.endTime = e.time[1] if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (e.method !== 2 && !e.cid) { for (const e of form) {
invalid = 1 if (!e.time.length) {
util.errorMsg('请选择课程')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1 invalid = 1
util.errorMsg('请输入评分规则') util.errorMsg('请选择比赛时间')
break break
} }
} else { e.startTime = e.time[0]
if (e.onlineButton && !e.onlineAddress) { e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) {
invalid = 1 invalid = 1
util.errorMsg('请输入线上地点') util.errorMsg('请选择课程')
break break
} }
if (e.offlineButton && !e.offlineAddress) { if (e.method === 2) { // 线
invalid = 1 if (!e.offlineAddress) {
util.errorMsg('请输入线下地点') invalid = 1
break util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
}
} }
} }
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 => {

@ -41,7 +41,7 @@
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</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>
@ -82,6 +82,7 @@
<el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button> <el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-switch <el-switch
v-if="scope.row.publishStatus"
v-auth="'/match:启用'" v-auth="'/match:启用'"
v-model="scope.row.ztOpen" v-model="scope.row.ztOpen"
:active-value="0" :active-value="0"
@ -209,7 +210,7 @@ export default {
shortcuts: [{ shortcuts: [{
text: '此刻', text: '此刻',
onClick(picker) { onClick(picker) {
picker.$emit('pick', new Date(Date.now() + 1000 * 60 * 5)) picker.$emit('pick', new Date(Date.now() + 5000))
} }
}] }]
} }
@ -392,40 +393,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: 0 // (01) type: 0 // (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: 0 // (01)
}).then(res => {
row.publishStatus = 1
this.$post(`${this.api.publishCompetition}?competitionId=${row.id}&publishStatus=1`).then(res => {
this.getData()
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.ztOpen = 1
})
} else {
this.disable(val, row)
}
},
} }
}; };
</script> </script>

@ -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,14 @@
: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,
systemId: 0
}"
> >
<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 +211,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 +285,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 +320,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,20 +7,22 @@
</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">
<tr> <table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10">
<th width="150">团队名称</th> <tr>
<td> <th width="150">团队名称</th>
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input> <td>
</td> <el-input :disabled="!editing" v-model="info.team.teamName"></el-input>
<th width="150">团队邀请码</th> </td>
<td> <th width="150">团队邀请码</th>
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input> <td>
</td> <el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input>
</tr> </td>
</table> </tr>
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center"> </table>
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button> <div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center">
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
</div>
</div> </div>
<table class="table"> <table class="table">
<tr> <tr>
@ -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,55 +450,81 @@ 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(() => {})
} }
}, },
// //
selectPar(row) { removePar(e, stage) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId) this.$confirm('确定要移除该成员吗?', '提示', {
if (item) { type: 'warning'
// }).then(() => {
const now = new Date() this.$post(this.api.cancelParticipant, {
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) { accountId: e.id,
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!') competitionId: this.id,
} else { stageId: stage.stageId,
const { teamLimit, stages, teamDetail } = this.info teamId: this.info.teamId
// teamLimit=truestagesparticipantAccountIdsaccountId }).then(res => {
if (teamLimit) { util.successMsg('移除成功')
const chooses = [] this.getInfo()
let ids = [] }).catch(res => {})
// accountId }).catch(() => {})
stages.map(e => { },
const id = e.participantAccountIds //
id && ids.push(...id.split(',').map(n => +n)) selectPar(row) {
}) const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
ids = [...new Set(ids)] if (item) {
teamDetail.map(e => { //
ids.includes(e.accountId) || chooses.push(e) // const now = new Date()
}) if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
this.chooses = chooses return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else { } else {
this.chooses = this.info.teamDetail const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
let id = e.participantAccountIds
if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n))
})
ids = [...new Set(ids)]
teamDetail.map(e => {
ids.includes(e.accountId) || chooses.push(e) //
})
this.chooses = chooses
} else {
this.chooses = this.info.teamDetail
}
this.curRow = row
this.checkedMembers = []
this.chooseVisible = true
} }
this.curRow = row
this.chooseVisible = true
} }
} },
},
// //
chooseSubmit() { chooseSubmit() {
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">
@ -69,21 +69,26 @@
<th width="100">分数</th> <th width="100">分数</th>
<th width="100">得分详情</th> <th width="100">得分详情</th>
</tr> </tr>
<tr v-for="(item, i) in teams" :key="i"> <template v-if="teams.length">
<template v-if="!active && item.rowspan"> <tr v-for="(item, i) in teams" :key="i">
<td :rowspan="item.rowspan">{{ item.stageName }}</td> <template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.teamScore }}</td> <td :rowspan="item.rowspan">{{ item.stageName }}</td>
</template> <td :rowspan="item.rowspan">{{ item.teamScore }}</td>
<td>{{ i + 1 }}</td> </template>
<td>{{ item.userName }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.schoolName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.timeSum }}min</td> <td>{{ item.schoolName }}</td>
<td>{{ item.score }}</td> <td>{{ item.timeSum }}min</td>
<td> <td>{{ item.score }}</td>
<el-button type="text" @click="toReport(item)">查看</el-button> <td>
</td> <el-button type="text" @click="toReport(item)">查看</el-button>
</td>
</tr>
</template>
<tr v-else>
<td colspan="99">暂无数据</td>
</tr> </tr>
<tr v-if="!active"> <tr v-if="!active && teams.length">
<td>综合得分</td> <td>综合得分</td>
<td>{{ totalScore }}</td> <td>{{ totalScore }}</td>
<td colspan="6">总排名{{ curRow.index }}</td> <td colspan="6">总排名{{ curRow.index }}</td>
@ -191,7 +196,6 @@ export default {
getRank(whetherToPublish) { getRank(whetherToPublish) {
// //
if (whetherToPublish) { if (whetherToPublish) {
console.log(44, this.active)
this.$post(this.api.manuallyRankTheUploadList, { this.$post(this.api.manuallyRankTheUploadList, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -358,10 +362,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 +394,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>
@ -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%">
@ -185,10 +185,11 @@ export default {
registrationInvitationCode: '', registrationInvitationCode: '',
teamName: '', teamName: '',
invitationCode: '', invitationCode: '',
whetherSignUp: 0, 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) {
if (account) { form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => {
account this.exitMember = 0
this.form = account if (account) {
} this.form = account
this.formEnable = !account }
}).catch(res => {}) this.formEnable = !account
}).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,
@ -369,7 +381,7 @@ export default {
registrationInvitationCode: '', registrationInvitationCode: '',
teamName: '', teamName: '',
invitationCode: '', invitationCode: '',
whetherSignUp: 0, whetherSignUp: 1,
identification: 1 identification: 1
} }
this.teamVisible = true this.teamVisible = true
@ -402,6 +414,9 @@ export default {
form.accountId = this.form.id form.accountId = this.form.id
this.$post(this.api.addCompetitionTeam, form).then(res => { this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false this.teamVisible = false
this.addVisible = false
this.getData()
util.successMsg('报名成功!')
}).catch(res => {}) }).catch(res => {})
}, },
// //

@ -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,36 @@
</div> </div>
</template> </template>
<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>
<!-- 进展 --> <!-- 进展 -->
<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 +110,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 +151,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 +515,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>

@ -1160,7 +1160,6 @@ export default {
return e; return e;
});// });//
this.coursePermissions = list.filter(i => i.authority === 1); this.coursePermissions = list.filter(i => i.authority === 1);
console.log("🚀 ~ file: AddOrder.vue ~ line 979 ~ setStartDate ~ this.coursePermissions ", this.coursePermissions )
this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.dataPlatformPermissions = list.filter(i => i.authority === 0);
this.valuePermissions = list.filter(i => i.authority === 2); this.valuePermissions = list.filter(i => i.authority === 2);
}, },

@ -112,6 +112,7 @@
export default { export default {
data() { data() {
return { return {
orderParam: this.$store.state.orderParam,
form: { form: {
provinces: "", provinces: "",
city: "", city: "",
@ -159,6 +160,7 @@ export default {
} }
}, },
created() { created() {
if (this.orderParam) this.form = this.orderParam
this.getData() this.getData()
this.getSchool() this.getSchool()
}, },
@ -227,12 +229,13 @@ export default {
}else{ }else{
orderStatus = 0 orderStatus = 0
} }
this.$store.commit('setOrderParam', this.form)
this.$router.push({ this.$router.push({
path:'/AddOrder', path:'/AddOrder',
query:{ query:{
val:val, val:val,
orderId:row.orderId, orderId:row.orderId,
orderStatus:orderStatus orderStatus
} }
}) })
// this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus); // this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus);

@ -328,7 +328,7 @@ export default {
}, },
methods: { methods: {
permissionChange(){ permissionChange(){
if (this.projectManage.permissions == 1){ if (this.projectManage.permissions){
this.projectManage.hintOpen = 1 this.projectManage.hintOpen = 1
}else{ }else{
this.projectManage.hintOpen = 0 this.projectManage.hintOpen = 0

@ -278,10 +278,21 @@ export default {
const rangeName = data.courseRangeList const rangeName = data.courseRangeList
if (rangeName) { if (rangeName) {
const range = [] const range = []
const rangeChecked = []
rangeName.map(e => { rangeName.map(e => {
range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName) const name = e.type ? (e.cityName || e.provinceName) : e.schoolName
range.push(name)
rangeChecked.push({
value: e.type ? (e.cityId || e.provinceId) : e.schoolId,
label: name,
cityId: e.cityId,
provinceId: e.provinceId,
schoolId: e.schoolId,
})
}) })
this.rangeName = range.join(',') this.rangeName = range.join(',')
this.rangeChecked = rangeChecked
} }
this.uploadList.push({ this.uploadList.push({
@ -303,6 +314,7 @@ export default {
rangeChecked.find(n => n.value === e.value && n.label == e.label) || name.push(e.data) // push rangeChecked.find(n => n.value === e.value && n.label == e.label) || name.push(e.data) // push
}) })
this.rangeChecked.push(...name) this.rangeChecked.push(...name)
console.log("🚀 ~ file: index.vue:306 ~ rangeChange ~ this.rangeChecked", this.rangeChecked)
}, },
// //
rangeViChange(e) { rangeViChange(e) {

Loading…
Cancel
Save