赛事分配等

dev_review
yujialong 7 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. 379
      src/views/system/staff.vue

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

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

@ -179,7 +179,14 @@ export default {
// //
next (next, setupId, competitionId) { next (next, setupId, competitionId) {
if (!next) { 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`) this.$router.push(`/match`)
}
} else if (next === 2) { } else if (next === 2) {
if (setupId) this.setupId = setupId if (setupId) this.setupId = setupId
if (competitionId) { if (competitionId) {
@ -190,6 +197,12 @@ export default {
this.step++ this.step++
} else if (next === 1) { } else if (next === 1) {
this.step-- this.step--
} else {
if (typeof setupId === 'function') {
setupId()
} else if (typeof type === 'function') {
type()
}
} }
}, },
// //

@ -306,6 +306,7 @@ export default {
{ required: true, trigger: 'change' } { required: true, trigger: 'change' }
], ],
}, },
originForm: null,
ruleForm: {}, ruleForm: {},
rules: Const.rules, rules: Const.rules,
methods: Const.methods, methods: Const.methods,
@ -348,6 +349,7 @@ export default {
if (!e.percentageLimit) e.percentageLimit = '' if (!e.percentageLimit) e.percentageLimit = ''
e.teamCalculationMethod = +e.teamCalculationMethod e.teamCalculationMethod = +e.teamCalculationMethod
}) })
this.originForm = _.cloneDeep(rule)
this.form = rule this.form = rule
} }
this.$nextTick(() => { this.$nextTick(() => {
@ -379,6 +381,51 @@ export default {
this.form.competitionStageList = stages.slice(0, val) 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) { save (status, next = 0) {
const form = _.cloneDeep(this.form) const form = _.cloneDeep(this.form)
@ -477,7 +524,7 @@ export default {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功"); this.updateTime && util.successMsg("修改成功");
this.$emit('next', next) this.automaticAllocation(next)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() 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 => { }) this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
}, },
// //
autoAllocation () { async automaticAllocation (assignOrNot, next) {
this.$confirm('团队赛已发布,是否要自动分配阶段人员?', '提示', { await this.$post(this.api.automaticAllocationSave, {
// confirmButtonText: '', assignOrNot,
// cancelButtonText: '', competitionId: this.competitionId,
type: 'success' })
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(() => { }).then(() => {
this.automaticAllocation(1, next)
}).catch(() => { }); }).catch(() => {
this.automaticAllocation(0, next)
});
}, },
// //
save (status, next = 0) { save (status, next = 0) {
// return console.log(this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType)
const { form } = this const { form } = this
if (!form.length) { if (!form.length) {
this.$parent.hideLoad() this.$parent.hideLoad()
@ -464,9 +476,12 @@ export default {
this.$parent.hideLoad() this.$parent.hideLoad()
// //
status && this.publish(status) status && this.publish(status)
// this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && this.autoAllocation() //
util.successMsg((status ? '发布' : '保存') + '成功') util.successMsg((status ? '发布' : '保存') + '成功')
if (this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && !form[0].contentId) {
this.autoAllocationConfirm() //
} else {
this.$emit('next', next) this.$emit('next', next)
}
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() 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" /> ref="detail" />
<MatchArch v-if="active == 'tab2'" /> <MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" /> <MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" /> <Notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" /> <MatchSignup v-else-if="active == 'tab5'" />
<AbnormalTeam v-else-if="active == 'tab6'" />
</div> </div>
</div> </div>
@ -33,8 +34,9 @@ import Setting from "@/setting";
import MatchDetail from "../add"; import MatchDetail from "../add";
import MatchArch from "./matchArch"; import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress"; import MatchProgress from "./matchProgress";
import notice from "./notice"; import Notice from "./notice";
import MatchSignup from "./matchSignup"; import MatchSignup from './matchSignup'
import AbnormalTeam from './abnormalTeam'
export default { export default {
name: "matchManage", name: "matchManage",
data () { data () {
@ -46,7 +48,8 @@ export default {
tab2: "大赛成绩管理", tab2: "大赛成绩管理",
tab3: "竞赛进展", tab3: "竞赛进展",
tab4: "公告通知", tab4: "公告通知",
tab5: "报名人员" tab5: "报名人员",
tab6: '查看异常团队'
} }
}; };
}, },
@ -54,8 +57,9 @@ export default {
MatchDetail, MatchDetail,
MatchArch, MatchArch,
MatchProgress, MatchProgress,
notice, Notice,
MatchSignup MatchSignup,
AbnormalTeam
}, },
mounted () { mounted () {
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs()
@ -76,6 +80,7 @@ export default {
tab3 || this.$delete(this.tabs, 'tab3') tab3 || this.$delete(this.tabs, 'tab3')
tab4 || this.$delete(this.tabs, 'tab4') tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5') tab5 || this.$delete(this.tabs, 'tab5')
res.competition.completeCompetitionSetup.competitionType || this.$delete(this.tabs, 'tab6')
const type = this.$route.query.tab const type = this.$route.query.tab
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)

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

@ -4,7 +4,8 @@
<div class="side"> <div class="side">
<div class="m-b-20"> <div class="m-b-20">
<h6 class="p-title">后台员工账号</h6> <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"> <div class="m-b-20">
<el-radio :label="1">所有员工</el-radio> <el-radio :label="1">所有员工</el-radio>
</div> </div>
@ -16,38 +17,37 @@
<el-divider></el-divider> <el-divider></el-divider>
<div> <div>
<div class="flex-between"> <div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">组织架构</h6> <h6 class="p-title"
<el-button type="text" @click="addOrg" v-auth="'/system:后台账号:新增部门'">添加</el-button> style="margin-bottom: 0">组织架构</h6>
<el-button type="text"
@click="addOrg"
v-auth="'/system:后台账号:新增部门'">添加</el-button>
</div> </div>
<div style="overflow: auto"> <div style="overflow: auto">
<el-tree <el-tree :data="orgList"
:data="orgList"
default-expand-all default-expand-all
ref="orgTree" ref="orgTree"
node-key="id" node-key="id"
highlight-current highlight-current
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="handleNodeClick" @node-click="handleNodeClick"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}" :props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}">
> <span class="custom-tree-node"
<span class="custom-tree-node" slot-scope="{ node, data }"> slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span> <span class="org-name">{{ node.label }}</span>
<span> <span>
<el-button <el-button v-auth="'/system:后台账号:新增部门'"
v-auth="'/system:后台账号:新增部门'"
type="text" type="text"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)"> @click="() => addOrg(node, data)">
</el-button> </el-button>
<el-button <el-button v-auth="'/system:后台账号:编辑部门'"
v-auth="'/system:后台账号:编辑部门'"
type="text" type="text"
icon="el-icon-edit-outline" icon="el-icon-edit-outline"
@click="() => editOrg(node, data)"> @click="() => editOrg(node, data)">
</el-button> </el-button>
<el-button <el-button v-auth="'/system:后台账号:删除部门'"
v-auth="'/system:后台账号:删除部门'"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="() => delOrg(node, data)"> @click="() => delOrg(node, data)">
@ -58,32 +58,36 @@
</div> </div>
</div> </div>
<el-dialog <el-dialog :title="orgForm.id ? '编辑' : '新增' + '部门'"
:title="orgForm.id ? '编辑' : '新增' + '部门'"
:visible.sync="orgVisible" :visible.sync="orgVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="50%" width="50%">
> <el-form v-if="orgVisible"
<el-form v-if="orgVisible" ref="orgForm" :model="orgForm" :rules="orgRules" label-width="100px"> ref="orgForm"
<el-form-item label="部门名称" prop="organizationName"> :model="orgForm"
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input> :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>
<el-form-item label="上级部门"> <el-form-item label="上级部门">
<span v-if="orgForm.parentName">{{ orgForm.parentName }}</span> <span v-if="orgForm.parentName">{{ orgForm.parentName }}</span>
<el-cascader <el-cascader v-else
v-else
:options="orgListDia" :options="orgListDia"
v-model="cascaderValue" v-model="cascaderValue"
:props="cascaderProps" :props="cascaderProps"
clearable clearable
style="width: 100%" style="width: 100%">
>
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="closeOrg"> </el-button> <el-button @click="closeOrg"> </el-button>
<el-button type="primary" @click="orgSubmit"> </el-button> <el-button type="primary"
@click="orgSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -93,54 +97,126 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <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> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" @click="addStaff" v-auth="'/system:后台账号:新增员工'">新增员工</el-button> <el-button type="primary"
<el-button type="primary" @click="batchImport" v-auth="'/system:后台账号:批量导入'">批量导入</el-button> @click="addStaff"
v-auth="'/system:后台账号:新增员工'">新增员工</el-button>
<el-button type="primary"
@click="batchImport"
v-auth="'/system:后台账号:批量导入'">批量导入</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="accountId"> <el-table :data="listData"
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> ref="table"
<el-table-column prop="userName" label="员工姓名" align="center" min-width="100"></el-table-column> stripe
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column> header-align="center"
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column> @selection-change="handleSelectionChange"
<el-table-column prop="staffArchitectureName" label="所在部门" align="center" min-width="200" show-overflow-tooltip></el-table-column> row-key="accountId">
<el-table-column prop="roleName" label="授权角色" align="center" min-width="200" show-overflow-tooltip></el-table-column> <el-table-column type="selection"
<el-table-column prop="lastLoginTime" label="最后登录时间" align="center" width="130"></el-table-column> width="55"
<el-table-column label="操作" align="center" width="300"> 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"> <template slot-scope="scope">
<el-button type="text" v-auth="'/system:后台账号:查看'" @click="queryStaff(scope.row,true)">查看</el-button> <el-button type="text"
<el-button type="text" v-auth="'/system:后台账号:编辑'" @click="queryStaff(scope.row,false)">编辑</el-button> v-auth="'/system:后台账号:查看'"
<el-button type="text" v-auth="'/system:后台账号:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button> @click="queryStaff(scope.row,true)">查看</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,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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <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> </div>
<el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'" :visible.sync="staffVisible" width="580px" class="dialog" :close-on-click-modal="false" @close="closeStaff"> <el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'"
<el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'> :visible.sync="staffVisible"
<el-form-item prop="workNumber" label="工号"> width="580px"
<el-input v-model.trim="form.workNumber" placeholder="请输入工号"></el-input> 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>
<el-form-item prop="userName" label="姓名"> <el-form-item prop="userName"
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input> label="姓名">
<el-input v-model.trim="form.userName"
placeholder="请输入姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="account" label="账号"> <el-form-item prop="account"
<el-input v-model.trim="form.account" placeholder="请输入账号"></el-input> label="账号">
<el-input v-model.trim="form.account"
placeholder="请输入账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="roleList" label="授权角色"> <el-form-item prop="roleList"
<el-select class="w-100" v-model="form.roleList" multiple> label="授权角色">
<el-select class="w-100"
v-model="form.roleList"
multiple>
<template v-for="item in roleList"> <template v-for="item in roleList">
<!-- 不显示超管 --> <!-- 不显示超管 -->
<el-option <el-option v-if="item.roleName !== '超级管理员'"
v-if="item.roleName !== '超级管理员'"
:key="item.id" :key="item.id"
:label="item.roleName" :label="item.roleName"
:value="item.id"> :value="item.id">
@ -149,33 +225,42 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所在部门"> <el-form-item label="所在部门">
<el-cascader <el-cascader class="w-100"
class="w-100"
v-model="form.staffArchitectureId" v-model="form.staffArchitectureId"
:options="orgList" :options="orgList"
:props="casProps" :props="casProps"></el-cascader>
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="phone" label="手机号"> <el-form-item prop="phone"
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> label="手机号">
<el-input v-model.trim="form.phone"
placeholder="请输入手机号"
maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email"
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input> label="邮箱">
<el-input v-model.trim="form.email"
placeholder="请输入邮箱"></el-input>
</el-form-item> </el-form-item>
</el-form> </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 @click="staffVisible = false">取消</el-button>
<el-button type="primary" @click="submitStaff">确定</el-button> <el-button type="primary"
@click="submitStaff">确定</el-button>
</span> </span>
</el-dialog> </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="text-align: center">
<div style="margin-bottom: 10px;"> <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> </div>
<el-upload <el-upload ref="importStaff"
ref="importStaff"
name="file" name="file"
accept=".xls,.xlsx" accept=".xls,.xlsx"
:on-remove="handleRemove" :on-remove="handleRemove"
@ -186,15 +271,21 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="this.api.importStaff" :action="this.api.importStaff"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers">
> <el-button type="primary"
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </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> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer"
<el-button size="small" @click="importVisible = false"> </el-button> class="dialog-footer">
<el-button size="small" type="primary" @click="uploadSure"> </el-button> <el-button size="small"
@click="importVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -207,29 +298,41 @@ import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree"; import OrgTree from "@/components/org-tree/src/tree";
export default { export default {
components: { OrgTree }, components: { OrgTree },
data() { data () {
const accountPass = (rule, value, callback) => { const accountPass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('请输入账号')) callback(new Error('请输入账号'))
} else { } else {
const pattern = /^[A-Za-z0-9]*$/ const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){ if (pattern.test(value)) {
this.accountChange() this.accountChange()
callback() callback()
}else{ } else {
callback(new Error('请输入正确账号格式')) callback(new Error('请输入正确账号格式'))
} }
} }
} }
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) => { const workNumberPass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('请输入工号')) callback(new Error('请输入工号'))
} else { } else {
const pattern = /^[A-Za-z0-9]*$/ const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){ if (pattern.test(value)) {
this.worknumberChange() this.worknumberChange()
callback() callback()
}else{ } else {
callback(new Error('请输入正确工号格式')) callback(new Error('请输入正确工号格式'))
} }
} }
@ -237,10 +340,10 @@ export default {
const phonePass = (rule, value, callback) => { const phonePass = (rule, value, callback) => {
if (value) { if (value) {
const pattern = /^1[3456789]\d{9}$/ const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){ if (pattern.test(value)) {
// this.phoneChange() // this.phoneChange()
callback() callback()
}else{ } else {
callback(new Error('请输入正确手机号格式')) callback(new Error('请输入正确手机号格式'))
} }
} else { } else {
@ -250,10 +353,10 @@ export default {
const emailPass = (rule, value, callback) => { const emailPass = (rule, value, callback) => {
if (value) { if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/ const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){ if (pattern.test(value)) {
// this.emailChange() // this.emailChange()
callback() callback()
}else{ } else {
callback(new Error('请输入正确邮箱格式')) callback(new Error('请输入正确邮箱格式'))
} }
} else { } else {
@ -299,13 +402,13 @@ export default {
}, },
rules: { rules: {
account: [ account: [
{ required: true,validator: accountPass, trigger: 'blur' } { required: true, validator: accountPass, trigger: 'blur' }
], ],
userName: [ userName: [
{ required: true, message: "请输入姓名", trigger: "blur" } { required: true, validator: userNamePass, trigger: "blur" }
], ],
workNumber: [ workNumber: [
{ required: true,validator: workNumberPass, trigger: 'blur' } { required: true, validator: workNumberPass, trigger: 'blur' }
], ],
roleList: [ roleList: [
{ required: true, message: "请选择授权角色", trigger: "change" } { required: true, message: "请选择授权角色", trigger: "change" }
@ -345,23 +448,23 @@ export default {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
disableds:false, disableds: false,
submiting: false // submiting: false //
}; };
}, },
watch: { watch: {
keyWord: function(val) { keyWord: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.getStaff, 500); this.searchTimer = setTimeout(this.getStaff, 500);
} }
}, },
mounted() { mounted () {
this.getOrg() this.getOrg()
this.getRole() this.getRole()
}, },
methods: { methods: {
// //
async getOrg() { async getOrg () {
const res = await this.$post(this.api.treeListArch) const res = await this.$post(this.api.treeListArch)
const list = res.treeList const list = res.treeList
// children // children
@ -380,19 +483,19 @@ export default {
this.getStaff() this.getStaff()
}, },
// id // id
handleOrgId(list, ids) { handleOrgId (list, ids) {
list.forEach(e => { list.forEach(e => {
e.ids = ids ? [...ids, e.id] : [e.id] e.ids = ids ? [...ids, e.id] : [e.id]
e.children && this.handleOrgId(e.children, e.ids) e.children && this.handleOrgId(e.children, e.ids)
}) })
}, },
// //
changeType() { changeType () {
this.$refs.orgTree.setCurrentKey(null) this.$refs.orgTree.setCurrentKey(null)
this.initData() this.initData()
}, },
// //
addOrg(node, data) { addOrg (node, data) {
const list = JSON.parse(JSON.stringify(this.orgList)) const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list) this.handleOrg(list)
this.orgListDia = list this.orgListDia = list
@ -406,7 +509,7 @@ export default {
this.orgVisible = true this.orgVisible = true
}, },
// //
editOrg(node, data) { editOrg (node, data) {
const list = JSON.parse(JSON.stringify(this.orgList)) const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list, data.id, 0) this.handleOrg(list, data.id, 0)
this.orgListDia = list this.orgListDia = list
@ -420,7 +523,7 @@ export default {
this.cascaderValue = ids this.cascaderValue = ids
}, },
// //
handleOrg(list, id, disabled) { handleOrg (list, id, disabled) {
list.forEach(e => { list.forEach(e => {
// disabled // disabled
if (disabled) { if (disabled) {
@ -437,18 +540,18 @@ export default {
}) })
}, },
// //
delOrg(node, data) { delOrg (node, data) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteArch}?id=${data.id}`).then(res => { this.$post(`${this.api.deleteArch}?id=${data.id}`).then(res => {
util.successMsg("删除成功") util.successMsg("删除成功")
this.getOrg() this.getOrg()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
}, },
// / // /
orgSubmit() { orgSubmit () {
this.$refs.orgForm.validate((valid) => { this.$refs.orgForm.validate((valid) => {
if (valid) { if (valid) {
const form = this.orgForm const form = this.orgForm
@ -463,31 +566,31 @@ export default {
this.$post(this.api.saveArch, form).then(res => { this.$post(this.api.saveArch, form).then(res => {
util.successMsg("新增成功!") util.successMsg("新增成功!")
this.closeOrg() this.closeOrg()
}).catch(err => {}) }).catch(err => { })
} else { } else {
// //
this.$post(this.api.updateArch, form).then(res => { this.$post(this.api.updateArch, form).then(res => {
util.successMsg("编辑成功!") util.successMsg("编辑成功!")
this.closeOrg() this.closeOrg()
}).catch(err => {}) }).catch(err => { })
} }
} }
}); });
}, },
// //
handleNodeClick(data) { handleNodeClick (data) {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.studentType = null this.studentType = null
this.getStaff() this.getStaff()
}, },
// //
closeOrg() { closeOrg () {
this.orgVisible = false this.orgVisible = false
this.cascaderValue = [] this.cascaderValue = []
this.getOrg() this.getOrg()
}, },
// //
getStaff() { getStaff () {
this.$post(this.api.staffList, { this.$post(this.api.staffList, {
type: this.studentType || 1, type: this.studentType || 1,
staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '', staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '',
@ -497,50 +600,50 @@ export default {
}).then(res => { }).then(res => {
this.listData = res.page.records this.listData = res.page.records
this.total = res.page.total this.total = res.page.total
}).catch(err => {}) }).catch(err => { })
}, },
// //
currentChange(val) { currentChange (val) {
this.page = val this.page = val
this.getStaff() this.getStaff()
}, },
handleSelectionChange(val) { // handleSelectionChange (val) { //
this.multipleSelection = val this.multipleSelection = val
}, },
initData() { initData () {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.page = 1 this.page = 1
this.getStaff() this.getStaff()
}, },
// //
delStaff(row) { delStaff (row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => { this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
util.successMsg("删除成功") util.successMsg("删除成功")
this.getStaff() this.getStaff()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
}, },
// //
resetPassword(row) { resetPassword (row) {
const newPwd = Setting.initialPassword const newPwd = Setting.initialPassword
this.$confirm(`重置后的密码为:${newPwd},确定重置?`, "提示", { type: "warning" }).then(() => { this.$confirm(`重置后的密码为:${newPwd},确定重置?`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPwd}?userId=${row.userId}&newPwd=${newPwd}`).then(res => { this.$get(`${this.api.resetPwd}?userId=${row.userId}&newPwd=${newPwd}`).then(res => {
util.successMsg("重置成功") util.successMsg("重置成功")
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
}, },
// //
addStaff() { addStaff () {
this.staffVisible = true this.staffVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
}) })
}, },
// / // /
queryStaff(row, isDetail) { queryStaff (row, isDetail) {
const archId = [] const archId = []
// id // id
const handleArchId = (list, ids, parentId = []) => { const handleArchId = (list, ids, parentId = []) => {
@ -584,16 +687,16 @@ export default {
this.form = data this.form = data
this.originAccount = data.account this.originAccount = data.account
this.originWorkNumber = data.workNumber this.originWorkNumber = data.workNumber
}).catch(res => {}) }).catch(res => { })
}, },
// //
getRole() { getRole () {
this.$get(`${this.api.roleList}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => { this.$get(`${this.api.roleList}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => {
this.roleList = res.rolePage.records this.roleList = res.rolePage.records
}).catch(res => {}) }).catch(res => { })
}, },
// //
accountChange() { accountChange () {
const form = this.form const form = this.form
const { account } = form const { account } = form
if (account === this.originAccount) { if (account === this.originAccount) {
@ -608,7 +711,7 @@ export default {
} }
}, },
// //
worknumberChange() { worknumberChange () {
const form = this.form const form = this.form
const { workNumber } = form const { workNumber } = form
if (workNumber === this.originWorkNumber) { if (workNumber === this.originWorkNumber) {
@ -623,7 +726,7 @@ export default {
} }
}, },
// //
phoneChange() { phoneChange () {
const form = this.form const form = this.form
const { phone } = form const { phone } = form
if (phone) { if (phone) {
@ -636,7 +739,7 @@ export default {
} }
}, },
// //
emailChange() { emailChange () {
const form = this.form const form = this.form
const { email } = form const { email } = form
if (email) { if (email) {
@ -649,7 +752,7 @@ export default {
} }
}, },
// / // /
submitStaff() { submitStaff () {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
@ -691,7 +794,7 @@ export default {
}) })
}, },
// //
closeStaff() { closeStaff () {
this.form = { this.form = {
accountId: '', accountId: '',
userName: '', userName: '',
@ -707,26 +810,26 @@ export default {
this.getStaff() this.getStaff()
}, },
// //
batchImport() { batchImport () {
this.importVisible = true this.importVisible = true
this.uploadList = [] this.uploadList = []
this.uploadFaild = false this.uploadFaild = false
}, },
// //
download() { download () {
location.href = this.api.staffTemplate location.href = this.api.staffTemplate
}, },
// //
handleExceed(files, fileList) { handleExceed (files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
// //
showFaild() { showFaild () {
location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}` location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}`
}, },
uploadSuccess(res, file, fileList) { uploadSuccess (res, file, fileList) {
this.uploadFaild = false this.uploadFaild = false
if (res.status === 200) { if (res.status === 200) {
if (res.data.exportCode) { if (res.data.exportCode) {
@ -738,21 +841,21 @@ export default {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据")
} }
}, },
uploadError(err, file, fileList) { uploadError (err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}) })
}, },
beforeRemove(file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
}, },
handleRemove(file, fileList) { handleRemove (file, fileList) {
this.uploadList = fileList this.uploadList = fileList
this.uploadFaild = false this.uploadFaild = false
}, },
uploadSure() { uploadSure () {
this.importVisible = false this.importVisible = false
this.studentType = 1 this.studentType = 1
this.keyWord = '' this.keyWord = ''

Loading…
Cancel
Save