dev_review
yujialong 8 months ago
parent 43b59996f3
commit 09d3eaa5d8
  1. 2
      src/setting.js
  2. 1
      src/utils/api.js
  3. 5
      src/views/match/add/step1.vue
  4. 1
      src/views/match/manage/index.vue
  5. 644
      src/views/match/manage/matchArchList copy.vue
  6. 164
      src/views/match/manage/matchArchList.vue
  7. 34
      src/views/match/manage/matchInfo.vue
  8. 109
      src/views/match/manage/matchRank.vue
  9. 41
      src/views/match/manage/matchSignup.vue
  10. 11
      src/views/serve/projectAdd.vue

@ -14,7 +14,7 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.51:9000/'
host = 'http://192.168.31.217:9000/'
} else if (isPro) {
jumpPath = 'https://judgment.huorantech.cn/'
}

@ -420,6 +420,7 @@ export default {
allExperimentalResultsAreDerived: `${host}competition/competition/performance/allExperimentalResultsAreDerived`,
derivedRanking: `${host}competition/competition/rank/derivedRanking`,
individualDerivedRanking: `${host}competition/competition/rank/individualDerivedRanking`,
gradeDownloadExcel: `${host}competition/competition/performance/downloadExcel`,
gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`,

@ -147,11 +147,12 @@
<div>
<el-radio v-model="form.competitionScope"
:label="2">指定区域院校</el-radio>
<el-button v-if="form.competitionScope === 2"
type="primary"
<template v-if="form.competitionScope === 2">
<el-button type="primary"
size="mini"
@click="showRange">选择院校</el-button>
<span style="margin-left: 20px">{{ rangeName }}</span>
</template>
</div>
</el-form-item>
<el-form-item class="req"

@ -40,7 +40,6 @@ export default {
data () {
return {
name: this.$route.query.name,
releaseType: +this.$route.query.releaseType,
active: this.$route.query.tab || '',
tabs: {
tab1: "大赛详情",

@ -1,644 +0,0 @@
<template>
<div>
<el-card shadow="hover"
class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="$router.back()"
content="成绩管理"></el-page-header>
</div>
</el-card>
<el-card v-if="method != 2"
shadow="hover"
class="m-b-20">
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">已参加/应参加人数</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }}</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
</div>
</div>
<div class="chart"
id="chart"></div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div v-if="showFile"
class="tabs m-b-20">
<a class="item"
v-for="(item, i) in tabs"
:key="i"
:class="{active: i === active}"
@click="tabChange(i)">{{ item }}</a>
</div>
<div class="flex-between m-b-20">
<div>
<el-input size="small"
placeholder="请输入学校/学生姓名"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
style="width: 300px"></el-input>
</div>
<div v-if="!active">
<el-button v-if="method == 2"
type="primary"
@click="batchImport">上传成绩</el-button>
<el-button type="primary"
@click="delAllData">批量删除</el-button>
<el-button type="primary"
@click="exportData">导出</el-button>
</div>
<div v-else>
<el-button type="primary"
:loading="loading"
@click="exportData1">{{ loading ? '正在导出' : '批量导出' }}</el-button>
</div>
</div>
<template v-if="!active">
<el-table :data="list"
class="table"
:key="1"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="reportId">
<el-table-column type="selection"
width="55"
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="schoolName"
label="学校"
min-width="150"
align="center"></el-table-column>
<el-table-column v-if="competitionType"
prop="teamName"
label="团队名称"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="userName"
label="学生姓名"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="学号"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="score"
label="分数"
width="90"
align="center"></el-table-column>
<el-table-column prop="timeSum"
label="耗时"
width="90"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }}
</template>
</el-table-column>
<el-table-column prop="submitTime"
label="提交时间"
min-width="150"
align="center">
<template slot-scope="scope">
{{ scope.row.submitTime || '--' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<template slot-scope="scope">
<el-button :disabled="!scope.row.reportId"
type="text"
@click="show(scope.row)">{{ scope.row.reportId ? '查看成绩报告' : '未参加' }}</el-button>
<el-button v-if="scope.row.reportId"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</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>
</template>
<template v-else>
<el-table :data="list1"
class="table"
:key="2"
stripe
header-align="center"
@selection-change="handleSelectionChange1"
row-key="reportId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page1 - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="schoolName"
label="学校"
align="center"></el-table-column>
<el-table-column v-if="competitionType"
prop="teamName"
label="团队名称"
align="center"></el-table-column>
<el-table-column prop="userName"
label="学生姓名"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="学号"
align="center"></el-table-column>
<el-table-column prop="fileName"
label="文件名"
align="center"></el-table-column>
<el-table-column prop="fileSize"
label="文件大小"
align="center"></el-table-column>
<el-table-column prop="fileType"
label="文件类型"
align="center"></el-table-column>
<el-table-column prop="fileFormat"
label="文件格式"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="提交时间"
width="150"
align="center">
</el-table-column>
<el-table-column label="操作"
width="200">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)"
type="text"
@click="preview(scope.row)">预览文件</el-button>
<el-button type="primary"
size="mini"
:loading="scope.row.loading"
@click="exportFile(scope.row)">导出文件</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total1"
@current-change="handleCurrentChange1"
:current-page="page1">
</el-pagination>
</div>
</template>
</el-card>
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
<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="importStaff"
name="file"
accept=".xls,.xlsx"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.batchImportGrades"
:file-list="uploadList"
:headers="headers"
:data="{
competitionId: this.id,
stageId: this.stageId,
systemId: 0
}">
<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>
</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>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import * as echarts from "echarts";
import axios from 'axios';
import Zip from '@/libs/zip'
export default {
data () {
return {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
showFile: this.$route.query.showFile === 'true',
isCompress: util.isCompress,
keyword: "",
searchTimer: null,
list: [],
multipleSelection: [],
page: 1,
pageSize: 10,
total: 0,
list1: [],
multipleSelection1: [],
page1: 1,
total1: 0,
avgScore: 0, //
importVisible: false,
uploadList: [],
uploadFaild: false,
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0,
loading: false
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
getData () {
//
if (this.active) {
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 = '其他'
if (util.isVideo(e.fileFormat)) {
e.fileType = '视频'
} else if (util.isAudio(e.fileFormat)) {
e.fileType = '音频'
} else if (util.isImg(e.fileFormat)) {
e.fileType = '图片'
} else if (util.isDoc(e.fileFormat)) {
e.fileType = '文档'
} else if (util.isCompress(e.fileFormat)) {
e.fileType = '压缩包'
} else if (e.fileType === 'pdf') {
e.fileType = 'pdf'
}
})
this.list1 = data.records
this.total1 = data.total
}).catch(res => { })
} else { //
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 => { })
}
},
initData () {
this.page = 1
this.getData()
},
//
show (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
// ()
exportData () {
//
if (this.multipleSelection.length) {
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, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
isNakadai: 1,
stageId: this.stageId,
}, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
}).catch(res => { })
}
},
// ()
exportData1 () {
this.loading = true
let list = this.list1
if (this.multipleSelection1.length) {
list = this.multipleSelection1
}
Zip('批量导出', list, () => {
this.loading = false
})
},
handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteContestGrade, {
ids: [this.method == 2 ? row.scoreId : row.reportId],
competitionId: this.id,
stageId: row.stageId
}).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData () { //
if (this.multipleSelection.length) {
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return this.method == 2 ? item.scoreId : item.reportId
});
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 {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.page = val;
this.getData();
},
handleSelectionChange1 (val) { //
this.multipleSelection1 = val;
},
handleCurrentChange1 (val) { //
this.page1 = val;
this.getData();
},
getChart () { // 线
const data = []
const { statData } = this
for (let i = 1; i <= 10; i++) {
data.push(statData['num' + i])
}
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
boundaryGap: false,
interval: 10,
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
},
yAxis: {
name: "人数",
type: "value",
interval: 10
},
series: [{
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]
}]
});
},
//
batchImport () {
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
//
download () {
location.href = this.api.gradeImport
},
//
handleExceed (files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild () {
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess (res, file, fileList) {
this.uploadFaild = false
if (res.status === 200) {
if (res.data.exportCode) {
this.exportCode = res.data.exportCode
this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
}
} else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据")
}
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleRemove (file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure () {
this.importVisible = false
this.getData()
},
// tab
tabChange (i) {
this.active = i
this.getData()
},
//
preview (item) {
window.open((util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
exportFile (item) {
item.loading = true
const url = item.filePath
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = "blob"
x.onload = function (e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement("a")
a.href = url
a.download = item.userName + '-' + item.fileName
a.click()
item.loading = false
}
x.send()
},
}
};
</script>
<style lang="scss" scoped>
/deep/ .head-card {
.el-card__body {
padding-bottom: 0px;
.el-tabs__header {
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__item {
font-size: 18px;
}
}
}
}
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
margin-right: 20px;
.item:nth-child(1) {
background-image: url('../../../assets/img/total.png');
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item {
width: 300px;
min-height: 145px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background-size: 100% 100%;
background-repeat: no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
}
.chart {
flex: 1;
height: 300px;
}
}
</style>

@ -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">
@ -71,7 +74,7 @@
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="reportId">
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
@ -85,8 +88,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"
@ -125,14 +132,20 @@
{{ scope.row.submitTime || '--' }}
</template>
</el-table-column>
<el-table-column label="状态"
width="100"
align="center">
<template slot-scope="scope">
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<template slot-scope="scope">
<el-button v-if="method != 2"
:disabled="!scope.row.reportId"
<el-button v-if="method != 2 && scope.row.reportId"
type="text"
@click="show(scope.row)">{{ scope.row.reportId ? '查看成绩报告' : '未参加' }}</el-button>
@click="show(scope.row)">查看成绩报告</el-button>
<el-button v-if="scope.row.reportId"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
@ -155,7 +168,7 @@
stripe
header-align="center"
@selection-change="handleSelectionChange1"
row-key="reportId">
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
@ -169,7 +182,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 +237,23 @@
</div>
</template>
</el-card>
</div>
<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">
<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"
accept=".xls,.xlsx"
class="import-file"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
@ -243,25 +263,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: -10px 0 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 +322,17 @@ export default {
importVisible: false,
uploadList: [],
uploadFaild: false,
exportCode: '',
uploading: false,
faildData: null,
headers: {
token: sessionStorage.getItem("token")
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0,
loading: false
loading: false,
exporting: false,
exporting1: false,
};
},
watch: {
@ -321,16 +347,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 +377,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 +404,19 @@ export default {
this.$router.push(`/matchReport?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 => { })
this.exporting = false
} else if (this.list.length) {
axios.post(this.api.allExperimentalResultsAreDerived, {
const res = await axios.post(this.api.allExperimentalResultsAreDerived, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
@ -396,20 +425,21 @@ export default {
}, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
}).catch(res => { })
this.exporting = false
}
}
},
// ()
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) { //
@ -432,21 +462,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 {
@ -506,7 +537,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) {
@ -516,32 +552,40 @@ 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) {
this.uploading = false
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeUpload (file) {
this.uploading = true
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
@ -549,9 +593,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
tabChange (i) {
@ -646,4 +693,11 @@ export default {
height: 300px;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -288,7 +288,7 @@
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import Util from "@/libs/util";
export default {
data () {
return {
@ -440,6 +440,7 @@ export default {
edit (showMsg) {
if (this.editing || !showMsg) {
const { teamId, teamName, invitationCode } = this.info.team
if (invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码')
this.$post(this.api.editCompetitionTeam, {
accountId: this.accountId,
identification: 1,
@ -451,7 +452,7 @@ export default {
}).then(res => {
this.editing = false
this.getInfo()
showMsg && util.successMsg('保存成功')
showMsg && Util.successMsg('保存成功')
}).catch(res => { })
} else {
this.editing = !this.editing
@ -464,7 +465,7 @@ export default {
type: 'warning'
}).then(() => {
this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => {
util.successMsg('删除成功')
Util.successMsg('删除成功')
this.info.teamInstructors.splice(i, 1)
}).catch(res => { })
}).catch(() => { })
@ -474,7 +475,7 @@ export default {
},
//
addAdvisor () {
if (this.info.teamInstructors.length > 4) return util.errorMsg('指导老师仅限添加5个!')
if (this.info.teamInstructors.length > 4) return Util.errorMsg('指导老师仅限添加5个!')
const line = JSON.parse(JSON.stringify(this.originIns))
line.edit = 1
this.info.teamInstructors.push(line)
@ -485,9 +486,9 @@ export default {
},
//
submitAdvisor (row, i) {
if (!row.name) return util.errorMsg('请输入姓名')
if (!row.name) return Util.errorMsg('请输入姓名')
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('请输入正确手机号格式')
this.$post(this.api.addAnAdvisor, {
name: row.name,
competitionId: this.id,
@ -497,7 +498,7 @@ export default {
position: row.position,
accountId: this.accountId
}).then(({ id }) => {
util.successMsg((row.id ? '修改' : '新增') + '成功')
Util.successMsg((row.id ? '修改' : '新增') + '成功')
if (!row.id) {
this.info.teamInstructors[i].id = id
}
@ -510,13 +511,13 @@ export default {
},
//
transferSubmit () {
if (!this.checkedPlayer) return util.errorMsg('请选择成员')
if (!this.checkedPlayer) return Util.errorMsg('请选择成员')
this.$post(this.api.captainOfTransfer, {
captainId: this.info.caption.teamId,
playerId: this.checkedPlayer
}).then(res => {
this.checkedPlayer = ''
util.successMsg('转让成功')
Util.successMsg('转让成功')
this.transferVisible = false
this.getInfo()
}).catch(res => { })
@ -528,7 +529,7 @@ export default {
let start = 0
// for (const e of this.form.competitionStage) {
// if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) {
// util.errorMsg('')
// Util.errorMsg('')
// start = 1
// break
// }
@ -548,7 +549,7 @@ export default {
type: 'warning'
}).then(() => {
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => {
util.successMsg('移除成功')
Util.successMsg('移除成功')
this.getInfo()
}).catch(res => { })
}).catch(() => { })
@ -565,13 +566,14 @@ export default {
stageId: stage.stageId,
teamId: this.info.teamId
}).then(res => {
util.successMsg('移除成功')
Util.successMsg('移除成功')
this.getInfo()
}).catch(res => { })
}).catch(() => { })
},
//
selectPar (row) {
// debugger
const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) {
const { teamLimit, stages, teamDetail } = this.info
@ -593,16 +595,16 @@ export default {
this.chooses = this.info.teamDetail
}
this.curRow = row
this.checkedMembers = []
this.checkedMembers = row.participants.map(e => e.id)
this.chooseVisible = true
}
},
//
chooseSubmit () {
const accountIds = this.checkedMembers
if (!accountIds.length) return util.errorMsg('请选择参赛成员!')
if (!accountIds.length) return Util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit //
if (limit && accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
if (limit && accountIds.length > limit) return Util.errorMsg(`请选择${limit}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, {
accountIds,
competitionId: this.id,
@ -610,7 +612,7 @@ export default {
teamId: this.info.teamId
}).then(res => {
this.checkedMembers = []
util.successMsg('修改成功')
Util.successMsg('修改成功')
this.getInfo()
this.chooseVisible = false
}).catch(res => { })

@ -37,7 +37,7 @@
</div>
<div style="display: inline-flex;align-items: center">
<el-input style="margin-right: 15px"
placeholder="请输入团队名称/队长/学校"
:placeholder="'请输入' + (competitionType ? '团队名称/队长' : '学生姓名') + '/学校'"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
@ -51,8 +51,8 @@
</template>
<el-button v-if="list.length"
type="primary"
:loading="loading"
@click="exportData">{{ loading ? '正在导出' : '批量导出' }}</el-button>
:loading="exporting"
@click="exportData">{{ exporting ? '正在导出' : '批量导出' }}</el-button>
</div>
</div>
<el-table :data="list"
@ -60,6 +60,7 @@
ref="table"
stripe
row-key="scoreId"
v-loading="loading"
@selection-change="handleSelectionChange"
header-align="center">
<el-table-column type="selection"
@ -90,7 +91,11 @@
min-width="100"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学校"
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 prop="timeSum"
@ -195,8 +200,10 @@
<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">
<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>
@ -204,6 +211,8 @@
<el-upload ref="upload"
name="file"
accept=".xls,.xlsx"
class="import-file"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
@ -213,27 +222,29 @@
:action="this.api.batchImportRanking"
:file-list="uploadList"
:headers="headers"
:disabled="uploading"
:data="{
competitionId: this.id,
stageId: this.stageId,
isOverallRanking: active ? 0 : 1,
schoolId: ''
}"
:auto-upload="false">
}">
<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: -10px 0 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>
@ -307,7 +318,8 @@ export default {
importVisible: false,
uploadList: [],
uploadFaild: false,
exportCode: '',
uploading: false,
faildData: null,
curRow: {},
stageName: '',
totalScore: 0,
@ -334,6 +346,7 @@ export default {
uploaded: 0,
multipleSelection: [],
loading: false,
exporting: false,
isPointWeight: false
};
},
@ -375,6 +388,7 @@ export default {
this.list = message.records
this.total = message.total
this.getPublishTime()
this.loading = false
}).catch(res => { })
} else { //
if (!this.active) {
@ -393,6 +407,7 @@ export default {
this.list = page
this.total = total
this.getPublishTime()
this.loading = false
}).catch(res => { })
} else {
//
@ -401,17 +416,20 @@ export default {
this.list = page
this.total = total
this.getPublishTime()
this.loading = false
}).catch(res => { })
}
}
},
//
getStage () {
this.$post(this.api.detailsOfCompetitionStage, {
async getStage () {
this.loading = true
try {
const { page } = await this.$post(this.api.detailsOfCompetitionStage, {
pageNum: 1,
pageSize: 100,
contestId: this.id,
}).then(({ page }) => {
})
this.grades = page.records.slice(0, this.index + 1)
this.active = this.grades[this.index].stageId
//
@ -420,7 +438,9 @@ export default {
stageName: '总分'
})
this.getData()
}).catch(res => { });
} catch (e) {
this.loading = false
}
},
//
typeChange (val) {
@ -530,7 +550,7 @@ export default {
},
// ()
async exportData () {
this.loading = true
this.exporting = true
let { list } = this
if (this.multipleSelection.length) {
list = this.multipleSelection
@ -575,7 +595,7 @@ export default {
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
this.loading = false
this.exporting = false
}).catch(res => { })
},
//
@ -719,39 +739,47 @@ export default {
},
//
showFaild () {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.faildData.exportCode}&competitionId=${this.id}`, {
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
this.uploaded = 0
if (res.status === 200) {
const { exportCode } = res.data
if (exportCode) {
this.exportCode = exportCode
const { data } = res
if (data.exportCode) {
this.faildData = data
this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
} else {
this.uploaded = 1
this.importVisible = false
this.getRank()
util.successMsg('请检查数据后,点击发布排名以发布数据!')
util.successMsg(data.tip, 3000)
// util.successMsg('')
}
} else {
util.errorMsg(res.message || "上传失败,请检查数据")
}
},
uploadError (err, file, fileList) {
this.uploading = false
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
async beforeUpload (file) {
this.uploading = true
if (this.list.length) {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`)
}
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
@ -759,13 +787,13 @@ export default {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure () {
this.list.length ?
this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => {
this.$refs.upload.submit()
}).catch(res => { }) :
this.$refs.upload.submit()
}
cancelUpload () {
this.uploading = false
if (this.$refs.upload) this.$refs.upload.abort()
this.keyword = ''
this.getRank()
this.importVisible = false
},
}
};
</script>
@ -795,4 +823,11 @@ export default {
color: #9076ff;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -37,6 +37,7 @@
v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary"
round
:loading="exporting"
@click="exportAll"
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
<el-button type="primary"
@ -192,8 +193,7 @@
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="!schoolDisable"
prop="studentAffiliatedInstitutionId"
<el-form-item prop="studentAffiliatedInstitutionId"
label="学生所属院校">
<el-select v-model="form.studentAffiliatedInstitutionId"
filterable
@ -437,6 +437,7 @@ export default {
},
uploading: false,
isBackstage: 0,
exporting: false
};
},
watch: {
@ -559,7 +560,6 @@ export default {
} else {
util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000)
this.importVisible = false
this.keyWord = ''
}
} else {
util.errorMsg(res.message || '上传失败,请检查数据', 3000)
@ -586,7 +586,7 @@ export default {
cancelUpload () {
this.uploading = false
this.$refs.upload.abort()
this.keyWord = ''
this.keyword = ''
this.init()
this.importVisible = false
},
@ -649,14 +649,6 @@ export default {
},
//
submitForm () {
if (this.notExit) {
this.submiting = false
return util.errorMsg('学生不存在,无法添加!')
}
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
const { form } = this
if (!this.isAdd) { //
this.$post(this.api.updateUser, {
@ -724,16 +716,22 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
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 } = form
const { phone, email } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号/邮箱")
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()
}
}
@ -809,6 +807,8 @@ export default {
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)
@ -820,7 +820,10 @@ export default {
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
}).catch(res => { })
this.exporting = false
}).catch(res => {
this.exporting = false
})
} else {
axios.get(`${this.api.excelExport}?competitionId=${this.id}`, {
headers: {
@ -830,7 +833,11 @@ export default {
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
}).catch(res => { })
this.exporting = false
}).catch(res => {
this.exporting = false
})
}
}
},
//

@ -206,10 +206,13 @@
align="center"
width="120">
<template slot-scope="scope">
<!--type="number" @blur="updateProjectJudgment"-->
<el-input :disabled="isDetail"
v-model.trim="scope.row.score"
@input="scoreChange(scope.row, scope.$index)"></el-input>
:key="scope.$index"
type="number"
step="0.1"
v-model.trim="scope.row.score"></el-input>
<!--
@input="scoreChange(scope.row, scope.$index)" -->
</template>
</u-table-column>
<u-table-column label="操作"
@ -400,7 +403,7 @@ export default {
//100
let score = 0;
this.projectJudgmentData.forEach(e => {
score = Decimal(e.score).add(Decimal(score))
if (e.score && !isNaN(e.score)) score = Decimal(e.score).add(Decimal(score))
});
if (isNaN(score)) {
return 0;

Loading…
Cancel
Save