|
|
|
@ -1,319 +1,171 @@ |
|
|
|
|
<template> |
|
|
|
|
<!-- 报名人员 --> |
|
|
|
|
<div class="page-content" |
|
|
|
|
style="padding: 24px"> |
|
|
|
|
<div class="page-content" style="padding: 24px"> |
|
|
|
|
<div class="tool"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input :placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model="keyword" |
|
|
|
|
clearable |
|
|
|
|
size="mini" |
|
|
|
|
style="width: 350px"></el-input> |
|
|
|
|
<el-input |
|
|
|
|
:placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'" |
|
|
|
|
prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 350px"></el-input> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="info.releaseType"> |
|
|
|
|
<label>参赛人员状态:</label> |
|
|
|
|
<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 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> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="autoAllocation">自动分配阶段成员</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="batchImport">导入</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="add" |
|
|
|
|
v-auth="'/match:管理:报名人员:新增'">新增</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
:loading="exporting" |
|
|
|
|
@click="exportAll" |
|
|
|
|
<el-button type="primary" round @click="autoAllocationConfirm">{{ !notBeginSign && allocated ? '取消' : '' |
|
|
|
|
}}自动分配阶段成员</el-button> |
|
|
|
|
<el-button type="primary" round @click="batchImport">导入</el-button> |
|
|
|
|
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button> |
|
|
|
|
<el-button type="primary" round :loading="exporting" @click="exportAll" |
|
|
|
|
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="batchDel" |
|
|
|
|
round |
|
|
|
|
v-auth="'/match:管理:报名人员:导出'">批量删除</el-button> |
|
|
|
|
<el-button type="primary" @click="batchDel" round v-auth="'/match:管理:报名人员:导出'">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table ref="table" |
|
|
|
|
:data="listData" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
row-key="id" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@sort-change="sortChange"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="80" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table ref="table" :data="listData" class="table" stripe header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" row-key="id" v-loading="loading" @sort-change="sortChange"> |
|
|
|
|
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="school" |
|
|
|
|
label="学生账号归属" |
|
|
|
|
sortable="custom" |
|
|
|
|
min-width="180" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="realSchool" |
|
|
|
|
label="学生所在院校" |
|
|
|
|
min-width="180" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
prop="teamName" |
|
|
|
|
label="团队名称" |
|
|
|
|
sortable="custom" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table-column prop="school" label="学生账号归属" sortable="custom" min-width="180" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="realSchool" label="学生所在院校" min-width="180" align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称" |
|
|
|
|
sortable="custom" min-width="140" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="username" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table-column prop="username" :label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'" |
|
|
|
|
min-width="140" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table-column prop="workNumber" :label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'" |
|
|
|
|
min-width="140" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="phone" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table-column prop="phone" :label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'" |
|
|
|
|
min-width="140" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
prop="captain" |
|
|
|
|
label="是否为队长" |
|
|
|
|
min-width="80" |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="captain" label="是否为队长" min-width="80" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="teachers" |
|
|
|
|
label="指导老师" |
|
|
|
|
min-width="200" |
|
|
|
|
align="center" |
|
|
|
|
show-overflow-tooltip> |
|
|
|
|
<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"> |
|
|
|
|
<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> |
|
|
|
|
<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="270"> |
|
|
|
|
<el-table-column label="操作" align="center" 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> |
|
|
|
|
<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" |
|
|
|
|
@click="toInfo(scope.row)">参赛信息与成绩</el-button> |
|
|
|
|
<el-switch v-auth="'/match:管理:报名人员:禁用'" |
|
|
|
|
v-model="scope.row.isDisable" |
|
|
|
|
:active-text="scope.row.isDisable ? '禁用' : '启用'" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button> |
|
|
|
|
<el-switch v-auth="'/match:管理:报名人员:禁用'" v-model="scope.row.isDisable" |
|
|
|
|
:active-text="scope.row.isDisable ? '禁用' : '启用'" :active-value="0" :inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 5px" @change="switchOff($event, scope.row, scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="total" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" |
|
|
|
|
:current-page="page"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" |
|
|
|
|
:visible.sync="addVisible" |
|
|
|
|
width="440px" |
|
|
|
|
class="dialog" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
@close="closeAdd"> |
|
|
|
|
<el-form ref="form" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
label-width="110px" |
|
|
|
|
style='margin-right: 10px;'> |
|
|
|
|
<el-form-item v-if="!schoolDisable" |
|
|
|
|
prop="schoolId" |
|
|
|
|
label="学生账号归属"> |
|
|
|
|
<el-select v-model="form.schoolId" |
|
|
|
|
filterable |
|
|
|
|
:disabled="!isAdd" |
|
|
|
|
@change="schoolChange" |
|
|
|
|
style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in clients" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.schoolName" |
|
|
|
|
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="440px" class="dialog" |
|
|
|
|
:close-on-click-modal="false" @close="closeAdd"> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style='margin-right: 10px;'> |
|
|
|
|
<el-form-item v-if="!schoolDisable" prop="schoolId" label="学生账号归属"> |
|
|
|
|
<el-select v-model="form.schoolId" filterable :disabled="!isAdd" @change="schoolChange" 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 prop="studentAffiliatedInstitutionId" |
|
|
|
|
label="学生所在院校"> |
|
|
|
|
<el-select v-model="form.studentAffiliatedInstitutionId" |
|
|
|
|
filterable |
|
|
|
|
style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in schools" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.schoolName" |
|
|
|
|
<el-form-item prop="studentAffiliatedInstitutionId" label="学生所在院校"> |
|
|
|
|
<el-select v-model="form.studentAffiliatedInstitutionId" filterable style="width: 100%"> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校</p> |
|
|
|
|
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所在院校为学生实际院校</p> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="workNumber" |
|
|
|
|
label="学生学号"> |
|
|
|
|
<el-input v-model="form.workNumber" |
|
|
|
|
placeholder="请输入学生学号" |
|
|
|
|
@change="workNumberChange"></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="userName" |
|
|
|
|
label="学生姓名"> |
|
|
|
|
<el-input v-model="form.userName" |
|
|
|
|
placeholder="请输入学生姓名" |
|
|
|
|
:disabled="isAdd"></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 v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
prop="teamId" |
|
|
|
|
label="所属团队"> |
|
|
|
|
<el-form-item v-if="info.completeCompetitionSetup.competitionType" prop="teamId" label="所属团队"> |
|
|
|
|
<div style="display: flex;align-items: center"> |
|
|
|
|
<el-select v-model="form.teamId" |
|
|
|
|
:disabled="formEnable && isAdd" |
|
|
|
|
filterable |
|
|
|
|
<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-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button v-if="isAdd && !formEnable" |
|
|
|
|
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 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 prop="email" label="邮箱"> |
|
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<p v-if="!isAdd" |
|
|
|
|
class="tips" |
|
|
|
|
style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<p v-if="!isAdd" class="tips" style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="addVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="submit">确定</el-button> |
|
|
|
|
<el-button type="primary" @click="submit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="创建团队" |
|
|
|
|
:visible.sync="teamVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
width="300px"> |
|
|
|
|
<el-dialog title="创建团队" :visible.sync="teamVisible" :close-on-click-modal="false" width="300px"> |
|
|
|
|
<el-form class="dia-form"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入团队名称" |
|
|
|
|
maxlength="10" |
|
|
|
|
v-model="teamForm.teamName"></el-input> |
|
|
|
|
<el-input placeholder="请输入团队名称" maxlength="10" v-model="teamForm.teamName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请设置团队邀请码" |
|
|
|
|
maxlength="6" |
|
|
|
|
v-model="teamForm.invitationCode"></el-input> |
|
|
|
|
<el-input placeholder="请设置团队邀请码" maxlength="6" v-model="teamForm.invitationCode"></el-input> |
|
|
|
|
</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" |
|
|
|
|
@click="teamVisible = false">取消</el-button> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button> |
|
|
|
|
<el-button size="small" @click="teamVisible = false">取消</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
width="24%" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
:modal-append-to-body="false" |
|
|
|
|
@close="cancelUpload"> |
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false" |
|
|
|
|
:modal-append-to-body="false" @close="cancelUpload"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<template v-if="!uploadFaild"> |
|
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-upload name="file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
ref="upload" |
|
|
|
|
class="import-file" |
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:on-success="uploadSuccess" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:limit="1" |
|
|
|
|
:data="{ |
|
|
|
|
<el-upload name="file" accept=".xls,.xlsx" ref="upload" class="import-file" :before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" |
|
|
|
|
:limit="1" :data="{ |
|
|
|
|
competitionId: id, |
|
|
|
|
platformId: 2 |
|
|
|
|
}" |
|
|
|
|
:disabled="uploading" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
}" :disabled="uploading" :on-exceed="handleExceed" |
|
|
|
|
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:loading="uploading" |
|
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip">建议文件数据在5000条以内,导入5000名学生大致需要10分钟</div> |
|
|
|
|
:file-list="uploadList" :headers="headers"> |
|
|
|
|
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i |
|
|
|
|
class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
<div slot="tip" class="el-upload__tip">建议文件数据在5000条以内,导入5000名学生大致需要10分钟</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
@ -323,9 +175,7 @@ |
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</p> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<span v-if="uploading" |
|
|
|
|
slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<span v-if="uploading" slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="cancelUpload">停止导入</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
@ -333,7 +183,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import Util from "@/libs/util"; |
|
|
|
|
import axios from 'axios' |
|
|
|
|
import Setting from "@/setting"; |
|
|
|
|
export default { |
|
|
|
@ -429,6 +279,10 @@ export default { |
|
|
|
|
isBackstage: 0, |
|
|
|
|
exporting: false, |
|
|
|
|
loading: false, |
|
|
|
|
timer: null, |
|
|
|
|
now: '', |
|
|
|
|
notBeginSign: true, |
|
|
|
|
allocated: true, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -443,6 +297,7 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
this.getInfo() |
|
|
|
|
this.getTeam() |
|
|
|
|
this.getAutomaticAllocation() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
init () { |
|
|
|
@ -473,8 +328,8 @@ export default { |
|
|
|
|
this.loading = false |
|
|
|
|
}, |
|
|
|
|
// 获取赛事信息 |
|
|
|
|
getInfo () { |
|
|
|
|
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
|
|
|
|
async getInfo () { |
|
|
|
|
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.id}`) |
|
|
|
|
this.info = competition |
|
|
|
|
this.getSchool() |
|
|
|
|
// 非本校内则查询接口获取学校列表 |
|
|
|
@ -484,7 +339,46 @@ export default { |
|
|
|
|
this.schoolDisable = true |
|
|
|
|
this.form.schoolId = competition.schoolId |
|
|
|
|
} |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
|
|
// 判断当前处于报名结束前还是后,报名结束前显示:自动分配/取消分配。报名结束后显示:自动分配。 |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
this.now = await Util.getNow() |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
|
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) |
|
|
|
|
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // 是否在报名结束时间之前 |
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
// 获取是否已分配 |
|
|
|
|
async getAutomaticAllocation () { |
|
|
|
|
const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`) |
|
|
|
|
this.allocated = res.data && res.data.assignOrNot |
|
|
|
|
}, |
|
|
|
|
// 自动分配人员 |
|
|
|
|
async automaticAllocation (assignOrNot) { |
|
|
|
|
await this.$post(this.api.updateEventAllocationRecord, { |
|
|
|
|
assignOrNot, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
}) |
|
|
|
|
this.getAutomaticAllocation() |
|
|
|
|
}, |
|
|
|
|
// 自动分配人员弹框 |
|
|
|
|
async autoAllocationConfirm () { |
|
|
|
|
// 报名结束后 |
|
|
|
|
if (this.notBeginSign) { |
|
|
|
|
this.$confirm('确定立即自动分配阶段成员?', '提示', { |
|
|
|
|
type: 'success', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
}).then(async () => { |
|
|
|
|
await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // 立马分配 |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.$confirm(`确定${this.allocated ? '取消' : '开启'}自动分配阶段成员?`, { |
|
|
|
|
type: 'success', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
}).then(async () => { |
|
|
|
|
this.automaticAllocation(this.allocated ? 0 : 1) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
@ -507,10 +401,6 @@ export default { |
|
|
|
|
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 自动分配 |
|
|
|
|
autoAllocation () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
|
batchImport () { |
|
|
|
@ -524,7 +414,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
util.warningMsg( |
|
|
|
|
Util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
) |
|
|
|
|
}, |
|
|
|
@ -535,7 +425,7 @@ export default { |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data])) |
|
|
|
|
Util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
uploadSuccess ({ data, status }) { |
|
|
|
@ -550,11 +440,11 @@ export default { |
|
|
|
|
this.uploadFaild = true |
|
|
|
|
this.uploadTips = tip |
|
|
|
|
} else { |
|
|
|
|
util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000) |
|
|
|
|
Util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000) |
|
|
|
|
this.importVisible = false |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg(res.message || '上传失败,请检查数据', 3000) |
|
|
|
|
Util.errorMsg(res.message || '上传失败,请检查数据', 3000) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
@ -609,7 +499,7 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => { |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
Util.successMsg("删除成功"); |
|
|
|
|
this.init() |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}).catch(() => { }); |
|
|
|
@ -670,7 +560,7 @@ export default { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
Util.successMsg('编辑成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
@ -678,7 +568,7 @@ export default { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('编辑成功!') |
|
|
|
|
Util.successMsg('编辑成功!') |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submiting = false |
|
|
|
@ -697,7 +587,7 @@ export default { |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.init() |
|
|
|
|
this.submiting = false |
|
|
|
|
util.successMsg('报名成功!') |
|
|
|
|
Util.successMsg('报名成功!') |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
@ -715,13 +605,13 @@ export default { |
|
|
|
|
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}` |
|
|
|
|
const { phone, email } = form |
|
|
|
|
if (phone && !/^1[3456789]\d{9}$/.test(phone)) { |
|
|
|
|
return util.errorMsg("请输入正确的手机号") |
|
|
|
|
return Util.errorMsg("请输入正确的手机号") |
|
|
|
|
} else if (email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) { |
|
|
|
|
return util.errorMsg("请输入正确的邮箱") |
|
|
|
|
return Util.errorMsg("请输入正确的邮箱") |
|
|
|
|
} else if (this.notExit) { |
|
|
|
|
return util.errorMsg('学生不存在,无法添加!') |
|
|
|
|
return Util.errorMsg('学生不存在,无法添加!') |
|
|
|
|
} else if (this.exitMember) { |
|
|
|
|
return util.errorMsg('学生已存在') |
|
|
|
|
return Util.errorMsg('学生已存在') |
|
|
|
|
} else { |
|
|
|
|
this.submiting = true |
|
|
|
|
this.submitForm() |
|
|
|
@ -799,8 +689,8 @@ export default { |
|
|
|
|
// 团队提交 |
|
|
|
|
teamSubmit () { |
|
|
|
|
const form = this.teamForm |
|
|
|
|
if (!form.teamName) return util.errorMsg('请输入团队名称') |
|
|
|
|
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码') |
|
|
|
|
if (!form.teamName) return Util.errorMsg('请输入团队名称') |
|
|
|
|
if (form.invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码') |
|
|
|
|
form.accountId = this.form.id |
|
|
|
|
form.schoolId = this.form.schoolId |
|
|
|
|
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId |
|
|
|
@ -808,7 +698,7 @@ export default { |
|
|
|
|
this.teamVisible = false |
|
|
|
|
this.addVisible = false |
|
|
|
|
this.init() |
|
|
|
|
util.successMsg('报名成功!') |
|
|
|
|
Util.successMsg('报名成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 参赛信息 |
|
|
|
@ -829,7 +719,7 @@ export default { |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
this.exporting = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.exporting = false |
|
|
|
@ -842,7 +732,7 @@ export default { |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
this.exporting = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.exporting = false |
|
|
|
@ -877,16 +767,19 @@ export default { |
|
|
|
|
.w-100 { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tips { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tips { |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: #e90000; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.import-file { |
|
|
|
|
.el-progress__text, |
|
|
|
|
.el-progress, |
|
|
|
|