赛事修复

dev_review
yujialong 6 months ago
parent 6599d982a4
commit d3c9cc9876
  1. 8
      src/views/customer/AddCustomer.vue
  2. 1
      src/views/match/add/index.vue
  3. 66
      src/views/match/add/step1.vue
  4. 77
      src/views/match/add/step3.vue
  5. 193
      src/views/match/list/index.vue
  6. 15
      src/views/match/manage/matchInfo.vue
  7. 241
      src/views/match/manage/matchRank.vue
  8. 22
      src/views/match/manage/matchSignup.vue
  9. 1438
      src/views/order/AddOrder.vue

@ -375,7 +375,7 @@
<script> <script>
import pdf from '../../components/pdf.vue' import pdf from '../../components/pdf.vue'
import util from '@/utils/util' import Util from '@/libs/util'
import axios from 'axios' import axios from 'axios'
import qs from 'qs' import qs from 'qs'
export default { export default {
@ -685,9 +685,10 @@ export default {
getProduct () { getProduct () {
this.$get(this.api.getProductsSubscribedByCustomers, { this.$get(this.api.getProductsSubscribedByCustomers, {
customeId: this.customerId customeId: this.customerId
}).then(({ data }) => { }).then(async ({ data }) => {
data = data.filter(e => !e.productDel) // productDel=1 data = data.filter(e => !e.productDel) // productDel=1
const { productTypeList } = this const { productTypeList } = this
const now = await Util.getNow()
data.map((e, i) => { data.map((e, i) => {
e.id = i e.id = i
const list = e.startAndEndTimeList const list = e.startAndEndTimeList
@ -700,7 +701,6 @@ export default {
} }
}) })
// //
const now = Date.now()
// if (list[0].startTime && list[0].endTime) { // if (list[0].startTime && list[0].endTime) {
if (list[0].startTime && now < new Date(list[0].startTime).getTime()) { if (list[0].startTime && now < new Date(list[0].startTime).getTime()) {
e.startTime = list[0].startTime e.startTime = list[0].startTime
@ -929,7 +929,7 @@ export default {
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`已订阅产品.xls`, new Blob([res.data])) Util.downloadFileDirect(`已订阅产品.xls`, new Blob([res.data]))
}).catch(res => { }) }).catch(res => { })
}, },

@ -222,6 +222,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.type-wrap { .type-wrap {
position: relative; position: relative;
padding: 10px;
margin-top: 20px; margin-top: 20px;
background: #fff; background: #fff;

@ -161,7 +161,7 @@
</template> </template>
<script> <script>
import util from "@/libs/util"; import Util from "@/libs/util";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Upload from '@/components/upload'; import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
@ -334,7 +334,7 @@ export default {
}, },
methods: { methods: {
getData () { getData () {
const { id } = this.form const { id } = this.$route.query
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
@ -475,7 +475,7 @@ export default {
this.rangeVisible = false this.rangeVisible = false
}, },
handleExceed (files, fileList) { handleExceed (files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
// //
async handleRequest ({ file }) { async handleRequest ({ file }) {
@ -542,33 +542,33 @@ export default {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
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 (next === 2) { if (next === 2) {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) return util.warningMsg('请选择区域、院校') if (form.competitionScope == 2 && (!form.competitionRangeList || !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("请选择报名时间");
let now = new Date().getTime(); let now = new Date().getTime();
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 (!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
// //
if (competitionType) { if (competitionType) {
if (quantityLimit === '') return util.warningMsg('请填写报名团队数上限') if (quantityLimit === '') return Util.warningMsg('请填写报名团队数上限')
if (quantityLimit < 0) return util.warningMsg('报名团队数上限不得小于0') if (quantityLimit < 0) return Util.warningMsg('报名团队数上限不得小于0')
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限') if (minTeamSize === '') return Util.warningMsg('请填写团队人数下限')
if (minTeamSize < 2) return util.warningMsg('团队人数下限不得小于2') if (minTeamSize < 2) return Util.warningMsg('团队人数下限不得小于2')
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限') if (maxTeamSize === '') return Util.warningMsg('请填写团队人数上限')
if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限') if (minTeamSize > maxTeamSize) return Util.warningMsg('团队人数上限不得小于下限')
} else { // } else { //
if (quantityLimit === '') return util.warningMsg('请填写报名人数上限') if (quantityLimit === '') return Util.warningMsg('请填写报名人数上限')
if (quantityLimit < 0) return util.warningMsg('报名人数上限不得小于0') if (quantityLimit < 0) return Util.warningMsg('报名人数上限不得小于0')
} }
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("请填写竞赛详情");
} else { } else {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1 if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1
} }
@ -576,15 +576,15 @@ export default {
// delete form.publishStatus // delete form.publishStatus
// if (status === 1) form.publishStatus = 1 // if (status === 1) form.publishStatus = 1
form.publishStatus = status form.publishStatus = status
form.id = this.$route.query.id
form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) // form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) { if (form.id) {
this.$post(this.api.editCompetition, form).then(async () => { this.$post(this.api.editCompetition, form).then(async () => {
this.$parent.hideLoad() this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功"); this.updateTime && Util.successMsg("修改成功")
this.updateTime = 0 this.updateTime = 0
await this.automaticAllocation() await this.automaticAllocation(status)
this.$emit('next', next) this.$emit('next', next)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
@ -593,7 +593,7 @@ export default {
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => { this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => {
this.updateTime = 0 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)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
@ -601,13 +601,15 @@ export default {
} }
}, },
// //
async automaticAllocation () { async automaticAllocation (status) {
// //
if (this.form.completeCompetitionSetup.competitionType) { if (this.form.completeCompetitionSetup.competitionType) {
const { signUpEndTime, id } = this.form const { signUpEndTime } = this.form
const { id } = this.$route.query
const now = await Util.getNow()
// //
if (signUpEndTime !== this.originSignUpEndTime && new Date(signUpEndTime) > Date.now()) { if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && new Date(signUpEndTime) < now) {
await this.$post(this.api.updateEventAllocationRecord, { await this.$post(this.api.updateEventAllocationRecord, {
competitionId: id, competitionId: id,
whetherToModifyTheRule: 1, whetherToModifyTheRule: 1,
@ -617,20 +619,20 @@ export default {
}, },
// //
preview () { preview () {
util.local.set('match', this.form) Util.local.set('match', this.form)
window.open(this.$router.resolve('/matchPreview').href) window.open(this.$router.resolve('/matchPreview').href)
}, },
addSponsor () { addSponsor () {
this.sponsorList.push(""); this.sponsorList.push('')
}, },
delSponsor (index) { delSponsor (index) {
this.sponsorList.splice(index, 1); this.sponsorList.splice(index, 1)
}, },
addOrganizer () { addOrganizer () {
this.undertakerList.push(""); this.undertakerList.push('')
}, },
delOrganizer (index) { delOrganizer (index) {
this.undertakerList.splice(index, 1); this.undertakerList.splice(index, 1)
} }
} }
}; };

@ -100,7 +100,7 @@
<script> <script>
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import util from "@/libs/util"; import Util from '@/libs/util'
import set from './set' import set from './set'
export default { export default {
props: ['setupId', 'competitionId', 'editing'], props: ['setupId', 'competitionId', 'editing'],
@ -247,7 +247,7 @@ export default {
const startTime = new Date(val[0]) const startTime = new Date(val[0])
const endTime = new Date(val[1]) const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return Util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
const { form, curStep } = this const { form, curStep } = this
for (const i in form) { for (const i in form) {
// //
@ -255,7 +255,7 @@ export default {
const time1 = new Date(form[i].startTime) const time1 = new Date(form[i].startTime)
const time2 = new Date(form[i].endTime) const time2 = new Date(form[i].endTime)
if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) { if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) {
util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。') Util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。')
break break
} }
} }
@ -266,7 +266,7 @@ export default {
// //
beforeUpload (file) { beforeUpload (file) {
const isLt2M = file.size / 1024 / 1024 < 10 const isLt2M = file.size / 1024 / 1024 < 10
if (!isLt2M) util.warningMsg('请上传小于10MB的附件!') if (!isLt2M) Util.warningMsg('请上传小于10MB的附件!')
if (isLt2M) { if (isLt2M) {
this.fileName = file.name this.fileName = file.name
return true return true
@ -283,10 +283,10 @@ export default {
}, },
downloadFile () { downloadFile () {
// const { name, url } = this.fileList[0] // const { name, url } = this.fileList[0]
// util.downloadFile(name, url) // Util.downloadFile(name, url)
}, },
handlePreview (file) { handlePreview (file) {
window.open((util.isDoc(util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url) window.open((Util.isDoc(Util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url)
}, },
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
@ -318,23 +318,29 @@ export default {
}, },
// //
async autoAllocationConfirm (next) { async autoAllocationConfirm (next) {
// const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`)
if (this.form[0].contentId) { if (data.assignOrNot === undefined || !this.form[0].contentId) {
// > // or
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > Date.now()) { this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', {
this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">在报名结束后</span>给报名的团队自动分配阶段参赛人员</p>', '提示', {
confirmButtonText: '是', confirmButtonText: '是',
cancelButtonText: '否', cancelButtonText: '否',
type: 'success', type: 'success',
closeOnClickModal: false, closeOnClickModal: false,
showClose: false,
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
}).then(async () => { }).then(() => {
this.automaticAllocation(1, next) this.automaticAllocation(1, next)
}).catch(() => { }).catch(() => {
this.automaticAllocation(0, next) this.automaticAllocation(0, next)
}) })
} else { } else {
const now = await Util.getNow()
// >
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) {
this.$emit('next', next)
} else {
//
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`)
if (res.popupState) {
this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', { this.$confirm('<p>团队赛发布成功,是否要重新自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会<span style="color: #f00;">立即</span>给报名的团队自动分配阶段参赛人员</p>', '提示', {
confirmButtonText: '是', confirmButtonText: '是',
cancelButtonText: '否', cancelButtonText: '否',
@ -347,21 +353,12 @@ export default {
this.$emit('next', next) this.$emit('next', next)
}).catch(() => { }).catch(() => {
this.automaticAllocation(0, next) this.automaticAllocation(0, next)
}); })
}
} else { } else {
// //
this.$confirm('<p>团队赛发布成功,是否要自动分配阶段参赛人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员</p>', '提示', { this.$emit('next', next)
confirmButtonText: '是', }
cancelButtonText: '否', }
type: 'success',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(() => {
this.automaticAllocation(1, next)
}).catch(() => {
this.automaticAllocation(0, next)
});
} }
}, },
// //
@ -369,7 +366,7 @@ export default {
const { form } = this const { form } = this
if (!form.length) { if (!form.length) {
this.$parent.hideLoad() this.$parent.hideLoad()
util.successMsg('保存成功') Util.successMsg('保存成功')
this.$emit('next', next) this.$emit('next', next)
return return
} }
@ -380,54 +377,54 @@ export default {
if (status) { if (status) {
if (!e.time.length) { if (!e.time.length) {
invalid = 1 invalid = 1
util.errorMsg('请选择比赛时间') Util.errorMsg('请选择比赛时间')
break break
} }
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) { if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) {
invalid = 1 invalid = 1
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') Util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break break
} }
if (e.method !== 2 && !e.cid) { if (e.method !== 2 && !e.cid) {
invalid = 1 invalid = 1
util.errorMsg('请选择课程') Util.errorMsg('请选择课程')
break break
} }
if (e.method === 2) { // 线 if (e.method === 2) { // 线
if (!e.offlineAddress) { if (!e.offlineAddress) {
invalid = 1 invalid = 1
util.errorMsg('请输入比赛地点') Util.errorMsg('请输入比赛地点')
break break
} }
if (!e.contentDescription) { if (!e.contentDescription) {
invalid = 1 invalid = 1
util.errorMsg('请输入比赛内容') Util.errorMsg('请输入比赛内容')
break break
} }
if (!e.scoreRule) { if (!e.scoreRule) {
invalid = 1 invalid = 1
util.errorMsg('请输入评分规则') Util.errorMsg('请输入评分规则')
break break
} }
// if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) { // if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
// invalid = 1 // invalid = 1
// util.errorMsg('') // Util.errorMsg('')
// break // break
// } // }
} else { } else {
if (e.onlineButton && !e.onlineAddress) { if (e.onlineButton && !e.onlineAddress) {
invalid = 1 invalid = 1
util.errorMsg('请输入线上地点') Util.errorMsg('请输入线上地点')
break break
} }
if (e.offlineButton && !e.offlineAddress) { if (e.offlineButton && !e.offlineAddress) {
invalid = 1 invalid = 1
util.errorMsg('请输入线下地点') Util.errorMsg('请输入线下地点')
break break
} }
if (!e.onlineAddress && !e.offlineAddress) { if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1 invalid = 1
util.errorMsg('请输入比赛地点') Util.errorMsg('请输入比赛地点')
break break
} }
} }
@ -458,9 +455,9 @@ export default {
this.$parent.hideLoad() this.$parent.hideLoad()
// //
status && this.publish(status) status && this.publish(status)
util.successMsg((status ? '发布' : '保存') + '成功') Util.successMsg((status ? '发布' : '保存') + '成功')
this.updateTime = 0 this.updateTime = 0
if (this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType) { if (status && this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType) {
this.autoAllocationConfirm() // this.autoAllocationConfirm() //
} else { } else {
this.$emit('next', next) this.$emit('next', next)

@ -1,6 +1,5 @@
<template> <template>
<div class="page" <div class="page" v-loading="loading">
v-loading="loading">
<h6 class="p-title">筛选</h6> <h6 class="p-title">筛选</h6>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
@ -9,12 +8,9 @@
<div class="single-choice"> <div class="single-choice">
<dl> <dl>
<dd> <dd>
<el-radio-group v-model="form.month" <el-radio-group v-model="form.month" @change="changeType">
@change="changeType"> <el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name
<el-radio v-for="(item,index) in dateList" }}</el-radio>
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
</dd> </dd>
</dl> </dl>
@ -22,21 +18,11 @@
</li> </li>
<li> <li>
<label>创建区间</label> <label>创建区间</label>
<el-date-picker v-model="date" <el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期"
align="right" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
</li> </li>
<li> <li>
<el-input placeholder="请输入竞赛名称/创建人" <el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="form.keyWord" clearable></el-input>
suffix-icon="el-icon-search"
v-model="form.keyWord"
clearable></el-input>
</li> </li>
</ul> </ul>
</div> </div>
@ -44,187 +30,98 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>大赛来源</label> <label>大赛来源</label>
<el-select v-model="form.platformSource" <el-select v-model="form.platformSource" clearable @change="sourceChange">
clearable <el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option>
@change="sourceChange">
<el-option v-for="(item, i) in sourceList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>大赛范围</label> <label>大赛范围</label>
<el-select v-model="form.competitionScope" <el-select v-model="form.competitionScope" clearable @change="initData">
clearable <el-option v-for="(item, i) in rangeList" :key="i" :label="item.name" :value="item.id"></el-option>
@change="initData">
<el-option v-for="(item, i) in rangeList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" <el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
round <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
@click="add"
v-auth>创建竞赛</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table ref="table" <el-table ref="table" :data="matchData" class="table" stripe header-align="center"
:data="matchData" @selection-change="handleSelectionChange" row-key="id">
class="table" <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
stripe <el-table-column type="index" width="60" label="序号" align="center">
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="competitionName" <el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column>
label="竞赛名称" <el-table-column prop="name" label="竞赛类型" width="90" align="center">
align="center"></el-table-column>
<el-table-column prop="name"
label="竞赛类型"
width="90"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.competitionType ? '团队赛' : '个人赛' }} {{ scope.row.competitionType ? '团队赛' : '个人赛' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="founderName" <el-table-column prop="founderName" label="创建人" align="center"></el-table-column>
label="创建人" <el-table-column prop="name" label="大赛来源" width="110" align="center">
align="center"></el-table-column>
<el-table-column prop="name"
label="大赛来源"
width="110"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ sourceList.find(e => e.id === scope.row.platformSource).name }} {{ sourceList.find(e => e.id === scope.row.platformSource).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="大赛范围" align="center">
label="大赛范围"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ rangeList.find(e => e.id === scope.row.competitionScope).name }} {{ rangeList.find(e => e.id === scope.row.competitionScope).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="applicantNum" <el-table-column prop="applicantNum" label="报名人数" align="center" width="100"></el-table-column>
label="报名人数" <el-table-column prop="status" label="状态" align="center" width="80">
align="center"
width="100"></el-table-column>
<el-table-column prop="status"
label="状态"
align="center"
width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.publishStatus ? '已发布' : '未发布' }} {{ scope.row.publishStatus ? '已发布' : '未发布' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="time" <el-table-column prop="time" label="竞赛时间" align="center" width="290">
label="竞赛时间"
align="center"
width="290">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }} {{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column>
label="创建时间" <el-table-column label="操作" align="center" width="280">
align="center"
width="160"></el-table-column>
<el-table-column label="操作"
align="center"
width="280">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="copy(scope.row)">复制</el-button>
@click="copy(scope.row)">复制</el-button>
<el-button v-if="scope.row.publishStatus && scope.row.playingStages && scope.row.playingStages.length" <el-button v-if="scope.row.publishStatus && scope.row.playingStages && scope.row.playingStages.length"
type="text" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
@click="editEndTime(scope.row)" <el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button>
v-auth>修改结束时间</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button type="text" <el-switch v-if="scope.row.publishStatus" v-auth="'/match:启用'" v-model="scope.row.ztOpen" :active-value="0"
@click="manage(scope.row)" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'"
v-auth>管理</el-button> @change="switchOff($event, scope.row, scope.$index)"></el-switch>
<el-button type="text"
@click="delData(scope.row)"
v-auth>删除</el-button>
<el-switch v-if="scope.row.publishStatus"
v-auth="'/match:启用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"> :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog title="修改当前阶段结束时间" <el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false">
:visible.sync="modifyVisible" <el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center">
width="900px" <el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column>
:close-on-click-modal="false"> <el-table-column label="竞赛起止时间" width="300" align="center">
<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"> <template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} {{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间调整为" <el-table-column label="结束时间调整为" align="center" width="280">
align="center"
width="280">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker popper-class="no-atTheMoment" <el-date-picker popper-class="no-atTheMoment" v-model="scope.row.newEndTime" placeholder="请选择结束时间"
v-model="scope.row.newEndTime" type="datetime" :picker-options="pickerOptions">
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer"> <el-button size="small" @click="modifyVisible = false"> </el-button>
<el-button size="small" <el-button size="small" type="primary" @click="modifySubmit"> </el-button>
@click="modifyVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="modifySubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>

@ -86,7 +86,8 @@
<th width="110">参赛人数限制</th> <th width="110">参赛人数限制</th>
<th> <th>
允许参赛人员 允许参赛人员
<el-tooltip v-if="stageTip" effect="dark" :content="stageTip" placement="bottom"> <el-tooltip v-if="stageTip" effect="dark" content="阶段参赛人员异常,请尽快按照阶段赛规则调整,否则可能影响比赛成绩!"
placement="bottom">
<i class="info el-icon-warning" style="margin-right: 10px;color: #ff1650;"></i> <i class="info el-icon-warning" style="margin-right: 10px;color: #ff1650;"></i>
</el-tooltip> </el-tooltip>
</th> </th>
@ -109,7 +110,7 @@
</template> </template>
<span v-else class="m-r-5"></span> <span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i> <i class="el-icon-edit icon" @click="selectPar(item)"></i>
<el-tooltip v-if="stageTips.length && stageTips[i]" effect="dark" :content="stageTips[i]" <el-tooltip v-if="stageTip && stageTip[i + 1]" effect="dark" :content="stageTip[i + 1]"
placement="bottom"> placement="bottom">
<el-tag type="danger" class="m-l-5">异常</el-tag> <el-tag type="danger" class="m-l-5">异常</el-tag>
</el-tooltip> </el-tooltip>
@ -284,8 +285,7 @@ export default {
chooses: [], chooses: [],
timer: null, timer: null,
teamErrors: [], teamErrors: [],
stageTip: '', stageTip: null,
stageTips: [],
}; };
}, },
mounted () { mounted () {
@ -344,9 +344,8 @@ export default {
teamId: this.info.teamId teamId: this.info.teamId
}) })
this.teamErrors = res.teamTip.split(';').filter(e => e) this.teamErrors = res.teamTip.split(';').filter(e => e)
if (res.stageTip) { if (Object.keys(res.stageTip)) {
this.stageTip = res.stageTip this.stageTip = res.stageTip
this.stageTips = res.stageTip.split(';').filter(e => e)
} }
}, },
// //
@ -538,8 +537,8 @@ export default {
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 { customNumber, teamNumLimit } = this.curRow //
if (limit && accountIds.length > limit) return Util.errorMsg(`请选择${this.curRow.customNumber}个以下参赛成员!`) // if (teamNumLimit && accountIds.length > customNumber) return Util.errorMsg(`请选择${this.curRow.customNumber}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, { this.$post(this.api.stageSelectParticipants, {
accountIds, accountIds,
competitionId: this.id, competitionId: this.id,

@ -1,141 +1,76 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="m-b-20 head-card">
class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header v-if="grades.length" <el-page-header v-if="grades.length" @back="back" :content="grades[index].stageName + '/排名'"></el-page-header>
@back="back"
:content="grades[index].stageName + '/排名'"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover" v-loading="loading" class="m-b-20">
v-loading="loading"
class="m-b-20">
<div class="tabs"> <div class="tabs">
<template v-for="(item, i) in grades"> <template v-for="(item, i) in grades">
<a v-if="i === index || !item.stageId" <a v-if="i === index || !item.stageId" :key="i" class="item" :class="{ active: item.stageId == active }"
:key="i"
class="item"
:class="{active: item.stageId == active}"
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a> @click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
</template> </template>
</div> </div>
<div class="flex-between" <div class="flex-between" style="margin: 20px 0">
style="margin: 20px 0">
<div style="display: inline-flex;align-items: center"> <div style="display: inline-flex;align-items: center">
<el-radio v-model="type" <el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio>
:label="0" <el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio>
@change="typeChange">默认系统排序</el-radio> <el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
<el-radio v-model="type"
:label="1"
@change="typeChange">手动上传</el-radio>
<el-button type="primary"
:disabled="type === 0"
class="ml20"
@click="batchImport">上传文件</el-button>
</div> </div>
<div style="display: inline-flex;align-items: center"> <div style="display: inline-flex;align-items: center">
<el-input style="margin-right: 15px" <el-input style="margin-right: 15px" :placeholder="'请输入' + (competitionType ? '团队名称/队长' : '学生姓名') + '/学校'"
:placeholder="'请输入' + (competitionType ? '团队名称/队长' : '学生姓名') + '/学校'" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
prefix-icon="el-icon-search" <el-button v-if="!published" type="primary" @click="cancelPublish(1)">发布排名</el-button>
v-model="keyword"
clearable></el-input>
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<template v-else> <template v-else>
<span style="margin-right: 10px;white-space: nowrap;">{{ publishTime }}发布排名</span> <span style="margin-right: 10px;white-space: nowrap;">{{ publishTime }}发布排名</span>
<el-button type="primary" <el-button type="primary" @click="cancelPublish(0)">取消发布</el-button>
@click="cancelPublish(0)">取消发布</el-button>
</template> </template>
<el-button v-if="list.length" <el-button v-if="list.length" type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' :
type="primary" '批量导出'
:loading="exporting" }}</el-button>
@click="exportData">{{ exporting ? '正在导出' : '批量导出' }}</el-button>
</div> </div>
</div> </div>
<el-table :data="list" <el-table :data="list" class="table" ref="table" stripe row-key="scoreId"
class="table" @selection-change="handleSelectionChange" header-align="center">
ref="table" <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
stripe <el-table-column type="index" width="60" label="排名" align="center">
row-key="scoreId"
@selection-change="handleSelectionChange"
header-align="center">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="排名"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<template v-if="competitionType == 1"> <template v-if="competitionType == 1">
<el-table-column prop="teamName" <el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column>
label="团队名称" <el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column>
min-width="150"
align="center"></el-table-column>
<el-table-column prop="leaderName"
label="队长"
min-width="150"
align="center"></el-table-column>
</template> </template>
<el-table-column v-else <el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column>
prop="userName" <el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column>
label="学生姓名" <el-table-column prop="realSchool" label="学生所在院校" min-width="100" align="center"></el-table-column>
min-width="100" <el-table-column prop="timeSum" label="用时" width="90" align="center">
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学生账号归属"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="realSchool"
label="学生所在院校"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="timeSum"
label="用时"
width="90"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }} {{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" <el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
label="分数" <el-table-column label="得分详情" align="center" width="160">
width="90"
align="center"></el-table-column>
<el-table-column label="得分详情"
align="center"
width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" <el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text"
type="text"
@click="show(scope.row, scope.$index)">查看</el-button> @click="show(scope.row, scope.$index)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"> :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<el-dialog title="团队得分详情" <el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false">
:visible.sync="teamVisible" <h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}
width="900px" </h6>
:close-on-click-modal="false">
<h6 v-if="active"
style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}</h6>
<table class="table tc"> <table class="table tc">
<tr> <tr>
<template v-if="!active"> <template v-if="!active">
@ -150,12 +85,10 @@
<th width="100">得分详情</th> <th width="100">得分详情</th>
</tr> </tr>
<template v-if="teams.length"> <template v-if="teams.length">
<tr v-for="(item, i) in teams" <tr v-for="(item, i) in teams" :key="i">
:key="i">
<template v-if="!active && item.rowspan"> <template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td> <td :rowspan="item.rowspan">{{ item.stageName }}</td>
<td class="scores" <td class="scores" :rowspan="item.rowspan">
:rowspan="item.rowspan">
<p class="score">{{ item.teamScore }}</p> <p class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p> <p>{{ item.teamCalculationMethodName }}</p>
<template v-if="isPointWeight"> <template v-if="isPointWeight">
@ -171,13 +104,10 @@
<td>{{ item.timeSum }}min</td> <td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td> <td>{{ item.score }}</td>
<td> <td>
<el-button v-if="item.reportId" <el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button>
type="text"
@click="toReport(item)">查看</el-button>
</td> </td>
</template> </template>
<td v-else <td v-else colspan="6"></td>
colspan="6"></td>
</tr> </tr>
</template> </template>
<tr v-else> <tr v-else>
@ -189,49 +119,29 @@
<td colspan="6">总排名{{ curRow.index }}</td> <td colspan="6">总排名{{ curRow.index }}</td>
</tr> </tr>
</table> </table>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer"> <el-button size="small" type="primary" @click="teamVisible = false">确定</el-button>
<el-button size="small"
type="primary"
@click="teamVisible = false">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="批量导入" <el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false"
@close="cancelUpload"> @close="cancelUpload">
<div style="text-align: center"> <div style="text-align: center">
<template v-if="!uploadFaild"> <template v-if="!uploadFaild">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<el-button type="primary" <el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div> </div>
<el-upload ref="upload" <el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload"
name="file" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
accept=".xls,.xlsx" :limit="1" :on-exceed="handleExceed" :action="this.api.batchImportRanking" :file-list="uploadList"
class="import-file" :headers="headers" :disabled="uploading" :data="{
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.batchImportRanking"
:file-list="uploadList"
:headers="headers"
:disabled="uploading"
:data="{
competitionId: this.id, competitionId: this.id,
stageId: this.stageId, stageId: this.stageId,
isOverallRanking: active ? 0 : 1, isOverallRanking: active ? 0 : 1,
schoolId: '' schoolId: ''
}"> }">
<el-button type="primary" <el-button type="primary" :loading="uploading" class="ml20">上传文件<i
:loading="uploading" class="el-icon-upload2 el-icon--right"></i></el-button>
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
</template> </template>
<template v-else> <template v-else>
@ -241,39 +151,27 @@
@click="showFaild">部分数据导入失败查看失败原因</p> @click="showFaild">部分数据导入失败查看失败原因</p>
</template> </template>
</div> </div>
<span v-if="uploading" <span v-if="uploading" slot="footer" class="dialog-footer">
slot="footer"
class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button> <el-button @click="cancelUpload">停止导入</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="请选择发布排名时间" <el-dialog title="请选择发布排名时间" :visible.sync="publishVisible" width="260px" :close-on-click-modal="false"
:visible.sync="publishVisible"
width="260px"
:close-on-click-modal="false"
custom-class="publish-dia"> custom-class="publish-dia">
<el-date-picker popper-class="no-atTheMoment" <el-date-picker popper-class="no-atTheMoment" v-model="publishTime" placeholder="请选择结束时间" type="datetime"
v-model="publishTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer"> <el-button size="small" @click="publishVisible = false"> </el-button>
<el-button size="small" <el-button size="small" type="primary" @click="publishTimeSubmit"> </el-button>
@click="publishVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="publishTimeSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import Util from '@/libs/util'
import axios from 'axios'; import axios from 'axios'
export default { export default {
data () { data () {
return { return {
@ -613,7 +511,7 @@ export default {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data])) Util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
this.exporting = false this.exporting = false
}).catch(res => { }) }).catch(res => { })
}, },
@ -623,7 +521,7 @@ export default {
competitionId: this.id, competitionId: this.id,
isOverallRanking: this.active ? 0 : 1, isOverallRanking: this.active ? 0 : 1,
publicationType: this.type, publicationType: this.type,
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime), releaseTime: Util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime),
stageId: this.active || this.stageId, stageId: this.active || this.stageId,
}) })
this.uploadData = [] this.uploadData = []
@ -662,7 +560,8 @@ export default {
// //
async publishTimeSubmit () { async publishTimeSubmit () {
const { startTime, endTime } = this.grades[this.index] const { startTime, endTime } = this.grades[this.index]
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') const now = await Util.getNow()
if (now <= new Date(endTime)) return Util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
this.publishSubmit() this.publishSubmit()
// await this.$post(this.api.addCompetitionStageRankingTime, { // await this.$post(this.api.addCompetitionStageRankingTime, {
@ -670,10 +569,10 @@ export default {
// isOverallRanking: this.active ? 0 : 1, // isOverallRanking: this.active ? 0 : 1,
// publicationType: this.type, // publicationType: this.type,
// stageId: this.active || this.stageId, // stageId: this.active || this.stageId,
// releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) // releaseTime: Util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime)
// }) // })
util.successMsg('发布成功') Util.successMsg('发布成功')
this.getData() this.getData()
this.uploaded = 0 this.uploaded = 0
this.publishVisible = false this.publishVisible = false
@ -691,7 +590,7 @@ export default {
if (publish) { if (publish) {
// //
if (this.type && !this.uploaded && !this.list.length) { if (this.type && !this.uploaded && !this.list.length) {
return util.errorMsg('请先上传数据!') return Util.errorMsg('请先上传数据!')
} else { } else {
this.publishTime = new Date() this.publishTime = new Date()
this.publishVisible = true this.publishVisible = true
@ -707,7 +606,7 @@ export default {
this.sourceType = '' this.sourceType = ''
this.type = 0 this.type = 0
this.getData() this.getData()
util.successMsg('取消发布成功!') Util.successMsg('取消发布成功!')
} catch (error) { } } catch (error) { }
} }
}, },
@ -723,7 +622,7 @@ export default {
}, },
// //
handleExceed (files, fileList) { handleExceed (files, fileList) {
util.warningMsg( Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
@ -733,7 +632,7 @@ export default {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data])) Util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { }) }).catch(res => { })
}, },
uploadSuccess (res) { uploadSuccess (res) {
@ -749,11 +648,11 @@ export default {
} else { } else {
this.uploaded = 1 this.uploaded = 1
this.importVisible = false this.importVisible = false
util.successMsg(data.tip, 3000) Util.successMsg(data.tip, 3000)
// util.successMsg('') // Util.successMsg('')
} }
} else { } else {
util.errorMsg(res.message || "上传失败,请检查数据") Util.errorMsg(res.message || "上传失败,请检查数据")
} }
}, },
uploadError (err, file, fileList) { uploadError (err, file, fileList) {
@ -795,27 +694,33 @@ export default {
.table { .table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
th, th,
td { td {
padding: 12px; padding: 12px;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
} }
&.tc { &.tc {
text-align: center; text-align: center;
} }
th { th {
text-align: center; text-align: center;
background-color: #f8faff; background-color: #f8faff;
} }
.scores { .scores {
line-height: 1.6; line-height: 1.6;
} }
.score { .score {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #9076ff; color: #9076ff;
} }
} }
/deep/.import-file { /deep/.import-file {
.el-progress__text, .el-progress__text,
.el-progress, .el-progress,

@ -17,7 +17,8 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="autoAllocationConfirm">{{ !notBeginSign && allocated ? '取消' : '' <el-button v-if="loaded && info.completeCompetitionSetup.competitionType" type="primary" round
:loading="allocating" @click="autoAllocationConfirm">{{ !notBeginSign && allocated ? '取消' : ''
}}自动分配阶段成员</el-button> }}自动分配阶段成员</el-button>
<el-button type="primary" round @click="batchImport">导入</el-button> <el-button type="primary" round @click="batchImport">导入</el-button>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button> <el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
@ -283,6 +284,8 @@ export default {
now: '', now: '',
notBeginSign: true, notBeginSign: true,
allocated: true, allocated: true,
allocating: false,
loaded: 0,
}; };
}, },
watch: { watch: {
@ -294,10 +297,13 @@ export default {
} }
}, },
mounted () { mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
this.getData() this.getData()
this.getInfo() this.getInfo()
this.getTeam() this.getTeam()
this.getAutomaticAllocation()
}, },
methods: { methods: {
init () { init () {
@ -340,6 +346,10 @@ export default {
this.form.schoolId = competition.schoolId this.form.schoolId = competition.schoolId
} }
//
if (this.info.completeCompetitionSetup.competitionType) {
this.getAutomaticAllocation()
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
// / // /
clearInterval(this.timer) clearInterval(this.timer)
this.now = await Util.getNow() this.now = await Util.getNow()
@ -347,11 +357,14 @@ export default {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
}, 1000) }, 1000)
}
}, },
// //
async getAutomaticAllocation () { async getAutomaticAllocation () {
const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`) const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`)
this.allocated = res.data && res.data.assignOrNot this.allocated = res.data && res.data.assignOrNot
this.allocating = false
this.loaded = 1
}, },
// //
async automaticAllocation (assignOrNot) { async automaticAllocation (assignOrNot) {
@ -365,17 +378,18 @@ export default {
async autoAllocationConfirm () { async autoAllocationConfirm () {
// //
if (this.notBeginSign) { if (this.notBeginSign) {
this.$confirm('确定立即自动分配阶段成员?', '提示', { this.$confirm('确定立即给所有报名的团队自动分配阶段成员?', '提示', {
type: 'success', type: 'success',
closeOnClickModal: false, closeOnClickModal: false,
}).then(async () => { }).then(async () => {
await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) //
}).catch(() => { }) }).catch(() => { })
} else { } else {
this.$confirm(`确定${this.allocated ? '取消' : '开启'}自动分配阶段成员?`, { this.$confirm(this.allocated ? '确定取消自动分配阶段成员?' : '确定开启自动分配阶段成员?开启后,将在报名结束后给所有报名的团队自动分配阶段参赛人员', {
type: 'success', type: 'success',
closeOnClickModal: false, closeOnClickModal: false,
}).then(async () => { }).then(async () => {
this.allocating = true
this.automaticAllocation(this.allocated ? 0 : 1) this.automaticAllocation(this.allocated ? 0 : 1)
}).catch(() => { }) }).catch(() => { })
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save