|
|
|
@ -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> |
|
|
|
@ -36,6 +39,10 @@ |
|
|
|
|
round |
|
|
|
|
@click="exportAll" |
|
|
|
|
v-auth="'/match/list:管理:报名人员:批量导出'">批量导出</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="batchDel" |
|
|
|
|
round |
|
|
|
|
v-auth="'/match:管理:报名人员:导出'">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -60,31 +67,75 @@ |
|
|
|
|
</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-if="scope.row.identification" |
|
|
|
|
type="text" |
|
|
|
|
@click="edit(scope.row)" |
|
|
|
|
v-auth="'/match/list:管理:报名人员:编辑'">编辑</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
<template v-if="info.releaseType"> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="toInfo(scope.row)" |
|
|
|
@ -118,12 +169,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" |
|
|
|
@ -303,6 +367,7 @@ export default { |
|
|
|
|
userName: '', |
|
|
|
|
workNumber: '', |
|
|
|
|
schoolId: '', |
|
|
|
|
studentAffiliatedInstitutionId: '', |
|
|
|
|
teamId: '', |
|
|
|
|
whetherSignUp: 0, |
|
|
|
|
phone: '', |
|
|
|
@ -359,12 +424,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
console.log(44, this.$store.state.user.schoolId) |
|
|
|
|
this.initData() |
|
|
|
|
this.getInfo() |
|
|
|
|
this.getTeam() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
init () { |
|
|
|
|
this.initData() |
|
|
|
|
this.getTeam() |
|
|
|
|
this.getClient() |
|
|
|
|
}, |
|
|
|
|
getData () { |
|
|
|
|
this.$post(this.api.queryRegistrationByCondition, { |
|
|
|
|
pageNum: this.page, |
|
|
|
@ -375,7 +444,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 => { |
|
|
|
@ -415,6 +490,10 @@ export default { |
|
|
|
|
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 自动分配 |
|
|
|
|
autoAllocation () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
@ -440,7 +519,8 @@ export default { |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
console.log("🚀 ~ showFaild ~ res:", res) |
|
|
|
|
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 }) { |
|
|
|
@ -470,6 +550,7 @@ export default { |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
uploadSure () { |
|
|
|
|
this.init() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
}, |
|
|
|
@ -490,13 +571,30 @@ 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 |
|
|
|
@ -534,6 +632,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, |
|
|
|
@ -541,7 +640,7 @@ export default { |
|
|
|
|
whetherSignUp: 1 |
|
|
|
|
}).then(res => { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
@ -549,7 +648,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
} |
|
|
|
@ -559,6 +658,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, |
|
|
|
@ -566,7 +666,7 @@ export default { |
|
|
|
|
whetherSignUp: 1 |
|
|
|
|
}).then(res => { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('报名成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
@ -650,10 +750,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 => { }) |
|
|
|
|
}, |
|
|
|
@ -683,7 +784,25 @@ export default { |
|
|
|
|
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
|
batchDel () { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.batchDeleteApplicants, { registrationVOS: this.multipleSelection }).then(res => { |
|
|
|
|
this.getData(); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning("请先选择数据 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|