|
|
|
@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<div v-loading="loading"> |
|
|
|
|
<el-card v-if="method != 2" |
|
|
|
|
shadow="hover" |
|
|
|
|
class="m-b-20"> |
|
|
|
@ -53,14 +54,16 @@ |
|
|
|
|
type="primary" |
|
|
|
|
@click="batchImport">上传成绩</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:disabled="!!multipleSelection.find(e => method != 2 && !e.reportId)" |
|
|
|
|
@click="delAllData">批量删除</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="exportData">导出</el-button> |
|
|
|
|
:loading="exporting" |
|
|
|
|
@click="exportData">{{ exporting ? '正在导出' : '批量导出' }}</el-button> |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:loading="loading" |
|
|
|
|
@click="exportData1">{{ loading ? '正在导出' : '批量导出' }}</el-button> |
|
|
|
|
:loading="exporting1" |
|
|
|
|
@click="exportData1">{{ exporting1 ? '正在导出' : '批量导出' }}</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<template v-if="!active"> |
|
|
|
@ -84,8 +87,12 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="schoolName" |
|
|
|
|
label="学校" |
|
|
|
|
min-width="150" |
|
|
|
|
label="学生账号归属" |
|
|
|
|
min-width="100" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="realSchool" |
|
|
|
|
label="学生所属院校" |
|
|
|
|
min-width="100" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if="competitionType" |
|
|
|
|
prop="teamName" |
|
|
|
@ -168,7 +175,10 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="schoolName" |
|
|
|
|
label="学校" |
|
|
|
|
label="学生账号归属" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="realSchool" |
|
|
|
|
label="学生所属院校" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if="competitionType" |
|
|
|
|
prop="teamName" |
|
|
|
@ -221,19 +231,23 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-card> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
width="24%" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<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="importStaff" |
|
|
|
|
<el-upload ref="upload" |
|
|
|
|
name="file" |
|
|
|
|
class="import-file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:on-success="uploadSuccess" |
|
|
|
@ -243,25 +257,28 @@ |
|
|
|
|
:action="this.api.batchImportGrades" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
:disabled="uploading" |
|
|
|
|
:data="{ |
|
|
|
|
competitionId: this.id, |
|
|
|
|
stageId: this.stageId, |
|
|
|
|
systemId: 0 |
|
|
|
|
}"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:loading="uploading" |
|
|
|
|
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> |
|
|
|
|
<template v-else> |
|
|
|
|
<p style="margin-bottom: 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p> |
|
|
|
|
<p type="primary" |
|
|
|
|
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;" |
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</p> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" |
|
|
|
|
<span v-if="uploading" |
|
|
|
|
slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
type="primary" |
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
|
<el-button @click="cancelUpload">停止导入</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -299,14 +316,17 @@ export default { |
|
|
|
|
importVisible: false, |
|
|
|
|
uploadList: [], |
|
|
|
|
uploadFaild: false, |
|
|
|
|
exportCode: '', |
|
|
|
|
uploading: false, |
|
|
|
|
faildData: null, |
|
|
|
|
headers: { |
|
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
|
|
}, |
|
|
|
|
statData: {}, |
|
|
|
|
tabs: ['成绩列表', '文件列表'], |
|
|
|
|
active: 0, |
|
|
|
|
loading: false |
|
|
|
|
loading: false, |
|
|
|
|
exporting: false, |
|
|
|
|
exporting1: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -321,16 +341,17 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData () { |
|
|
|
|
async getData () { |
|
|
|
|
this.loading = true |
|
|
|
|
// 文件列表 |
|
|
|
|
if (this.active) { |
|
|
|
|
this.$post(this.api.cCompetitionStageFileList, { |
|
|
|
|
const { data } = await this.$post(this.api.cCompetitionStageFileList, { |
|
|
|
|
pageNum: this.page1, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
stageId: this.stageId, |
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
}) |
|
|
|
|
data.records.forEach(e => { |
|
|
|
|
e.loading = false |
|
|
|
|
e.fileType = '其他' |
|
|
|
@ -350,22 +371,22 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.list1 = data.records |
|
|
|
|
this.total1 = data.total |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
this.loading = false |
|
|
|
|
} else { // 成绩列表 |
|
|
|
|
this.$post(this.api.stageGradeManagementList, { |
|
|
|
|
const { data, page } = await this.$post(this.api.stageGradeManagementList, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
stageId: this.stageId, |
|
|
|
|
isNakadai: 1 |
|
|
|
|
}).then(({ data, page }) => { |
|
|
|
|
}) |
|
|
|
|
this.total = page.total |
|
|
|
|
this.list = page.records |
|
|
|
|
this.statData = data |
|
|
|
|
this.avgScore = (+data.avgScore).toFixed(2) |
|
|
|
|
this.getChart() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
@ -377,17 +398,19 @@ export default { |
|
|
|
|
this.$router.push(`/match/report?reportId=${row.reportId}`) |
|
|
|
|
}, |
|
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
|
exportData () { |
|
|
|
|
async exportData () { |
|
|
|
|
if (this.list.length) { |
|
|
|
|
this.exporting = true |
|
|
|
|
// 有选择数据,则导出已选择的,否则导出全部 |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, { |
|
|
|
|
const res = await axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
}) |
|
|
|
|
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else if (this.list.length) { |
|
|
|
|
axios.post(this.api.allExperimentalResultsAreDerived, { |
|
|
|
|
this.exporting = false |
|
|
|
|
} else { |
|
|
|
|
const res = await axios.post(this.api.allExperimentalResultsAreDerived, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 10000, |
|
|
|
|
competitionId: this.id, |
|
|
|
@ -396,31 +419,21 @@ export default { |
|
|
|
|
}, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
}) |
|
|
|
|
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
this.exporting = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// let { list } = this |
|
|
|
|
// if (this.multipleSelection.length) { |
|
|
|
|
// list = this.multipleSelection |
|
|
|
|
// } |
|
|
|
|
// axios.post(this.api.exportExperimentalResultsInBatch, list, { |
|
|
|
|
// headers: this.headers, |
|
|
|
|
// responseType: 'blob' |
|
|
|
|
// }).then((res) => { |
|
|
|
|
// util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
|
|
|
|
// }).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
|
|
|
|
exportData1 () { |
|
|
|
|
this.loading = true |
|
|
|
|
this.exporting1 = true |
|
|
|
|
let list = this.list1 |
|
|
|
|
if (this.multipleSelection1.length) { |
|
|
|
|
list = this.multipleSelection1 |
|
|
|
|
} |
|
|
|
|
Zip('批量导出', list, () => { |
|
|
|
|
this.loading = false |
|
|
|
|
this.exporting1 = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleDelete (row) { // 删除 |
|
|
|
@ -443,21 +456,22 @@ export default { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
}).then(async () => { |
|
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
|
return this.method == 2 ? item.scoreId : item.reportId |
|
|
|
|
}); |
|
|
|
|
this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
|
ids = ids.filter(e => e) |
|
|
|
|
if (ids.length) { |
|
|
|
|
await this.$post(this.api.batchDeleteContestGrade, { |
|
|
|
|
ids, |
|
|
|
|
competitionId: this.id, |
|
|
|
|
stageId: this.stageId |
|
|
|
|
}).then(res => { |
|
|
|
|
}) |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -517,7 +531,12 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 模板下载 |
|
|
|
|
download () { |
|
|
|
|
location.href = this.api.gradeImport |
|
|
|
|
axios.get(`${this.api.gradeDownloadExcel}?competitionId=${this.id}&stageId=${this.stageId}`, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
@ -527,23 +546,27 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 下载失败文件 |
|
|
|
|
showFaild () { |
|
|
|
|
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, { |
|
|
|
|
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.faildData.exportCode}&competitionType=${this.faildData.competitionType}`, { |
|
|
|
|
headers: this.headers, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
|
uploadSuccess (res) { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
if (res.data.exportCode) { |
|
|
|
|
this.exportCode = res.data.exportCode |
|
|
|
|
const { data } = res |
|
|
|
|
if (data.exportCode) { |
|
|
|
|
this.faildData = data |
|
|
|
|
this.uploadFaild = true |
|
|
|
|
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) |
|
|
|
|
} else { |
|
|
|
|
util.successMsg(data.tip, 3000) |
|
|
|
|
this.importVisible = false |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
|
|
|
|
util.errorMsg(res.message || '上传失败,请检查数据') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
@ -553,6 +576,9 @@ export default { |
|
|
|
|
center: true |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
beforeUpload (file) { |
|
|
|
|
this.uploading = true |
|
|
|
|
}, |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
|
}, |
|
|
|
@ -560,9 +586,12 @@ export default { |
|
|
|
|
this.uploadList = fileList |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
uploadSure () { |
|
|
|
|
cancelUpload () { |
|
|
|
|
this.uploading = false |
|
|
|
|
this.$refs.upload.abort() |
|
|
|
|
this.keyword = '' |
|
|
|
|
this.initData() |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// tab回调 |
|
|
|
@ -658,4 +687,11 @@ export default { |
|
|
|
|
height: 300px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.import-file { |
|
|
|
|
.el-progress__text, |
|
|
|
|
.el-progress, |
|
|
|
|
.el-upload-list__item-status-label { |
|
|
|
|
display: none !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |