赛事分配等

dev_review
yujialong 6 months ago
parent 5fdb75fec9
commit 64d15ceab0
  1. 2
      src/utils/api.js
  2. 10
      src/views/customer/AddCustomer.vue
  3. 13
      src/views/match/add/index.vue
  4. 49
      src/views/match/add/step2.vue
  5. 33
      src/views/match/add/step3.vue
  6. 751
      src/views/match/manage/abnormalTeam.vue
  7. 17
      src/views/match/manage/index.vue
  8. 8
      src/views/match/manage/matchInfo.vue
  9. 261
      src/views/system/staff.vue

@ -329,6 +329,8 @@ export default {
getRedisCacheCompetition: `competition/competition/management/getRedisCache`,
copyCompetition: `competition/competition/management/copyCompetition`,
checkCustomerBySchool: `competition/competition/team/checkCustomerBySchool`,
automaticAllocationSave: `competition/competitionAutomaticAllocationRecord/updateEventAllocationRecord`,
editWhetherPopUpsAppear: `competition/competitionAutomaticAllocationRecord/editWhetherPopUpsAppear`,
// 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`,

@ -97,11 +97,11 @@
<el-form-item prop="account"
label="账号">
<el-input placeholder="请输入账号"
v-model="form.account"></el-input>
v-model.trim="form.account"></el-input>
</el-form-item>
<el-form-item label="职务">
<el-input placeholder="请输入职务名称"
v-model="form.position"
v-model.trim="form.position"
maxlength="11"></el-input>
</el-form-item>
<el-form-item label="产品到期时间">
@ -152,18 +152,18 @@
<el-form-item prop="name"
label="联系人姓名">
<el-input placeholder="请输入联系人姓名"
v-model="form.name"></el-input>
v-model.trim="form.name"></el-input>
</el-form-item>
<el-form-item prop="phone"
label="手机号">
<el-input placeholder="请输入联系人手机号"
v-model="form.phone"
v-model.trim="form.phone"
maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email"
label="邮箱">
<el-input placeholder="请输入邮箱"
v-model="form.email"></el-input>
v-model.trim="form.email"></el-input>
</el-form-item>
</el-col>
</el-form>

@ -179,7 +179,14 @@ export default {
//
next (next, setupId, competitionId) {
if (!next) {
if (this.step === 3 && this.$refs['step' + this.step].form[0].contentId) {
// &&
this.editing = 0
this.step = 1
} else {
//
this.$router.push(`/match`)
}
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) {
@ -190,6 +197,12 @@ export default {
this.step++
} else if (next === 1) {
this.step--
} else {
if (typeof setupId === 'function') {
setupId()
} else if (typeof type === 'function') {
type()
}
}
},
//

@ -306,6 +306,7 @@ export default {
{ required: true, trigger: 'change' }
],
},
originForm: null,
ruleForm: {},
rules: Const.rules,
methods: Const.methods,
@ -348,6 +349,7 @@ export default {
if (!e.percentageLimit) e.percentageLimit = ''
e.teamCalculationMethod = +e.teamCalculationMethod
})
this.originForm = _.cloneDeep(rule)
this.form = rule
}
this.$nextTick(() => {
@ -379,6 +381,51 @@ export default {
this.form.competitionStageList = stages.slice(0, val)
}
},
//
async automaticAllocation (next) {
//
if (this.step1.completeCompetitionSetup.competitionType) {
const { form, originForm } = this
// 34
let changeLimit = 0
for (const i in form.competitionStageList) {
const e = form.competitionStageList[i]
if (e.teamNumLimit !== originForm.competitionStageList[i].teamNumLimit || e.customNumber !== originForm.competitionStageList[i].customNumber) {
changeLimit = 1
break
}
}
if (form.rule !== originForm.rule || form.stageNum !== originForm.stageNum || form.teamLimit !== originForm.teamLimit || changeLimit) {
const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.id}`)
if (res.popupState) {
this.$confirm('报名的团队将按照新设置的规则进行自动分配阶段参赛人员,当前已分配的阶段参赛人员是否需要保留?', '提示', {
cancelButtonText: '已分配的保留',
confirmButtonText: '全部重新分配',
type: 'success',
closeOnClickModal: false,
}).then(() => {
// this.automaticAllocation(1, next)
}).catch(() => {
// this.automaticAllocation(0, next)
});
// await this.$post(this.api.automaticAllocationSave, {
// assignOrNot,
// competitionId: this.competitionId,
// whetherToModifyTheRule: whethwer,
// })
this.$emit('next', next)
} else {
this.$emit('next', next)
}
} else {
this.$emit('next', next)
}
} else {
this.$emit('next', next)
}
},
//
save (status, next = 0) {
const form = _.cloneDeep(this.form)
@ -477,7 +524,7 @@ export default {
this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功");
this.$emit('next', next)
this.automaticAllocation(next)
}).catch(err => {
this.$parent.hideLoad()
})

@ -360,18 +360,30 @@ export default {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
},
//
autoAllocation () {
this.$confirm('团队赛已发布,是否要自动分配阶段人员?', '提示', {
// confirmButtonText: '',
// cancelButtonText: '',
type: 'success'
async automaticAllocation (assignOrNot, next) {
await this.$post(this.api.automaticAllocationSave, {
assignOrNot,
competitionId: this.competitionId,
})
this.$emit('next', next)
},
//
async autoAllocationConfirm (next) {
//
this.$confirm('<p>团队赛已发布,是否要自动分配阶段人员?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会给报名的团队自动分配阶段参赛人员</p>', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'success',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(() => {
}).catch(() => { });
this.automaticAllocation(1, next)
}).catch(() => {
this.automaticAllocation(0, next)
});
},
//
save (status, next = 0) {
// return console.log(this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType)
const { form } = this
if (!form.length) {
this.$parent.hideLoad()
@ -464,9 +476,12 @@ export default {
this.$parent.hideLoad()
//
status && this.publish(status)
// this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && this.autoAllocation() //
util.successMsg((status ? '发布' : '保存') + '成功')
if (this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && !form[0].contentId) {
this.autoAllocationConfirm() //
} else {
this.$emit('next', next)
}
}).catch(err => {
this.$parent.hideLoad()
})

@ -0,0 +1,751 @@
<template>
<!-- 报名人员 -->
<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>
</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>
</li>
</ul>
<div>
<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>
</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">
<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>
<el-table-column prop="username"
label="队长/成员"
min-width="140"
align="center">
</el-table-column>
<el-table-column prop="workNumber"
label="队长/成员学号"
min-width="140"
align="center">
</el-table-column>
<el-table-column prop="phone"
label="队长/成员手机号"
min-width="140"
align="center">
</el-table-column>
<el-table-column prop="captain"
label="是否为队长"
min-width="90"
align="center"></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 prop="captain"
label="团队状态"
min-width="80"
align="center"></el-table-column>
<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>
<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>
</template>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<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"
: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"
:value="item.schoolId"></el-option>
</el-select>
<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>
<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="所属团队">
<div style="display: flex;align-items: center">
<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 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>
<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>
</span>
</el-dialog>
<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-form-item>
<el-form-item>
<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>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import axios from 'axios'
import Setting from "@/setting";
export default {
data () {
return {
token: sessionStorage.getItem('token'),
id: +this.$route.query.id,
info: {
completeCompetitionSetup: {}
},
isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '',
statusList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '已禁用'
},
{
id: 0,
name: '未禁用'
}
],
keyword: this.$route.query.keyword || '',
listData: [],
multipleSelection: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
schoolOrder: '',
teamOrder: '',
clients: [],
schools: [],
addVisible: false,
formEnable: true,
isAdd: false,
form: {
captain: 0,
competitionId: this.$route.query.id,
userName: '',
workNumber: '',
schoolId: '',
studentAffiliatedInstitutionId: '',
teamId: '',
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
},
rules: {
schoolId: [
{ required: true, message: "请选择所属院校", trigger: "change" }
],
workNumber: [
{ required: true, message: "请输入学号", trigger: "blur" }
],
teamId: [
{ required: true, message: "请选择所属团队", trigger: "change" }
]
},
submiting: false,
teamVisible: false,
teams: [],
teamNameRepeat: false,
teamForm: {
competitionId: this.$route.query.id,
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 1,
identification: 1
},
originForm: {},
exitMember: 0,
notExit: 0,
schoolDisable: false,
importVisible: false,
uploadList: [],
uploadFaild: false,
uploadTips: '',
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
},
uploading: false,
isBackstage: 0,
exporting: false,
loading: false,
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
this.getInfo()
this.getTeam()
},
methods: {
init () {
this.initData()
this.getTeam()
this.getClient()
},
async getData () {
this.loading = true
const { data } = await this.$post(this.api.queryRegistrationByCondition, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
isDisable: this.isDisable,
schoolOrder: this.schoolOrder,
teamOrder: this.teamOrder,
})
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();
this.loading = false
},
//
getInfo () {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
this.getSchool()
//
if (competition.competitionScope) {
this.getClient()
} else {
this.schoolDisable = true
this.form.schoolId = competition.schoolId
}
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
handleCurrentChange (val) {
this.page = val;
this.getData();
},
switchOff (val, row, index) {
this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { });
},
//
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()
},
//
edit (row) {
this.notExit = 0
this.isAdd = false
this.addVisible = true
row.userName = row.username
this.exitMember = 0
row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row))
},
del (row) {
this.$confirm(!this.info.completeCompetitionSetup.competitionType || row.captain === '否' ? '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?' : '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?', "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
this.init()
}).catch(res => { });
}).catch(() => { });
},
//
schoolChange () {
if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId
},
//
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
}).catch(res => {
if (res.message === '学生不存在') this.notExit = 1
if (!this.isAdd) this.exitMember = 1
})
} else {
this.exitMember = 0
}
},
//
submitForm () {
const { form } = this
if (!this.isAdd) { //
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
id: form.id,
lastTimeInstitutionId: this.originForm.studentAffiliatedInstitutionId
},
hrUserInfo: {
userId: form.userId,
schoolId: form.schoolId,
email: form.email,
userName: form.userName
}
}).then(res => {
//
if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
teamId: form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
}).catch(res => {
this.submiting = false
})
} else {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
}
}).catch(res => {
this.submiting = false
})
} else {
//
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
teamId: this.form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('报名成功!')
}).catch(res => {
this.submiting = false
})
}
},
//
submit () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
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, email } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
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("请输入正确的邮箱")
} else if (this.notExit) {
return util.errorMsg('学生不存在,无法添加!')
} else if (this.exitMember) {
return util.errorMsg('学生已存在')
} else {
this.submiting = true
this.submitForm()
}
}
})
},
//
closeAdd () {
this.form = {
captain: 0,
competitionId: this.id,
userName: '',
workNumber: '',
schoolId: '',
teamId: '',
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
}
},
//
createTeam () {
this.teamForm = {
competitionId: this.id,
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 1,
identification: 1
}
this.teamVisible = true
},
//
async getSchool () {
const { list } = await this.$get(this.api.querySchoolData)
this.schools = list
},
//
async getClient () {
if (this.info.competitionScope === 2) {
//
this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => {
this.clients = schools
}).catch(res => { })
} else {
//
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.$post(this.api.queryCustomer, {
customerType: '',
page: 1,
size: 10000,
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
const { list } = res.message
list.map(e => {
e.schoolName = e.customerName
})
this.clients = list
}).catch(res => { })
}
},
//
getTeam () {
this.$get(this.api.searchTeam, {
teamName: '',
competitionId: this.id
}).then(({ teamList }) => {
this.teams = teamList
}).catch(res => { })
},
//
teamSubmit () {
const form = this.teamForm
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
this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false
this.addVisible = false
this.init()
util.successMsg('报名成功!')
}).catch(res => { })
},
//
toInfo (row) {
this.$store.commit('setInnerReferrer', `${this.$route.path}?id=${this.id}&tab=tab5&name=${this.$route.query.name}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`)
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
},
exportAll () {
if (this.listData.length) {
this.exporting = true
const data = this.multipleSelection
if (data.length) {
data.map((e, i) => e.id = i + 1)
axios.post(this.api.exportDataInBatches, data, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
})
} else {
axios.get(`${this.api.excelExport}?competitionId=${this.id}`, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
})
}
}
},
//
async batchDel () {
const list = this.multipleSelection
const tips = list.length ? (this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?' : '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?') : '删除后参赛人员已有的成绩会一并删除,成绩排名将会受影响,<span style="font-size: 15px;color: #f00">是否确定删除全部报名人员?</span>'
this.$confirm(tips, "提示", {
type: "warning",
dangerouslyUseHTMLString: true
}).then(async () => {
if (list.length) {
await this.$post(this.api.batchDeleteApplicants, { registrationVOS: list })
} else {
await this.$post(`${this.api.deleteAllData}?competitionId=${this.id}`)
}
this.init()
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(() => { });
},
}
};
</script>
<style lang="scss" scoped>
/deep/.dia-form {
.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,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -21,8 +21,9 @@
ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
<Notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" />
<AbnormalTeam v-else-if="active == 'tab6'" />
</div>
</div>
@ -33,8 +34,9 @@ import Setting from "@/setting";
import MatchDetail from "../add";
import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup";
import Notice from "./notice";
import MatchSignup from './matchSignup'
import AbnormalTeam from './abnormalTeam'
export default {
name: "matchManage",
data () {
@ -46,7 +48,8 @@ export default {
tab2: "大赛成绩管理",
tab3: "竞赛进展",
tab4: "公告通知",
tab5: "报名人员"
tab5: "报名人员",
tab6: '查看异常团队'
}
};
},
@ -54,8 +57,9 @@ export default {
MatchDetail,
MatchArch,
MatchProgress,
notice,
MatchSignup
Notice,
MatchSignup,
AbnormalTeam
},
mounted () {
Setting.dynamicRoute && this.initTabs()
@ -76,6 +80,7 @@ export default {
tab3 || this.$delete(this.tabs, 'tab3')
tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5')
res.competition.completeCompetitionSetup.competitionType || this.$delete(this.tabs, 'tab6')
const type = this.$route.query.tab
const keys = Object.keys(this.tabs)

@ -124,7 +124,7 @@
<td>{{ i + 1 }}</td>
<td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.teamNumLimit || '不限制' }}</td>
<td>{{ item.customNumber || '不限制' }}</td>
<td>
<template v-if="item.participants">
<el-tag v-for="tag in item.participants"
@ -233,8 +233,8 @@
:key="i"
:label="item.accountId">{{ item.userName }}</el-checkbox>
</el-checkbox-group>
<p v-if="info.teamLimit && curRow.teamNumLimit"
style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.teamNumLimit }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<p v-if="info.teamLimit && curRow.customNumber"
style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.customNumber }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@ -599,7 +599,7 @@ export default {
const accountIds = this.checkedMembers
if (!accountIds.length) return Util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit //
if (limit && accountIds.length > limit) return Util.errorMsg(`请选择${limit}个以下参赛成员!`) //
if (limit && accountIds.length > limit) return Util.errorMsg(`请选择${this.curRow.customNumber}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, {
accountIds,
competitionId: this.id,

@ -4,7 +4,8 @@
<div class="side">
<div class="m-b-20">
<h6 class="p-title">后台员工账号</h6>
<el-radio-group v-model="studentType" @change="changeType">
<el-radio-group v-model="studentType"
@change="changeType">
<div class="m-b-20">
<el-radio :label="1">所有员工</el-radio>
</div>
@ -16,38 +17,37 @@
<el-divider></el-divider>
<div>
<div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">组织架构</h6>
<el-button type="text" @click="addOrg" v-auth="'/system:后台账号:新增部门'">添加</el-button>
<h6 class="p-title"
style="margin-bottom: 0">组织架构</h6>
<el-button type="text"
@click="addOrg"
v-auth="'/system:后台账号:新增部门'">添加</el-button>
</div>
<div style="overflow: auto">
<el-tree
:data="orgList"
<el-tree :data="orgList"
default-expand-all
ref="orgTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span>
<span>
<el-button
v-auth="'/system:后台账号:新增部门'"
<el-button v-auth="'/system:后台账号:新增部门'"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)">
</el-button>
<el-button
v-auth="'/system:后台账号:编辑部门'"
<el-button v-auth="'/system:后台账号:编辑部门'"
type="text"
icon="el-icon-edit-outline"
@click="() => editOrg(node, data)">
</el-button>
<el-button
v-auth="'/system:后台账号:删除部门'"
<el-button v-auth="'/system:后台账号:删除部门'"
type="text"
icon="el-icon-delete"
@click="() => delOrg(node, data)">
@ -58,32 +58,36 @@
</div>
</div>
<el-dialog
:title="orgForm.id ? '编辑' : '新增' + '部门'"
<el-dialog :title="orgForm.id ? '编辑' : '新增' + '部门'"
:visible.sync="orgVisible"
:close-on-click-modal="false"
width="50%"
>
<el-form v-if="orgVisible" ref="orgForm" :model="orgForm" :rules="orgRules" label-width="100px">
<el-form-item label="部门名称" prop="organizationName">
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input>
width="50%">
<el-form v-if="orgVisible"
ref="orgForm"
:model="orgForm"
:rules="orgRules"
label-width="100px">
<el-form-item label="部门名称"
prop="organizationName">
<el-input v-model.trim="orgForm.organizationName"
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="上级部门">
<span v-if="orgForm.parentName">{{ orgForm.parentName }}</span>
<el-cascader
v-else
<el-cascader v-else
:options="orgListDia"
v-model="cascaderValue"
:props="cascaderProps"
clearable
style="width: 100%"
>
style="width: 100%">
</el-cascader>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="closeOrg"> </el-button>
<el-button type="primary" @click="orgSubmit"> </el-button>
<el-button type="primary"
@click="orgSubmit"> </el-button>
</span>
</el-dialog>
</div>
@ -93,54 +97,126 @@
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
<el-input style="width: 250px;"
placeholder="请输入员工姓名/手机号"
prefix-icon="el-icon-search"
v-model="keyWord"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" @click="addStaff" v-auth="'/system:后台账号:新增员工'">新增员工</el-button>
<el-button type="primary" @click="batchImport" v-auth="'/system:后台账号:批量导入'">批量导入</el-button>
<el-button type="primary"
@click="addStaff"
v-auth="'/system:后台账号:新增员工'">新增员工</el-button>
<el-button type="primary"
@click="batchImport"
v-auth="'/system:后台账号:批量导入'">批量导入</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="accountId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="员工姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column>
<el-table-column prop="staffArchitectureName" label="所在部门" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="授权角色" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="lastLoginTime" label="最后登录时间" align="center" width="130"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="accountId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column prop="userName"
label="员工姓名"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="account"
label="账号"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="phone"
label="手机号"
align="center"
width="120"></el-table-column>
<el-table-column prop="staffArchitectureName"
label="所在部门"
align="center"
min-width="200"
show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName"
label="授权角色"
align="center"
min-width="200"
show-overflow-tooltip></el-table-column>
<el-table-column prop="lastLoginTime"
label="最后登录时间"
align="center"
width="130"></el-table-column>
<el-table-column label="操作"
align="center"
width="300">
<template slot-scope="scope">
<el-button type="text" v-auth="'/system:后台账号:查看'" @click="queryStaff(scope.row,true)">查看</el-button>
<el-button type="text" v-auth="'/system:后台账号:编辑'" @click="queryStaff(scope.row,false)">编辑</el-button>
<el-button type="text" v-auth="'/system:后台账号:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" v-auth="'/system:后台账号:删除'" @click="delStaff(scope.row)">删除</el-button>
<el-button type="text"
v-auth="'/system:后台账号:查看'"
@click="queryStaff(scope.row,true)">查看</el-button>
<el-button type="text"
v-auth="'/system:后台账号:编辑'"
@click="queryStaff(scope.row,false)">编辑</el-button>
<el-button type="text"
v-auth="'/system:后台账号:重置密码'"
@click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text"
v-auth="'/system:后台账号:删除'"
@click="delStaff(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'" :visible.sync="staffVisible" width="580px" class="dialog" :close-on-click-modal="false" @close="closeStaff">
<el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'>
<el-form-item prop="workNumber" label="工号">
<el-input v-model.trim="form.workNumber" placeholder="请输入工号"></el-input>
<el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'"
:visible.sync="staffVisible"
width="580px"
class="dialog"
:close-on-click-modal="false"
@close="closeStaff">
<el-form ref="form"
:model="form"
:rules="rules"
label-width="150px"
:disabled="isDetail"
style='margin-right: 80px;'>
<el-form-item prop="workNumber"
label="工号">
<el-input v-model.trim="form.workNumber"
placeholder="请输入工号"></el-input>
</el-form-item>
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
<el-form-item prop="userName"
label="姓名">
<el-input v-model.trim="form.userName"
placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="account" label="账号">
<el-input v-model.trim="form.account" placeholder="请输入账号"></el-input>
<el-form-item prop="account"
label="账号">
<el-input v-model.trim="form.account"
placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="roleList" label="授权角色">
<el-select class="w-100" v-model="form.roleList" multiple>
<el-form-item prop="roleList"
label="授权角色">
<el-select class="w-100"
v-model="form.roleList"
multiple>
<template v-for="item in roleList">
<!-- 不显示超管 -->
<el-option
v-if="item.roleName !== '超级管理员'"
<el-option v-if="item.roleName !== '超级管理员'"
:key="item.id"
:label="item.roleName"
:value="item.id">
@ -149,33 +225,42 @@
</el-select>
</el-form-item>
<el-form-item label="所在部门">
<el-cascader
class="w-100"
<el-cascader class="w-100"
v-model="form.staffArchitectureId"
:options="orgList"
:props="casProps"
></el-cascader>
:props="casProps"></el-cascader>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
<el-form-item prop="phone"
label="手机号">
<el-input v-model.trim="form.phone"
placeholder="请输入手机号"
maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
<el-form-item prop="email"
label="邮箱">
<el-input v-model.trim="form.email"
placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<span slot="footer"
class="dialog-footer"
v-if="!isDetail">
<el-button @click="staffVisible = false">取消</el-button>
<el-button type="primary" @click="submitStaff">确定</el-button>
<el-button type="primary"
@click="submitStaff">确定</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false">
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
<div style="text-align: center">
<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
ref="importStaff"
<el-upload ref="importStaff"
name="file"
accept=".xls,.xlsx"
:on-remove="handleRemove"
@ -186,15 +271,21 @@
:on-exceed="handleExceed"
:action="this.api.importStaff"
:file-list="uploadList"
:headers="headers"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
:headers="headers">
<el-button type="primary"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
<el-link v-if="uploadFaild"
type="primary"
@click="showFaild">部分数据导入失败查看失败原因</el-link>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="importVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
@ -221,6 +312,18 @@ export default {
}
}
}
const userNamePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入姓名'))
} else {
const pattern = /^\S+$/
if (pattern.test(value)) {
callback()
} else {
callback(new Error('请输入正确姓名格式'))
}
}
}
const workNumberPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入工号'))
@ -302,7 +405,7 @@ export default {
{ required: true, validator: accountPass, trigger: 'blur' }
],
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
{ required: true, validator: userNamePass, trigger: "blur" }
],
workNumber: [
{ required: true, validator: workNumberPass, trigger: 'blur' }

Loading…
Cancel
Save