|
|
|
@ -85,21 +85,22 @@ |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="username" |
|
|
|
|
label="队长/成员" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
label="队长/成员学号" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="phone" |
|
|
|
|
label="队长/成员手机号" |
|
|
|
|
:label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'" |
|
|
|
|
min-width="140" |
|
|
|
|
align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="是否为队长" |
|
|
|
|
<el-table-column v-if="info.completeCompetitionSetup.competitionType" |
|
|
|
|
label="是否为队长" |
|
|
|
|
min-width="80" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -285,9 +286,9 @@ |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-upload ref="importStaff" |
|
|
|
|
name="file" |
|
|
|
|
<el-upload name="file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
ref="upload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:on-success="uploadSuccess" |
|
|
|
@ -297,6 +298,7 @@ |
|
|
|
|
competitionId: id, |
|
|
|
|
platformId: 2 |
|
|
|
|
}" |
|
|
|
|
:auto-upload="false" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData" |
|
|
|
|
:file-list="uploadList" |
|
|
|
@ -515,7 +517,6 @@ export default { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
console.log("🚀 ~ showFaild ~ res:", res, res.headers['content-disposition'], typeof res.headers['content-disposition']) |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
@ -526,10 +527,14 @@ export default { |
|
|
|
|
if (data.exportCode) { |
|
|
|
|
this.exportCode = data.exportCode |
|
|
|
|
this.uploadFaild = true |
|
|
|
|
util.errorMsg(data.tip) |
|
|
|
|
util.errorMsg(data.tip, 3000) |
|
|
|
|
} else { |
|
|
|
|
this.init() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
|
|
|
|
util.errorMsg(res.message || '上传失败,请检查数据', 3000) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
@ -547,9 +552,7 @@ export default { |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
uploadSure () { |
|
|
|
|
this.init() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.keyWord = '' |
|
|
|
|
this.$refs.upload.submit(); |
|
|
|
|
}, |
|
|
|
|
// 新增 |
|
|
|
|
add () { |
|
|
|
@ -765,7 +768,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data])) |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else { |
|
|
|
|
axios.get(`${this.api.excelExport}?competitionId=${this.id}`, { |
|
|
|
@ -774,7 +778,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data])) |
|
|
|
|
const name = res.headers['content-disposition'] |
|
|
|
|
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|