竞赛相关修复

master
yujialong 8 months ago
parent b0d59aeb7d
commit bc119ffe55
  1. 2378
      package-lock.json
  2. 1
      package.json
  3. 2
      src/pages/match/add/index.vue
  4. 11
      src/pages/match/list/index.vue
  5. 12
      src/pages/match/manage/matchInfo.vue
  6. 137
      src/pages/match/manage/matchSignup.vue
  7. 8
      vue.config.js

2378
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -17,6 +17,7 @@
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"mavon-editor": "^2.10.4", "mavon-editor": "^2.10.4",

@ -222,7 +222,7 @@ export default {
// //
next (next, setupId, competitionId, type) { next (next, setupId, competitionId, type) {
if (!next) { if (!next) {
this.$router.push(`/match?page=${this.$store.state.matchPage}`) 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) {

@ -75,6 +75,7 @@
stripe stripe
header-align="center" header-align="center"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
v-loading="loading"
row-key="id"> row-key="id">
<el-table-column type="selection" <el-table-column type="selection"
width="55" width="55"
@ -283,7 +284,8 @@ export default {
picker.$emit('pick', new Date(Date.now() + 5000)) picker.$emit('pick', new Date(Date.now() + 5000))
} }
}] }]
} },
loading: false,
}; };
}, },
watch: { watch: {
@ -327,7 +329,7 @@ export default {
'setPage' 'setPage'
]), ]),
getData () { getData () {
// const load = Loading.service() this.loading = true
const { form } = this const { form } = this
this.$post(this.api.competitionPageConditionQueryByOccupationlab, { this.$post(this.api.competitionPageConditionQueryByOccupationlab, {
pageNum: this.page, pageNum: this.page,
@ -370,12 +372,13 @@ export default {
this.matchData = list this.matchData = list
this.total = data.total this.total = data.total
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.loading = false
if (!this.matchData.length && this.total) { if (!this.matchData.length && this.total) {
this.page-- this.page--
this.getData() this.getData()
} }
}).catch(res => { }).catch(res => {
// load.close() this.loading = false
}) })
}, },
initData () { initData () {
@ -398,7 +401,7 @@ export default {
}).then(async () => { }).then(async () => {
await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`) await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`)
util.successMsg('复制成功') util.successMsg('复制成功')
this.getData() this.initData()
}).catch(() => { }) }).catch(() => { })
}, },
// //

@ -93,7 +93,7 @@
<template> <template>
<i v-if="item.edit" <i v-if="item.edit"
class="el-icon-check icon" class="el-icon-check icon"
@click="submitAdvisor(item)"></i> @click="submitAdvisor(item, i)"></i>
<i v-else <i v-else
class="el-icon-edit icon" class="el-icon-edit icon"
@click="editAdvisor(item)"></i> @click="editAdvisor(item)"></i>
@ -330,6 +330,7 @@ export default {
curStage: null, curStage: null,
originInfo: {}, originInfo: {},
originIns: { originIns: {
id: '',
position: '', position: '',
name: '', name: '',
phone: '', phone: '',
@ -481,7 +482,7 @@ export default {
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
submitAdvisor (row) { submitAdvisor (row, i) {
if (!row.name) return util.errorMsg('请输入姓名') if (!row.name) return util.errorMsg('请输入姓名')
const { phone } = row const { phone } = row
if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式') if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式')
@ -493,9 +494,12 @@ export default {
phone: row.phone, phone: row.phone,
position: row.position, position: row.position,
accountId: this.accountId accountId: this.accountId
}).then(res => { }).then(({ id }) => {
util.successMsg((row.id ? '修改' : '新增') + '成功') util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getInfo() if (!row.id) {
this.info.teamInstructors[i].id = id
}
this.info.teamInstructors[i].edit = 0
}).catch(res => { }) }).catch(res => { })
}, },
// //

@ -41,8 +41,7 @@
v-auth="'/match/list:管理:报名人员:批量导出'">批量导出</el-button> v-auth="'/match/list:管理:报名人员:批量导出'">批量导出</el-button>
<el-button type="primary" <el-button type="primary"
@click="batchDel" @click="batchDel"
round round>批量删除</el-button>
v-auth="'/match:管理:报名人员:导出'">批量删除</el-button>
</div> </div>
</div> </div>
@ -68,12 +67,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="school" <el-table-column prop="school"
label="学生账号归属" label="学生账号归属"
sortable="custom"
min-width="180" min-width="180"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="realSchool" <el-table-column prop="realSchool"
label="学生所属院校" label="学生所属院校"
sortable="custom"
min-width="180" min-width="180"
align="center"> align="center">
</el-table-column> </el-table-column>
@ -99,13 +98,11 @@
min-width="140" min-width="140"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column label="是否为队长" <el-table-column v-if="info.completeCompetitionSetup.competitionType"
prop="captain"
label="是否为队长"
min-width="80" min-width="80"
align="center"> align="center"></el-table-column>
<template slot-scope="scope">
{{ scope.row.captain ? '否' : '是' }}
</template>
</el-table-column>
<el-table-column prop="teachers" <el-table-column prop="teachers"
label="指导老师" label="指导老师"
min-width="200" min-width="200"
@ -130,10 +127,13 @@
align="center" align="center"
width="270"> width="270">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.identification" <el-button v-if="scope.row.identification && schoolId === scope.row.schoolId"
type="text" type="text"
@click="edit(scope.row)" @click="edit(scope.row)"
v-auth="'/match/list:管理:报名人员:编辑'">编辑</el-button> v-auth="'/match/list:管理:报名人员:编辑'">编辑</el-button>
<el-button v-else
type="text"
@click="edit(scope.row, 1)">查看</el-button>
<el-button type="text" <el-button type="text"
@click="del(scope.row)">删除</el-button> @click="del(scope.row)">删除</el-button>
<template v-if="info.releaseType"> <template v-if="info.releaseType">
@ -160,15 +160,16 @@
</el-pagination> </el-pagination>
</div> </div>
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" <el-dialog :title="(diffSchool ? '查看' : (!isAdd ? '编辑' : '新增')) + '参赛人员'"
:visible.sync="addVisible" :visible.sync="addVisible"
width="400px" width="440px"
class="dialog" class="dialog"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="closeAdd"> @close="closeAdd">
<el-form ref="form" <el-form ref="form"
:model="form" :model="form"
:rules="rules" :rules="rules"
:disabled="diffSchool"
label-width="110px" label-width="110px"
style='margin-right: 10px;'> style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable" <el-form-item v-if="!schoolDisable"
@ -195,6 +196,8 @@
:label="item.schoolName" :label="item.schoolName"
:value="item.schoolId"></el-option> :value="item.schoolId"></el-option>
</el-select> </el-select>
<p v-if="!diffSchool"
style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校若为空则默认与学生账号归属院校一致</p>
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" <el-form-item prop="workNumber"
label="学生学号"> label="学生学号">
@ -243,6 +246,9 @@
:disabled="isAdd"></el-input> :disabled="isAdd"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<p v-if="!isAdd && schoolId === form.schoolId"
class="tips"
style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer" <span slot="footer"
class="dialog-footer"> class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button> <el-button @click="addVisible = false">取消</el-button>
@ -280,44 +286,41 @@
<el-dialog title="批量导入" <el-dialog title="批量导入"
:visible.sync="importVisible" :visible.sync="importVisible"
width="24%" width="24%"
:close-on-click-modal="false"> :close-on-click-modal="false"
@close="cancelUpload">
<div style="text-align: center"> <div style="text-align: center">
<div style="margin-bottom: 10px;"> <template v-if="!uploadFaild">
<el-button type="primary" <div style="margin-bottom: 10px;">
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> <el-button type="primary"
</div> @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
<el-upload ref="upload" </div>
name="file" <el-upload ref="upload"
accept=".xls,.xlsx" name="file"
:on-remove="handleRemove" accept=".xls,.xlsx"
:on-error="uploadError" :on-remove="handleRemove"
:on-success="uploadSuccess" :on-error="uploadError"
:before-remove="beforeRemove" :on-success="uploadSuccess"
:limit="1" :before-remove="beforeRemove"
:data="{ :limit="1"
competitionId: id, :data="{
platformId: 1 competitionId: id,
}" platformId: 1
:auto-upload="false" }"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData" :action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
: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" </template>
type="primary" <template v-else>
@click="showFaild">部分数据导入失败查看失败原因</el-link> <p style="margin-bottom: 13px;font-size: 14px;color: #e90000;">{{ uploadTips }}</p>
<a type="primary"
style="font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</a>
</template>
</div> </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>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -331,6 +334,7 @@ export default {
data () { data () {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
schoolId: this.$store.state.user.schoolId,
id: +this.$route.query.id, id: +this.$route.query.id,
info: { info: {
completeCompetitionSetup: {} completeCompetitionSetup: {}
@ -410,10 +414,12 @@ export default {
importVisible: false, importVisible: false,
uploadList: [], uploadList: [],
uploadFaild: false, uploadFaild: false,
uploadTips: '',
exportCode: '', exportCode: '',
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
diffSchool: false,
}; };
}, },
watch: { watch: {
@ -526,13 +532,15 @@ export default {
}, },
uploadSuccess ({ data, status }) { uploadSuccess ({ data, status }) {
this.uploadFaild = false this.uploadFaild = false
this.uploadTips = ''
if (status === 200) { if (status === 200) {
this.init()
if (data.exportCode) { if (data.exportCode) {
this.exportCode = data.exportCode this.exportCode = data.exportCode
this.uploadFaild = true this.uploadFaild = true
util.errorMsg(data.tip, 3000) this.uploadTips = data.tip
} else { } else {
this.init() util.successMsg(data.tip, 3000)
this.importVisible = false this.importVisible = false
this.keyWord = '' this.keyWord = ''
} }
@ -554,11 +562,19 @@ export default {
this.uploadList = fileList this.uploadList = fileList
this.uploadFaild = false this.uploadFaild = false
}, },
cancelUpload () {
this.$refs.upload.abort()
this.init()
this.importVisible = false
this.keyWord = ''
},
uploadSure () { uploadSure () {
this.$refs.upload.submit(); this.importVisible = false
this.keyWord = ''
}, },
// //
add () { add () {
this.diffSchool = false
this.notExit = 0 this.notExit = 0
this.isAdd = true this.isAdd = true
this.addVisible = true this.addVisible = true
@ -573,9 +589,10 @@ export default {
row.id = row.accountId row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row)) this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
this.diffSchool = row.schoolId !== this.schoolId //
}, },
del (row) { del (row) {
this.$confirm(row.captain ? '此删除操作不可逆,是否确认删除选中项?' : '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?', "提示", { this.$confirm(!this.info.completeCompetitionSetup.competitionType || row.captain === '否' ? '此删除操作不可逆,是否确认删除选中项?' : '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?', "提示", {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
@ -629,12 +646,14 @@ export default {
hrUserInfo: { hrUserInfo: {
userId: form.userId, userId: form.userId,
schoolId: form.schoolId, schoolId: form.schoolId,
email: form.email email: form.email,
userName: form.userName
} }
}).then(res => { }).then(res => {
// //
if (this.originForm.teamId !== form.teamId) { if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, { this.$post(this.api.joinCompetitionTeam, {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
@ -661,6 +680,7 @@ export default {
} else { } else {
// //
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], { this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
@ -792,11 +812,12 @@ export default {
}, },
// //
batchDel () { batchDel () {
if (this.multipleSelection.length) { const list = this.multipleSelection
this.$confirm("确定要删除吗?", "提示", { if (list.length) {
this.$confirm(this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?' : '此删除操作不可逆,是否确认删除选中项?', "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: this.multipleSelection }).then(res => { this.$post(this.api.batchDeleteApplicants, { registrationVOS: list }).then(res => {
this.getData(); this.getData();
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
@ -823,4 +844,8 @@ export default {
align-items: center; align-items: center;
} }
} }
.tips {
font-size: 12px;
color: #e90000;
}
</style> </style>

@ -17,4 +17,12 @@ module.exports = {
port: 8081 // 固定端口 port: 8081 // 固定端口
}, },
productionSourceMap: false, productionSourceMap: false,
chainWebpack: config => {
config.module
.rule("images")
.use("image-webpack-loader")
.loader("image-webpack-loader")
.options({ bypassOnDebug: true })
.end();
}
} }
Loading…
Cancel
Save