dev_202303
yujialong 2 years ago
parent 254b2983c2
commit af27dd64a0
  1. 3
      src/main.js
  2. 2
      src/setting.js
  3. 17
      src/utils/api.js
  4. 10
      src/utils/core.js
  5. 86
      src/views/match/add/index.vue
  6. 36
      src/views/match/add/step1.vue
  7. 24
      src/views/match/add/step2.vue
  8. 17
      src/views/match/add/step3.vue
  9. 2
      src/views/match/manage/index.vue
  10. 33
      src/views/match/manage/matchArch.vue
  11. 4
      src/views/match/manage/matchArchList.vue
  12. 358
      src/views/match/manage/matchInfo.vue
  13. 125
      src/views/match/manage/matchRank.vue
  14. 185
      src/views/match/manage/matchSignup.vue
  15. 8
      src/views/match/preview/index.vue
  16. 254
      src/views/order/AddOrder.vue

@ -12,7 +12,7 @@ import {post,get,del,put} from './utils/http';
import api from './utils/api';
import store from './store'
import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus,
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate, downloadFile } from './utils/core';
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate, downloadFile, dateCompatible } from './utils/core';
import preventReClick from './utils/preventReClick' //防多次点击,重复提交
import plugins from '@/directive';
@ -38,6 +38,7 @@ Vue.prototype.isIE = isIE;
Vue.prototype.encodeString = encodeString;
Vue.prototype.formatDate = formatDate;
Vue.prototype.downloadFile = downloadFile;
Vue.prototype.dateCompatible = dateCompatible;
Vue.config.productionTip = false;
Vue.use(ElementUI, { size: 'small' });

@ -12,7 +12,7 @@ if (isDev) {
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.51:9000/'// 榕
// host = 'http://192.168.31.116:9000/'// 赓
host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}

@ -71,6 +71,7 @@ export default {
examinePassword: `users/users/userAccount/examinePassword`,
viewUserDetailsforNakadai: `users/users/userAccount/viewUserDetailsforNakadai`,
oneClickEnableVerification: `users/users/userAccount/oneClickEnableVerification`,
getValueModule: `nakadai/nakadai/valueModuleManagement/getValueModule`,
queryServiceConfig: `nakadai/nakadai/serviceConfiguration/getAllService`, //查询服务配置
// 项目管理
@ -338,6 +339,16 @@ export default {
searchTeam: `competition/competition/team/searchTeam`,
joinCompetitionTeam: `competition/competition/team/joinCompetitionTeam`,
addCompetitionTeam: `competition/competition/team/addCompetitionTeam`,
studentAccountApplication: `users/users/register/studentAccountApplication`,
checkPhoneOrEmailExist: `users/users/userInfo/checkPhoneOrEmailExist`,
editCompetitionTeam: `competition/competition/team/editCompetitionTeam`,
addAnAdvisor: `competition/competition/teamInstructor/addAnAdvisor`,
deleteAnAdvisor: `competition/competition/teamInstructor/deleteAnAdvisor`,
captainOfTransfer: `competition/competition/team/captainOfTransfer`,
removeTheLine: `competition/competition/team/removeTheLine`,
stageSelectParticipants: `competition/competition/teamParticipant/stageSelectParticipants`,
updateUser: `users/users/userInfo/updateUser`,
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
// 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
@ -350,11 +361,11 @@ export default {
batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host1}competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `${host1}competition/competition/performance/exportFailure`,
rankExportFailure: `${host1}competition/competition/rank/exportFailure`,
stageGradeManagementList: `${host1}competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `${host1}competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `${host1}competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `${host1}competition/competition/rank/batchImportRanking`,
rankExportFailure: `${host1}competition/competition/rank/exportFailure`,
publishRanking: `${host1}competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `${host1}competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `${host1}competition/competition/rank/multipleStageTeamScoreDetails`,
@ -362,6 +373,10 @@ export default {
cancelRanking: `${host1}competition/competition/rank/cancelRanking`,
reportDetail: `${host1}occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `${host1}competition/competition/rank/deleteLastPublication`,
whetherToPublish: `${host1}competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
gradeImport: `${host2}template/赛事成绩导入模板.xlsx`,
rankImportTeam: `${host2}template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `${host2}template/赛事排名导入模板(个人赛).xlsx`,

@ -29,6 +29,14 @@ function toDateTime (date, time) {
return str
}
function formateTime(num) {
return num < 10 ? `0${num}` : num
}
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
function dateCompatible(date) {
return date.replace(/\-/g, '/')
}
function Percentage(num, total) {
if (num == 0 || total == 0){
@ -215,6 +223,8 @@ function downloadFile(fileName, url) {
export {
fMoney,
toDateTime,
formateTime,
dateCompatible,
Percentage,
fMoney2,
systemStatus,

@ -6,7 +6,7 @@
</div>
</el-card>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<template v-if="step === 1">
<template v-if="step === 1 || (id && !editing)">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型">
@ -16,32 +16,32 @@
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1">编辑</el-button>
</template>
<ul v-if="editing || !id" class="steps">
<li :class="{active: step === 1,done: step > 1}">
<ul :class="['steps', {pointer: !editing && id}]">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)">
<span class="circle">1</span>
<p class="text">大赛信息填写</p>
</li>
<template v-if="releaseType">
<li :class="{active: step === 2,done: step > 2}">
<li :class="{active: step === 2,done: step > 2}" @click="toStep(2)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}">
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
</template>
<li :class="{done: step > 3}">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布</p>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
</ul>
</el-card>
<div class="page">
<div class="page-content">
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
<step2 v-if="step === 2" ref="step2" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :setupId.sync="setupId" :competitionId.sync="competitionId" @next="next" />
<step2 v-if="step === 2" ref="step2" :editing.sync="editing" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :editing.sync="editing" :setupId.sync="setupId" :competitionId.sync="competitionId" @next="next" />
<step4 v-if="step === 4" />
<div v-if="step !== 4 && showBtns" class="btns">
@ -53,7 +53,7 @@
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)" v-auth="'/match:管理:大赛详情:保存并下一步'">保存并下一步</el-button>
</template>
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button @click="$router.back()">取消</el-button>
<el-button @click="back">取消</el-button>
</div>
</div>
</div>
@ -80,7 +80,7 @@ export default {
updateTime: 0,
setupId: '',
releaseType: 0,
editing: 0,
editing: this.$route.query.id ? 0 : 1,
showBtns: true,
loadIns: null
};
@ -110,7 +110,20 @@ export default {
},
//
prev() {
//
const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.step--
})
} else {
this.step--
}
},
//
next(next, setupId, competitionId) {
@ -118,34 +131,42 @@ export default {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) this.competitionId = competitionId
if (competitionId) {
this.$router.push('/addMatch?id=' + competitionId)
this.id = competitionId
this.competitionId = competitionId
}
this.step++
}
},
//
toStep(i) {
if (this.id && !this.editing) this.step = i
},
//
preview() {
util.local.set('match', this.form)
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/matchPreview').href)
},
back() {
// const updateTime = this.updateTime
// const { id } = this.form
// //
// if ((id && updateTime > 1) || (!id && updateTime)) {
// this.$confirm(``, '', {
// type: 'warning'
// }).then(() => {
// this.save(0)
// }).catch(() => {
// this.backPage()
// })
// } else {
//
const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
// }
}
},
backPage() {
this.$router.back()
},
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
}
}
};
</script>
@ -162,6 +183,11 @@ export default {
.steps {
display: flex;
justify-content: center;
&.pointer {
li {
cursor: pointer;
}
}
li {
position: relative;
margin-right: 100px;
@ -191,11 +217,11 @@ export default {
.active {
.circle {
color: #fff;
border-color: #e0a1ff;
background: #d379ff;
border-color: #459ffb;
background: #007EFF;
}
.text {
color: #d379ff;
color: #007EFF;
}
}
.done {

@ -61,7 +61,7 @@
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if="index == 0" class="add-btn" :disabled="!editing && form.id !== ''" @click="addSponsor">
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
@ -73,13 +73,13 @@
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if="index == 0" class="add-btn" :disabled="!editing && form.id !== ''" @click="addOrganizer">
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
<button v-if="!undertakerList.length" class="add-btn" @click="addOrganizer">
<button v-if="!undertakerList.length" class="add-btn" type="button" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
@ -412,6 +412,9 @@ export default {
this.rangeName = range.join(',')
}
this.form = competition
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(err => {})
},
//
@ -584,7 +587,7 @@ export default {
form.undertaker = this.undertakerList.filter(d => d).join();
if (!form.name) return util.warningMsg("请填写竞赛名称");
//
if (status) {
// if (status) {
if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
@ -594,7 +597,7 @@ export default {
let playStartTime = new Date(form.playStartTime).getTime();
// if (signUpStartTime && now > signUpStartTime) return util.warningMsg("");
if (!form.playStartTime) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
//
if (competitionType) {
@ -610,12 +613,12 @@ export default {
}
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return util.warningMsg("请填写竞赛详情");
}
// }
this.$parent.showLoad()
form.publishStatus = status
form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) {
this.$post(this.api.editCompetition, form).then(res => {
this.$parent.hideLoad()
@ -639,25 +642,6 @@ export default {
util.local.set('match', this.form)
window.open(this.$router.resolve('/matchPreview').href)
},
back() {
const updateTime = this.updateTime
const { id } = this.form
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
backPage(){
this.$router.back()
},
addSponsor() {
this.sponsorList.push("");
},

@ -3,7 +3,7 @@
<div class="page">
<div class="page-content">
<div class="p-title">赛程与规则设置</div>
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small">
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" :disabled="!editing && id">
<el-form-item label="竞赛类型">
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">如需修改请返回上一步</span>
</el-form-item>
@ -58,7 +58,7 @@
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span>
</div>
<div v-if="form.rule === 1" class="line" style="display: flex;">
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" style="display: flex;">
<p>
<span class="req">*</span>晋级规则
</p>
@ -145,10 +145,11 @@ import util from "@/libs/util";
import quill from "@/components/quill";
import Const from '@/const/match'
export default {
props: ['setupId'],
props: ['setupId', 'editing'],
data() {
return {
id: this.$route.query.id,
updateTime: 0,
step1: this.$parent.$refs.step1.form,
serials: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'],
form: {
@ -241,10 +242,9 @@ export default {
},
},
mounted() {
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() //
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0]))
this.id && this.getData()
this.step1 || this.getStep1() //
},
methods: {
getData() {
@ -265,8 +265,19 @@ export default {
})
this.form = rule
}
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(res => {})
},
//
getStep1() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.step1 = competition
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() //
}).catch(err => {})
},
//
stageChange(val) {
const list = []
@ -313,7 +324,7 @@ export default {
invalid = 1
util.errorMsg('团队参数人数不得小于0')
break
} else if (e.teamNumLimit > maxTeamSize) {
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) {
invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限')
break
@ -332,7 +343,6 @@ export default {
break
}
}
}
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')

@ -3,7 +3,7 @@
<div v-show="!setVisible" class="page">
<div class="page-content">
<div class="p-title">比赛内容设置</div>
<el-form label-width="170px" label-suffix=":" size="small">
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && id">
<div v-for="(item, i) in form" :key="i" class="step">
<div class="title">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span>
@ -44,7 +44,7 @@
</template>
<template v-else>
<el-form-item class="req" prop="cid" label="课程系统">
{{ item.cname }}
{{ item.systemName }}
</el-form-item>
<el-form-item class="req" prop="assessmentId" label="已选择考核">
{{ item.projectName }}
@ -73,12 +73,12 @@
import util from "@/libs/util";
import set from './set'
export default {
props: ['setupId', 'competitionId'],
props: ['setupId', 'competitionId', 'editing'],
data() {
return {
id: this.$route.query.id,
updateTime: 0,
step1: this.$parent.$refs.step1.form,
step2: this.$parent.$refs.step2.form,
nums: ['一', '二', '三'],
methods: [
{
@ -144,7 +144,9 @@ export default {
form.stageName = e.stageName
this.form.push(form)
})
console.log(44, this.form)
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(res => {})
},
//
@ -234,10 +236,13 @@ export default {
break
}
}
}
if (invalid) return
//
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
}
if (invalid) return
this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form

@ -76,7 +76,7 @@ export default {
//
if (this.active === 'tab1') {
const detail = this.$refs.detail
if (detail.updateTime > 1) {
if (detail.step < 4 && detail.$refs['step' + detail.step].updateTime) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
type: 'warning'
}).then(() => {

@ -7,7 +7,7 @@
<span>比赛方式{{ item.methodName }}</span>
<span>比赛形式{{ item.competitionType ? '团队赛' : '个人赛' }}</span>
<span>赛制{{ item.ruleName }}</span>
<span>状态已完成</span>
<span>状态{{ item.status }}</span>
<span>竞赛起止时间{{ item.startTime + ' ~ ' + item.endTime }}</span>
<div>
<el-button type="primary" @click="toRank(item, i)">排名</el-button>
@ -28,14 +28,26 @@ export default {
return {
id: +this.$route.query.id,
list: [],
form: {},
timer: null,
curStep: []
};
},
mounted() {
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
})
this.getData()
},
methods: {
getData() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition
this.timer = setInterval(this.handleStatus, 1000)
this.getArch()
}).catch(err => {})
},
getArch() {
this.$post(this.api.detailsOfCompetitionStage, {
pageNum: 1,
pageSize: 100,
@ -50,6 +62,25 @@ export default {
this.list = list
}).catch(res => {});
},
//
handleStatus() {
const now = new Date()
this.form.competitionStage.map(e => {
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
const item = this.list.find(n => n.stageId == e.stageId)
if (item) {
if (now < startTime) {
this.$set(item, 'status', '未开始')
} else if (now >= startTime && now <= endTime) {
this.$set(item, 'status', '比赛中')
} else if (now > endTime) {
this.$set(item, 'status', '已完成')
}
}
})
console.log("🚀 ~ file: matchArch.vue:87 ~ handleStatus ~ this.status", this.list)
},
//
toRank(row, i) {
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)

@ -266,7 +266,7 @@ export default {
},
//
download() {
location.href = this.api.staffTemplate
location.href = this.api.gradeImport
},
//
handleExceed(files, fileList) {
@ -276,7 +276,7 @@ export default {
},
//
showFaild() {
location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}`
location.href = `${this.api.performanceExportFailure}?exportCode=${this.exportCode}`
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false

@ -7,6 +7,21 @@
</el-card>
<el-card shadow="hover" class="m-b-20">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20">
<tr>
<th width="150">团队名称</th>
<td>
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input>
</td>
<th width="150">团队邀请码</th>
<td>
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input>
</td>
</tr>
</table>
<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>
<table class="table">
<tr>
<th width="150">姓名</th>
@ -21,12 +36,6 @@
<td>{{ info.person.schoolName }}</td>
</tr>
<template v-if="form.completeCompetitionSetup.competitionType">
<tr>
<th width="150">团队名称</th>
<td>
<span>{{ info.team.teamName }}</span>
</td>
</tr>
<template>
<tr>
<th>队长</th>
@ -38,34 +47,24 @@
<el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName }}</el-tag>
</td>
</tr>
<tr>
<th>团队邀请码</th>
<td>
<span>{{ info.team.invitationCode }}</span>
</td>
</tr>
</template>
</template>
<tr>
<th width="130">指导老师</th>
<td>
<table class="table tc">
<tr>
<th width="60">姓名</th>
<th width="100">职务</th>
<th width="100">手机号</th>
</tr>
<template v-if="info.teamInstructors.length">
<tr v-for="(item, i) in info.teamInstructors" :key="i">
<td width="60">{{ item.name }}</td>
<td width="100">{{ item.position }}</td>
<td width="100">{{ item.phone }}</td>
</tr>
<div class="plus">
<i class="el-icon-circle-plus-outline icon" @click="addAdvisor"></i>
</div>
<div v-for="(item, i) in info.teamInstructors" :key="i" class="line">
<el-input placeholder="请输入姓名" v-model="item.name" clearable size="mini" :disabled="!item.edit"></el-input>
<el-input placeholder="请输入职务" maxlength="10" v-model="item.position" clearable size="mini" :disabled="!item.edit"></el-input>
<el-input placeholder="请输入手机号" maxlength="11" v-model="item.phone" clearable size="mini" :disabled="!item.edit"></el-input>
<template v-if="status < 5">
<i v-if="item.edit" class="el-icon-check icon" @click="submitAdvisor(item)"></i>
<i v-else class="el-icon-edit icon" @click="editAdvisor(item)"></i>
<i class="el-icon-delete icon" @click="delAdvisor(item, i)"></i>
</template>
<tr v-else>
<td colspan="3">暂无数据</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
@ -102,7 +101,7 @@
</tr>
</table>
<el-alert
v-if="form.completeCompetitionSetup.competitionType && info.team.captain === 0"
v-if="form.completeCompetitionSetup.competitionType"
style="margin-top: 10px;"
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'"
type="warning"
@ -111,8 +110,46 @@
</td>
</tr>
</table>
<template v-if="form.completeCompetitionSetup.competitionType">
<div class="l-title m-t-20">团队成员</div>
<div class="flex-center">
<p>队长{{ info.caption.userName }}</p>
<el-button type="primary" @click="transfer">转让队长</el-button>
</div>
<el-table :data="info.teamDetail" stripe header-align="center">
<el-table-column prop="userName" label="成员姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="加入时间" width="180" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="scope.row.captain" type="text" @click="removeLine(scope.row)">踢出团队</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-card>
<el-dialog title="选择参赛成员" :visible.sync="transferVisible" :close-on-click-modal="false" width="400px">
<template v-for="(item, i) in info.teamDetail">
<el-radio v-if="item.captain" :key="i" v-model="checkedPlayer" :label="item.teamId">{{ item.userName }}</el-radio>
</template>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="transferSubmit">确定</el-button>
<el-button size="small" @click="transferVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="选择参赛成员" :visible.sync="chooseVisible" :close-on-click-modal="false" width="400px">
<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-group>
<p v-if="info.teamLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制1人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button>
<el-button size="small" @click="chooseVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="团队得分详情" :visible.sync="memberVisible" width="900px" :close-on-click-modal="false">
<h6 v-if="members.length" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ members[0].teamName }} 阶段名称{{ curRow.stageName }}</h6>
<table class="table tc">
@ -155,6 +192,7 @@ export default {
return {
id: +this.$route.query.id,
accountId: +this.$route.query.accountId,
status: 5,
form: {
competitionStage: [],
completeCompetitionSetup: {},
@ -175,15 +213,54 @@ export default {
memberVisible: false,
members: [],
curRow: {},
teamVisible: false,
teams: [],
teamNameRepeat: false,
teamForm: {
accountId: +this.$route.query.accountId,
identification: 1,
competitionId: this.$route.query.id,
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 1
},
curStage: null,
originInfo: {},
originIns: {
position: '',
name: '',
phone: '',
},
checkedPlayer: '',
transferVisible: false,
editing: false,
memberVisible: false,
members: [],
curRow: {},
chooseVisible: false,
checkedMember: '',
checkedMembers: [],
chooses: [],
timerList: [],
timer: null
};
},
mounted() {
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
this.timerList.forEach(n => {
clearInterval(n)
})
this.timerList = []
})
this.getData()
},
methods: {
getData() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition
this.timer = setInterval(this.handleStatus, 1000)
this.getInfo()
}).catch(err => {})
},
@ -191,6 +268,8 @@ export default {
getInfo() {
this.$post(`${this.api.entryInformation}?competitionId=${this.id}&accountId=${this.accountId}`).then(res => {
const info = res.entryInformation
//
if (!info.teamInstructors.length) info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns)))
if (info.personalDetail) {
info.team = {}
info.teamDetail = []
@ -200,9 +279,207 @@ export default {
const caption = info.teamDetail.find(e => !e.caption)
info.caption = caption ? caption : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.originInfo = JSON.parse(JSON.stringify(info))
//
const now = Date.now()
this.form.competitionStage.map(e => {
//
if (!e.resultsDetails) {
const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // +
if (now > endTime) { //
info.stages.find(n => n.stageId == e.stageId).showDetail = 1
} else { //
this.timerList.push(setTimeout(this.getInfo, endTime - now))
}
}
})
this.info = info
}).catch(err => {});
},
//
handleStatus() {
let status
const n = this.form
let now = new Date().getTime();
let signUpStartTime = new Date(this.dateCompatible(n.signUpStartTime)).getTime(); //
let signUpEndTime = new Date(this.dateCompatible(n.signUpEndTime)).getTime(); //
let playStartTime = new Date(this.dateCompatible(n.playStartTime)).getTime(); //
let playEndTime = new Date(this.dateCompatible(n.playEndTime)).getTime(); //
if (now < signUpStartTime) { //
status = 0;
} else if (now > signUpStartTime && now < signUpEndTime) { //
status = n.competitionRegistration ? 1 : 2 // 12
} else if (now > signUpEndTime && now < playStartTime) { // ,
status = 3;
} else if (now > playStartTime && now < playEndTime) { //
status = 4
} else if (now > playEndTime) { //
status = 5;
}
this.status = status
},
//
edit(showMsg) {
if (this.editing || !showMsg) {
const { teamId, teamName, invitationCode } = this.info.team
this.$post(this.api.editCompetitionTeam, {
accountId: this.accountId,
identification: 1,
competitionId: this.id,
teamId,
teamName,
invitationCode,
whetherSignUp: 1
}).then(res => {
this.getInfo()
showMsg && util.successMsg('保存成功')
}).catch(res => {})
} else {
this.editing = !this.editing
}
},
//
delAdvisor(row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getInfo()
}).catch(res => {})
}).catch(() => {})
} else {
this.info.teamInstructors.splice(i, 1)
}
},
//
addAdvisor() {
if (this.info.teamInstructors.length > 4) return util.errorMsg('指导老师仅限添加5个!')
this.info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns)))
},
//
editAdvisor(row) {
this.$set(row, 'edit', 1)
},
//
submitAdvisor(row) {
if (!row.name) return util.errorMsg('请输入姓名')
const { phone } = row
if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式')
this.$post(this.api.addAnAdvisor, {
name: row.name,
competitionId: this.id,
id: row.id,
teamId: this.info.teamId,
phone: row.phone,
position: row.position,
}).then(res => {
util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getInfo()
}).catch(res => {})
},
//
transfer() {
//
const now = new Date()
let start = 0
for (const e of this.form.competitionStage) {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) {
util.errorMsg('比赛已经开始,无法转让队长!')
start = 1
break
}
}
if (!start) this.transferVisible = true
},
//
transferSubmit() {
if (!this.checkedPlayer) return util.errorMsg('请选择成员')
this.$post(this.api.captainOfTransfer, {
captainId: this.info.caption.teamId,
playerId: this.checkedPlayer
}).then(res => {
this.checkedPlayer = ''
util.successMsg('转让成功')
this.transferVisible = false
this.getInfo()
}).catch(res => {})
},
//
removeLine(row) {
//
const now = new Date()
let start = 0
for (const e of this.form.competitionStage) {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) {
util.errorMsg('比赛已经开始,无法踢出成员!')
start = 1
break
}
}
if (!start) {
this.$confirm('确定要踢出该成员吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => {
util.successMsg('移除成功')
this.getInfo()
if (row.accountId == this.accountId) this.$router.back()
}).catch(res => {})
}).catch(() => {})
}
},
//
selectPar(row) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) {
//
const now = new Date()
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else {
const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
const id = e.participantAccountIds
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.chooseVisible = true
}
}
},
//
chooseSubmit() {
const accountIds = this.checkedMembers
if (!accountIds.length) return util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit //
if (accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, {
accountIds,
competitionId: this.id,
stageId: this.curRow.stageId,
teamId: this.info.teamId
}).then(res => {
this.checkedMembers = []
util.successMsg('修改成功')
this.getInfo()
this.chooseVisible = false
}).catch(res => {})
},
//
show(row) {
//
@ -236,6 +513,10 @@ export default {
</script>
<style lang="scss" scoped>
.l-title {
margin-top: 20px;
font-size: 18px;
}
.table {
width: 100%;
border-collapse: collapse;
@ -250,6 +531,16 @@ export default {
text-align: center;
background-color: #f8faff;
}
.icon {
margin-right: 10px;
font-size: 16px;
color: #7a7a7a;
cursor: pointer;
}
.plus {
margin-bottom: 10px;
text-align: right;
}
.line {
display: flex;
align-items: center;
@ -259,4 +550,13 @@ export default {
}
}
}
.flex-center {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.text-center {
text-align: center;
}
</style>

@ -15,13 +15,13 @@
</div>
<div class="flex-between" style="margin: 20px 0">
<div style="display: inline-flex;align-items: center">
<el-radio v-model="type" :label="0">默认系统排序</el-radio>
<el-radio v-model="type" :label="1">手动上传</el-radio>
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio>
<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>
<el-button v-if="!type" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-if="!type" type="primary" @click="cancelPublish(0)">取消发布</el-button>
<el-button v-if="(type && uploadData.length) || (!type && !published)" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center">
@ -164,7 +164,10 @@ export default {
exportCode: '',
curRow: {},
stageName: '',
totalScore: 0
totalScore: 0,
published: false,
uploadData: [],
sourceType: ''
};
},
mounted() {
@ -173,6 +176,33 @@ export default {
methods: {
//
getData() {
//
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
// >(:(1,0))
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
}).catch(res => {})
this.published = whetherToPublish
this.getRank(whetherToPublish)
}).catch(res => {})
},
//
getRank(whetherToPublish) {
//
if (whetherToPublish) {
console.log(44, this.active)
this.$post(this.api.manuallyRankTheUploadList, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
stageId: this.active || ''
}).then(({ message }) => {
this.list = message.records
this.total = message.total
}).catch(res => {})
} else { //
if (!this.active) {
//
const ids = this.grades.map(e => e.stageId)
@ -191,6 +221,7 @@ export default {
this.total = total
}).catch(res => {})
}
}
},
//
getStage() {
@ -209,6 +240,10 @@ export default {
this.getData()
}).catch(res => {});
},
//
typeChange(val) {
this.getRank(val)
},
initData() {
this.page = 1
this.getData()
@ -294,42 +329,12 @@ export default {
this.getData();
},
//
publish() {
const promises = []
publishSubmit() {
let data = this.uploadData // data
if (!this.type) { //
//
const { list, id } = this
const result = []
const isOverall = this.active ? 0 : 1
const data = {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
}
// idid
// if (this.active) {
// data.stageId = this.active
// } else {
// const ids = this.grades.map(e => e.stageId)
// data.stageIds = ids.splice(0, ids.length - 1).join()
// }
// list.map(e => {
// data.teamId = e.teamId
// const temp = JSON.parse(JSON.stringify(data))
// temp.teamId = e.teamId
// promises.push(new Promise((resolve,reject) => {
// //
// this.$post(this.api[this.active ? 'stageTeamScoreDetails' : 'multipleStageTeamScoreDetails'], temp).then(({ page }) => {
// const { records } = page
// records.map(n => {
// n.teamId = e.teamId
// n.competitionId = id
// n.isOverallRanking = isOverall
// })
// result.push(...records)
// resolve()
// }).catch(res => {})
// }))
// })
// Promise.all(promises).then(_ => {
if (list.length) {
const isPerson = this.competitionType == 0
list.map(e => {
@ -338,11 +343,32 @@ export default {
if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
this.$post(this.api.publishRanking, this.list).then(res => {
data = list
}
}
//
this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(this.api.publishRanking, data).then(res => {
this.uploadData = []
this.getData()
util.successMsg('发布成功!')
}).catch(res => {})
}).catch(res => {})
},
//
publish() {
//
if (this.published && this.sourceType != !this.type) {
this.$confirm(this.sourceType && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为为系统排名的内容?' :
'默认系统排名已发布,是否要取消系统排名的内容,改为为手动发布的内容?', '提示', {
type: 'success'
}).then(() => {
this.publishSubmit()
}).catch(() => {})
} else {
this.publishSubmit()
}
// })
},
//
cancelPublish(publish) {
@ -352,6 +378,8 @@ export default {
stageIds.map(e => {
query.push('stageIds=' + e)
})
//
//
if (publish) {
this.$post(this.api.deleteLastPublication, {
competitionId: this.id,
@ -362,6 +390,7 @@ export default {
}).catch(res => {})
} else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
this.getData()
util.successMsg('取消发布成功!')
}).catch(res => {})
}
@ -388,17 +417,19 @@ export default {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => {})
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if (res.status === 200) {
if (res.data.exportCode) {
this.exportCode = res.data.exportCode
const { exportCode } = res.data
if (exportCode) {
this.exportCode = exportCode
this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
}
this.uploadData = res.data.data
} else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据")
}
@ -419,10 +450,8 @@ export default {
},
uploadSure() {
this.importVisible = false
this.studentType = 1
this.keyWord = ''
this.$refs.orgTree.setCurrentKey(null)
this.getOrg()
this.list = this.uploadData
this.uploadData.length && util.successMsg('请检查数据后,点击发布排名以发布数据!')
}
}
};

@ -9,7 +9,7 @@
</li>
<li>
<label>参赛人员状态</label>
<el-select v-model="status" @change="initData">
<el-select v-model="isDisable" @change="initData">
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
@ -58,27 +58,36 @@
</div>
<el-dialog title="新增参赛人员" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd">
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '参赛人员'" :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-item prop="schoolId" label="所属院校">
<el-form-item prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.customerName" :value="item.customerId"></el-option>
<el-option v-for="(item, i) in clients" :key="i" :label="item.customerName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="userName" label="姓名">
<el-input v-model="form.userName" placeholder="请输入姓名"></el-input>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="workNumber" label="学号">
<el-input v-model="form.workNumber" placeholder="请输入学号"></el-input>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item label="账号角色">
学生
</el-form-item>
<el-form-item prop="teamId" label="所属团队">
<div style="display: flex;align-items: center">
<el-select v-model="form.teamId" style="width: 240px;margin-right: 10px">
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable style="width: 240px;margin-right: 10px">
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
</el-select>
<el-button type="text" @click="createTeam">创建团队</el-button>
<el-button v-if="isAdd && !formEnable" type="text" @click="createTeam">创建团队</el-button>
</div>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" maxlength="11" placeholder="请输入手机号" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button>
@ -96,7 +105,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">创建并报名</el-button>
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button>
</span>
</el-dialog>
@ -106,14 +115,14 @@
<script>
import util from "@/libs/util";
import axios from 'axios'
import Setting from "@/setting";
export default {
name: "matchSignup",
data() {
return {
token: sessionStorage.getItem('token'),
id: +this.$route.query.id,
status: '',
isDisable: '',
statusList: [
{
id: '',
@ -124,7 +133,7 @@ export default {
name: '已禁用'
},
{
id: 2,
id: 0,
name: '未禁用'
}
],
@ -134,23 +143,30 @@ export default {
page: 1,
pageSize: 10,
total: 0,
schoolOrder: '',
teamOrder: '',
clients: [],
addVisible: false,
formEnable: true,
isAdd: false,
form: {
captain: 0,
competitionId: this.$route.query.id,
userName: '',
workNumber: '',
schoolId: '',
teamId: '',
whetherSignUp: 0
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
},
rules: {
schoolId: [
{ required: true, message: "请选择所属院校", trigger: "change" }
],
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
],
workNumber: [
{ required: true, message: "请输入学号", trigger: "blur" }
],
@ -169,8 +185,10 @@ export default {
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 0
whetherSignUp: 0,
identification: 1
},
originForm: {}
};
},
watch: {
@ -193,6 +211,9 @@ export default {
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
isDisable: this.isDisable,
schoolOrder: this.schoolOrder,
teamOrder: this.teamOrder,
}).then(({ data }) => {
this.listData = data.records;
this.total = data.total;
@ -212,44 +233,133 @@ export default {
this.getData();
},
switchOff(val, row, index) {
this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`)
.then(res => {
})
.catch(err => {
});
this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {});
},
//
sortChange(column, prop, order) {
console.log(column, prop, order)
sortChange(column) {
// 12
if (column.prop === 'school') this.schoolOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
this.getData()
},
//
add() {
this.isAdd = true
this.addVisible = true
},
//
edit(row) {
this.isAdd = false
this.addVisible = true
row.userName = row.username
row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row))
},
//
workNumberChange() {
const { form } = this
form.schoolId && form.schoolId && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}`).then(({ account }) => {
if (account) {
account
this.form = account
}
this.formEnable = !account
}).catch(res => {})
},
//
submitForm() {
const { form } = this
if (!this.isAdd) { //
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
id: form.id,
},
hrUserInfo: {
userId: form.userId,
schoolId: form.schoolId,
email: form.email
}
}).then(res => {
//
if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, {
accountId: form.id,
competitionId: this.id,
teamId: form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.getData()
this.submiting = false
util.successMsg('编辑成功!')
}).catch(res => {
this.submiting = false
})
} else {
this.addVisible = false
this.getData()
this.submiting = false
util.successMsg('编辑成功!')
}
}).catch(res => {
this.submiting = false
})
} else {
//
this.$post(this.api.joinCompetitionTeam, {
accountId: form.id,
competitionId: this.id,
teamId: this.form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.getData()
this.submiting = false
util.successMsg('报名成功!')
}).catch(res => {
this.submiting = false
})
}
},
//
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
this.$post(this.api.joinCompetitionTeam, this.form).then(res => {
this.addVisible = false
this.getData()
this.submiting = false
util.successMsg('报名成功!')
}).catch(res => {})
const { form } = this
const team = this.teams.find(e => e.teamId == form.teamId)
if (team && team.invitationCode) form.invitationCode = team.invitationCode
// id-id-schoolId-workNumber
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号/邮箱")
} else {
this.submitForm()
}
}
})
},
//
closeAdd() {
this.form = {
captain: 0,
competitionId: this.id,
userName: '',
workNumber: '',
schoolId: '',
teamId: '',
whetherSignUp: 0
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
}
},
//
@ -259,7 +369,8 @@ export default {
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 0
whetherSignUp: 0,
identification: 1
}
this.teamVisible = true
},
@ -288,14 +399,10 @@ export default {
const form = this.teamForm
if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id
this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false
this.form.teamId
}).catch(res => {})
},
//
edit(row) {
},
//
info(row) {

@ -127,15 +127,15 @@ export default {
}
},
getProgress() { //
this.$get(this.api.getContestProgress, {
contestId: this.form.id
this.$get(this.api.getCompetitionProgress, {
competitionId: this.form.id
}).then(res => {
this.progress = res.contestProgressList.reverse()
this.progress = res.competitionProgressList.reverse()
}).catch(err => {});
},
//
getNotice() {
this.$post(`${this.api.queryAnnouncementByContestId}?pageNum=1&pageSize=1000&contestId=${this.form.id}`).then(({ data }) => {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=1&pageSize=1000&competitionId=${this.form.id}`).then(({ data }) => {
const records = data.records.filter(e => e.status) // status 0稿 1
records.map(e => {
e.announcementText = e.announcementText.replace(/<img.*?(?:>|\/>)/gi, '')

@ -438,6 +438,155 @@
</el-table>
</div>
</el-card>
<!-- 职站增值模块权限 -->
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>职站增值模块权限</span>
</div>
<div>
<template v-if="!viewDisabled && !renewDisabled && dataPlatformPermissions.length">
<el-button v-if="dataPlatformPermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 2)">一键发货</el-button>
<el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 2)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addValueJurisdiction()">添加</el-button>
</div>
</div>
<!--:summary-method="getSummaries"-->
<el-table :data="valuePermissions" class="orderTable orderTables" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center">
</el-table-column>
<el-table-column prop="productName" label="模块名称" align="center" min-width="100">
</el-table-column>
<el-table-column label="使用期限" align="center" min-width="190">
<template slot-scope="scope">
<div class="small">
<el-input
class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span style="margin-left:5px">
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)">
<el-option label="日" :value="0"></el-option>
<el-option label="月" :value="1"></el-option>
<el-option label="年" :value="2"></el-option>
</el-select>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker
:class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
placeholder="请选择使用日期">
</el-date-picker>
</p>
<p v-else>
<el-date-picker
:class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p>
</template>
</el-table-column>
<el-table-column label="剩余期限" align="center" min-width="120">
<template slot-scope="scope">
<div class="small">
<el-input disabled v-model="scope.row.remainingPeriod" placeholder=""
type="text"></el-input>
<span style="margin-left:5px"></span>
</div>
</template>
</el-table-column>
<el-table-column label="市场价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input class="normal" disabled v-model="scope.row.marketValue" type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="折扣率 " align="center" min-width="110">
<template slot-scope="scope">
<el-input class="normal" disabled v-model="scope.row.discountRate" placeholder=""
type="text" size="small" style="width: 100%"></el-input>
</template>
</el-table-column>
<el-table-column label="成交价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input :class="['normal', scope.row.finalPrice === '' && whetherSubmit?'red':'']"
:disabled="viewDisabled"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.finalPrice"
type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="结算价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input :class="['normal', scope.row.settlementPrice === '' && whetherSubmit?'red':'']"
:disabled="viewDisabled"
@input="scope.row.settlementPrice = scope.row.settlementPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.settlementPrice"
type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<div class="flex-c-c">
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delDataForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
v-if="scope.row.status === 1 || dispose || isAdd"
v-auth="'/order:发货'"
style="margin-right:10px;"
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.ship ? '已发货' : '未发货'"
@change="handleDeliver($event,scope.row)">
</el-switch>
<el-switch
v-else
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="handleEnable($event,scope.row)">
</el-switch>
</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<!-- 合同 -->
<el-card shadow="hover" class="mgb20">
<div>
@ -592,6 +741,16 @@
</span>
</el-dialog>
<el-dialog :visible.sync="valueVisible" width="50%" center>
<el-checkbox-group v-model="valueCheck">
<el-checkbox v-for="(item, i) in valueList" :key="i" :label="item.id">{{ item.moduleName }}</el-checkbox>
</el-checkbox-group>
<span slot="footer" class="dialog-footer">
<el-button @click="valueVisible = false"> </el-button>
<el-button type="primary" v-preventReClick @click="addValue"> </el-button>
</span>
</el-dialog>
<!-- 选择IP -->
<el-dialog :visible.sync="ipVisible" width="70%" center>
<div class="flex-center mgb20">
@ -685,6 +844,7 @@ export default {
},
coursePermissions: [],//
dataPlatformPermissions: [],//
valuePermissions: [],
contract: { //
contractName: "", //
contractFile: "", //
@ -798,12 +958,15 @@ export default {
platfromPage: 1,//
platformList: [],//
platformSelect: [],//
valueVisible: false,
valueCheck: [],
productName: "",//
searchTimer: null,
titlesw:'',
orderRepeat: [],
repeatMsg: '',
clients: []
clients: [],
valueList: []
};
},
watch: {
@ -914,12 +1077,12 @@ export default {
const { customerId } = form
const list = []
//
if (orderOther.find(e => e.authority)) {
if (orderOther.find(e => e.authority === 1)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 1,
customerId,
productId: orderOther.filter(e => e.authority).map(e => e.dataOrCourseId)
productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
@ -938,6 +1101,18 @@ export default {
}).catch(err => {})
}))
}
if (orderOther.find(e => e.authority === 2)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 2,
customerId,
productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
}).catch(err => {})
}))
}
Promise.all(promises).then(_ => {
this.setStartDate(list, orderOther)
})
@ -987,6 +1162,7 @@ export default {
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.valuePermissions = list.filter(i => i.authority === 2);
},
//
getClients() {
@ -1013,8 +1189,8 @@ export default {
submitOrder() {
let purchase = 0 //
let profit = 0 //
if (!this.coursePermissions.length && !this.dataPlatformPermissions.length) {
return this.$message.error("请选择课程权限或数据权限后再确认订单");
if (!this.coursePermissions.length && !this.dataPlatformPermissions.length && !this.valuePermissions.length) {
return this.$message.error("请选择课程权限或数据权限或职站增值模块权限后再确认订单");
} else {
//
if (this.coursePermissions.length) {
@ -1058,11 +1234,31 @@ export default {
return this.$message.error("请把产品参数输入完整");
}
}
if (this.valuePermissions.length) {
let courseVerify =
this.valuePermissions.some(e => {
if (!e.periodOfUse || e.finalPrice === '') {
return false;
} else {
const curPurchase = +e.settlementPrice + (e.settlementPrice / 10)
purchase += curPurchase
profit += +e.finalPrice - curPurchase
return true;
}
});
if (!courseVerify) {
this.whetherSubmit = true;
setTimeout(() => {
this.whetherSubmit = false;
}, 4000);
return this.$message.error("请把课程参数输入完整");
}
}
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.orderRepeat.length) return this.$message.error(this.repeatMsg)
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions];
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions];
let renew = tempArr.some(e => e.renew);
if (this.renewDisabled || renew) {/* 续费状态下 */
this.form.orderNature = 2;
@ -1272,6 +1468,50 @@ export default {
this.showPlatform = true;
this.getDataJurisdiction();
},
addValueJurisdiction() {
if (!this.form.customerId) return this.$message.warning("请先选择客户");
this.valueVisible = true;
this.getValueJurisdiction();
},
getValueJurisdiction() {
this.$post(this.api.getValueModule + '?platformId=1').then(res => {
this.valueList = res.valueList
}).catch(err => {
});
},
addValue() {
const val = this.valueCheck
if (!val.length) return this.$message.warning("请选择模块");
const data = []
const { orderType } = this.form
val.map(e => {
data.push({
dataOrCourseId: e,// id
productName: this.valueList.find(n => n.id === e).moduleName,//
periodOfUse: "",// 使
startTime: new Date(),//
endTime: "", //
remainingPeriod: "",//
marketValue: '', //
marketPrice: e.market, //
finalPrice: orderType === 2 ? 0 : '',//
finalValue: orderType === 2 ? 0 : '', //
discountRate: "",//
accountNum: "",//
totalAmount: orderType === 2 ? 0 : '',//
isEnable: 1, // 10
ship: 0,// 01
authority: 2,
options:1,
settlementPrice: orderType === 2 ? 0 : '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
})
})
this.valuePermissions = data
this.valueVisible = false
},
//
getDataJurisdiction() {
let param = {
@ -1522,7 +1762,7 @@ export default {
const useUnit = row.periodOfUse // 使
let price = row.marketPrice //
// //365,/12)
row.marketValue = ((!unit ?
if (useUnit && price) row.marketValue = ((!unit ?
price / 365 * useUnit :
unit === 1 ?
price / 12 * useUnit :

Loading…
Cancel
Save