|
|
|
@ -6,12 +6,12 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input placeholder="请输入姓名/手机号/学号" |
|
|
|
|
<el-input :placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" |
|
|
|
|
clearable |
|
|
|
|
size="mini" |
|
|
|
|
style="width: 250px"></el-input> |
|
|
|
|
style="width: 350px"></el-input> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="info.releaseType"> |
|
|
|
|
<label>参赛人员状态:</label> |
|
|
|
@ -25,6 +25,9 @@ |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="autoAllocation">自动分配阶段成员</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="batchImport">导入</el-button> |
|
|
|
@ -64,30 +67,74 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="school" |
|
|
|
|
label="学校" |
|
|
|
|
sortable="custom"> |
|
|
|
|
label="学生账号归属" |
|
|
|
|
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 v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
prop="teamName" |
|
|
|
|
label="团队名称" |
|
|
|
|
sortable="custom"> |
|
|
|
|
sortable="custom" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="username" |
|
|
|
|
label="学生姓名"> |
|
|
|
|
label="队长/成员" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
label="学号"> |
|
|
|
|
label="队长/成员学号" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<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 label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="320"> |
|
|
|
|
width="270"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button v-auth="'/match:管理:报名人员:编辑'" |
|
|
|
|
type="text" |
|
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
<template v-if="info.releaseType"> |
|
|
|
|
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" |
|
|
|
|
type="text" |
|
|
|
@ -121,12 +168,25 @@ |
|
|
|
|
<el-form ref="form" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
label-width="80px" |
|
|
|
|
label-width="110px" |
|
|
|
|
style='margin-right: 10px;'> |
|
|
|
|
<el-form-item v-if="!schoolDisable" |
|
|
|
|
prop="schoolId" |
|
|
|
|
label="院校"> |
|
|
|
|
label="学生账号归属"> |
|
|
|
|
<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 |
|
|
|
|
style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in clients" |
|
|
|
@ -306,6 +366,7 @@ export default { |
|
|
|
|
userName: '', |
|
|
|
|
workNumber: '', |
|
|
|
|
schoolId: '', |
|
|
|
|
studentAffiliatedInstitutionId: '', |
|
|
|
|
teamId: '', |
|
|
|
|
whetherSignUp: 0, |
|
|
|
|
phone: '', |
|
|
|
@ -366,6 +427,11 @@ export default { |
|
|
|
|
this.getTeam() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
init () { |
|
|
|
|
this.initData() |
|
|
|
|
this.getTeam() |
|
|
|
|
this.getClient() |
|
|
|
|
}, |
|
|
|
|
getData () { |
|
|
|
|
this.$post(this.api.queryRegistrationByCondition, { |
|
|
|
|
pageNum: this.page, |
|
|
|
@ -376,7 +442,13 @@ export default { |
|
|
|
|
schoolOrder: this.schoolOrder, |
|
|
|
|
teamOrder: this.teamOrder, |
|
|
|
|
}).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.$refs.table.clearSelection(); |
|
|
|
|
}).catch(res => { |
|
|
|
@ -416,7 +488,10 @@ export default { |
|
|
|
|
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 自动分配 |
|
|
|
|
autoAllocation () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
|
batchImport () { |
|
|
|
@ -441,7 +516,8 @@ export default { |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
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 => { }) |
|
|
|
|
}, |
|
|
|
|
uploadSuccess ({ data, status }) { |
|
|
|
@ -471,6 +547,7 @@ export default { |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
uploadSure () { |
|
|
|
|
this.init() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
}, |
|
|
|
@ -491,13 +568,26 @@ export default { |
|
|
|
|
this.originForm = 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 () { |
|
|
|
|
const { form } = this |
|
|
|
|
if (this.originForm.workNumber !== form.workNumber) { |
|
|
|
|
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => { |
|
|
|
|
this.notExit = 0 |
|
|
|
|
this.exitMember = 0 |
|
|
|
|
if (account) { |
|
|
|
|
const { studentAffiliatedInstitutionId } = form |
|
|
|
|
account.studentAffiliatedInstitutionId = studentAffiliatedInstitutionId |
|
|
|
|
this.form = account |
|
|
|
|
} |
|
|
|
|
this.formEnable = !account |
|
|
|
@ -535,6 +625,7 @@ export default { |
|
|
|
|
// 团队有更换,则调加入团队的接口 |
|
|
|
|
if (this.originForm.teamId !== form.teamId) { |
|
|
|
|
this.$post(this.api.joinCompetitionTeam, { |
|
|
|
|
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, |
|
|
|
|
accountId: form.id, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
teamId: form.teamId, |
|
|
|
@ -542,7 +633,7 @@ export default { |
|
|
|
|
whetherSignUp: 1 |
|
|
|
|
}).then(res => { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
@ -550,7 +641,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
} |
|
|
|
@ -560,6 +651,7 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
// 新增人员后再调加入团队的接口 |
|
|
|
|
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], { |
|
|
|
|
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, |
|
|
|
|
accountId: form.id, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
teamId: this.form.teamId, |
|
|
|
@ -567,7 +659,7 @@ export default { |
|
|
|
|
whetherSignUp: 1 |
|
|
|
|
}).then(res => { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('报名成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
@ -651,10 +743,11 @@ export default { |
|
|
|
|
if (!form.teamName) return util.errorMsg('请输入团队名称') |
|
|
|
|
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码') |
|
|
|
|
form.accountId = this.form.id |
|
|
|
|
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId |
|
|
|
|
this.$post(this.api.addCompetitionTeam, form).then(res => { |
|
|
|
|
this.teamVisible = false |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
util.successMsg('报名成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
@ -691,8 +784,7 @@ export default { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id); |
|
|
|
|
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => { |
|
|
|
|
this.$post(this.api.batchDeleteApplicants, { registrationVOS: this.multipleSelection }).then(res => { |
|
|
|
|
this.getData(); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|