赛事导入人员等

dev_review
yujialong 8 months ago
parent a140f773c8
commit e615d0399b
  1. 3
      src/components/Header.vue
  2. 1
      src/utils/api.js
  3. 10
      src/views/match/list/index.vue
  4. 130
      src/views/match/manage/matchSignup.vue

@ -24,6 +24,7 @@
</template> </template>
<script> <script>
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
import Setting from '@/setting'
export default { export default {
data () { data () {
return { return {
@ -100,7 +101,7 @@ export default {
id && this.$store.commit('SET_ACCOUNTID', id) id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName) this.$store.commit('SET_USERNAME', this.userName)
this.initSocket(result.userAccount) this.initSocket(result.userAccount)
this.heartbeatDetection() Setting.isPro && this.heartbeatDetection()
}).catch(err => { }) }).catch(err => { })
}, },
}, },

@ -371,6 +371,7 @@ export default {
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`, enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`, cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`,
schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`, schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`,
batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`,
batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`, batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`,
batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`, batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`,
TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`, TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`,

@ -98,12 +98,20 @@
<el-table-column prop="competitionName" <el-table-column prop="competitionName"
label="竞赛名称" label="竞赛名称"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="name"
label="竞赛类型"
width="90"
align="center">
<template slot-scope="scope">
{{ scope.row.setup ? (scope.row.setup.competitionType ? '团队赛' : '个人赛') : '' }}
</template>
</el-table-column>
<el-table-column prop="founderName" <el-table-column prop="founderName"
label="创建人" label="创建人"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="name" <el-table-column prop="name"
label="大赛来源" label="大赛来源"
width="120" width="110"
align="center"> 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 }}

@ -6,12 +6,12 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>搜索</label> <label>搜索</label>
<el-input placeholder="请输入姓名/手机号/学号" <el-input :placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="keyword" v-model="keyword"
clearable clearable
size="mini" size="mini"
style="width: 250px"></el-input> style="width: 350px"></el-input>
</li> </li>
<li v-if="info.releaseType"> <li v-if="info.releaseType">
<label>参赛人员状态</label> <label>参赛人员状态</label>
@ -25,6 +25,9 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary"
round
@click="autoAllocation">自动分配阶段成员</el-button>
<el-button type="primary" <el-button type="primary"
round round
@click="batchImport">导入</el-button> @click="batchImport">导入</el-button>
@ -64,30 +67,74 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="school" <el-table-column prop="school"
label="学校" label="学生账号归属"
sortable="custom"> min-width="180"
align="center">
</el-table-column>
<el-table-column prop="realSchool"
label="学生所属院校"
sortable="custom"
min-width="180"
align="center">
</el-table-column> </el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" <el-table-column v-if="info.completeCompetitionSetup.competitionType"
prop="teamName" prop="teamName"
label="团队名称" label="团队名称"
sortable="custom"> sortable="custom"
min-width="140"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="username" <el-table-column prop="username"
label="学生姓名"> label="队长/成员"
min-width="140"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="workNumber" <el-table-column prop="workNumber"
label="学号"> label="队长/成员学号"
min-width="140"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="phone" <el-table-column prop="phone"
label="手机号"> label="队长/成员手机号"
min-width="140"
align="center">
</el-table-column>
<el-table-column label="是否为队长"
min-width="80"
align="center">
<template slot-scope="scope">
{{ scope.row.captain ? '否' : '是' }}
</template>
</el-table-column>
<el-table-column prop="teachers"
label="指导老师"
min-width="200"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.teachers">
<el-tooltip placement="top">
<div slot="content"
style="line-height: 1.8">
<div v-for="(item, i) in scope.row.teachers"
:key="i">
{{ item.name }}{{ item.phone ? ',' + item.phone : '' }}{{ item.position ? ',' + item.position : '' }}
</div>
</div>
<p>{{ scope.row.teachers[0].name }}{{ scope.row.teachers[0].phone ? ',' + scope.row.teachers[0].phone : '' }}{{ scope.row.teachers[0].position ? ',' + scope.row.teachers[0].position : '' }}</p>
</el-tooltip>
</template>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
align="center" align="center"
width="320"> width="270">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/match:管理:报名人员:编辑'" <el-button v-auth="'/match:管理:报名人员:编辑'"
type="text" type="text"
@click="edit(scope.row)">编辑</el-button> @click="edit(scope.row)">编辑</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<template v-if="info.releaseType"> <template v-if="info.releaseType">
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" <el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'"
type="text" type="text"
@ -121,12 +168,25 @@
<el-form ref="form" <el-form ref="form"
:model="form" :model="form"
:rules="rules" :rules="rules"
label-width="80px" label-width="110px"
style='margin-right: 10px;'> style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable" <el-form-item v-if="!schoolDisable"
prop="schoolId" prop="schoolId"
label="院校"> label="学生账号归属">
<el-select v-model="form.schoolId" <el-select v-model="form.schoolId"
filterable
:disabled="!isAdd"
style="width: 100%">
<el-option v-for="(item, i) in clients"
:key="i"
:label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="!schoolDisable"
prop="studentAffiliatedInstitutionId"
label="学生所属院校">
<el-select v-model="form.studentAffiliatedInstitutionId"
filterable filterable
style="width: 100%"> style="width: 100%">
<el-option v-for="(item, i) in clients" <el-option v-for="(item, i) in clients"
@ -306,6 +366,7 @@ export default {
userName: '', userName: '',
workNumber: '', workNumber: '',
schoolId: '', schoolId: '',
studentAffiliatedInstitutionId: '',
teamId: '', teamId: '',
whetherSignUp: 0, whetherSignUp: 0,
phone: '', phone: '',
@ -366,6 +427,11 @@ export default {
this.getTeam() this.getTeam()
}, },
methods: { methods: {
init () {
this.initData()
this.getTeam()
this.getClient()
},
getData () { getData () {
this.$post(this.api.queryRegistrationByCondition, { this.$post(this.api.queryRegistrationByCondition, {
pageNum: this.page, pageNum: this.page,
@ -376,7 +442,13 @@ export default {
schoolOrder: this.schoolOrder, schoolOrder: this.schoolOrder,
teamOrder: this.teamOrder, teamOrder: this.teamOrder,
}).then(({ data }) => { }).then(({ data }) => {
this.listData = data.records; const list = data.records;
list.map(e => {
if (e.teacherDetails) {
e.teachers = JSON.parse(e.teacherDetails)
}
})
this.listData = list
this.total = data.total; this.total = data.total;
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
}).catch(res => { }).catch(res => {
@ -416,7 +488,10 @@ export default {
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
this.getData() this.getData()
}, },
//
autoAllocation () {
},
// //
batchImport () { batchImport () {
@ -441,7 +516,8 @@ export default {
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
console.log("🚀 ~ showFaild ~ res:", res, res.headers['content-disposition'], typeof res.headers['content-disposition']) console.log("🚀 ~ showFaild ~ res:", res, res.headers['content-disposition'], typeof res.headers['content-disposition'])
util.downloadFileDirect(decodeURI(res.headers['content-disposition']), new Blob([res.data])) const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data]))
}).catch(res => { }) }).catch(res => { })
}, },
uploadSuccess ({ data, status }) { uploadSuccess ({ data, status }) {
@ -471,6 +547,7 @@ export default {
this.uploadFaild = false this.uploadFaild = false
}, },
uploadSure () { uploadSure () {
this.init()
this.importVisible = false this.importVisible = false
this.keyWord = '' this.keyWord = ''
}, },
@ -491,13 +568,26 @@ export default {
this.originForm = JSON.parse(JSON.stringify(row)) this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
}, },
del (row) {
this.$confirm(row.captain ? '此删除操作不可逆,是否确认删除选中项?' : '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?', "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => { });
}).catch(() => { });
},
// //
workNumberChange () { workNumberChange () {
const { form } = this const { form } = this
if (this.originForm.workNumber !== form.workNumber) { if (this.originForm.workNumber !== form.workNumber) {
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => { form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => {
this.notExit = 0
this.exitMember = 0 this.exitMember = 0
if (account) { if (account) {
const { studentAffiliatedInstitutionId } = form
account.studentAffiliatedInstitutionId = studentAffiliatedInstitutionId
this.form = account this.form = account
} }
this.formEnable = !account this.formEnable = !account
@ -535,6 +625,7 @@ export default {
// //
if (this.originForm.teamId !== form.teamId) { if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, { this.$post(this.api.joinCompetitionTeam, {
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
teamId: form.teamId, teamId: form.teamId,
@ -542,7 +633,7 @@ export default {
whetherSignUp: 1 whetherSignUp: 1
}).then(res => { }).then(res => {
this.addVisible = false this.addVisible = false
this.getData() this.init()
this.submiting = false this.submiting = false
util.successMsg('编辑成功!') util.successMsg('编辑成功!')
}).catch(res => { }).catch(res => {
@ -550,7 +641,7 @@ export default {
}) })
} else { } else {
this.addVisible = false this.addVisible = false
this.getData() this.init()
this.submiting = false this.submiting = false
util.successMsg('编辑成功!') util.successMsg('编辑成功!')
} }
@ -560,6 +651,7 @@ export default {
} else { } else {
// //
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], { this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
teamId: this.form.teamId, teamId: this.form.teamId,
@ -567,7 +659,7 @@ export default {
whetherSignUp: 1 whetherSignUp: 1
}).then(res => { }).then(res => {
this.addVisible = false this.addVisible = false
this.getData() this.init()
this.submiting = false this.submiting = false
util.successMsg('报名成功!') util.successMsg('报名成功!')
}).catch(res => { }).catch(res => {
@ -651,10 +743,11 @@ export default {
if (!form.teamName) return util.errorMsg('请输入团队名称') if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码') if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id form.accountId = this.form.id
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId
this.$post(this.api.addCompetitionTeam, form).then(res => { this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false this.teamVisible = false
this.addVisible = false this.addVisible = false
this.getData() this.init()
util.successMsg('报名成功!') util.successMsg('报名成功!')
}).catch(res => { }) }).catch(res => { })
}, },
@ -691,8 +784,7 @@ export default {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id); this.$post(this.api.batchDeleteApplicants, { registrationVOS: this.multipleSelection }).then(res => {
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => {
this.getData(); this.getData();
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.clearSelection() this.$refs.table.clearSelection()

Loading…
Cancel
Save