竞赛相关修复

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-ui": "^2.13.0",
"file-saver": "^2.0.5",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^2.2.1",
"jszip": "^3.10.1",
"mavon-editor": "^2.10.4",

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

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

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

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

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