|
@@ -9,12 +9,12 @@
|
|
<div class="part-box part-box-pad">
|
|
<div class="part-box part-box-pad">
|
|
<el-table :data="dataList">
|
|
<el-table :data="dataList">
|
|
<el-table-column type="index" label="序号" width="70"></el-table-column>
|
|
<el-table-column type="index" label="序号" width="70"></el-table-column>
|
|
- <el-table-column prop="examStudentName" label="姓名"></el-table-column>
|
|
|
|
- <el-table-column prop="examNumber" label="学号"></el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="name" label="姓名"></el-table-column>
|
|
|
|
+ <el-table-column prop="studentCode" label="学号"></el-table-column>
|
|
<template v-for="(item, index) in normalScoreItems">
|
|
<template v-for="(item, index) in normalScoreItems">
|
|
<el-table-column :key="index" :label="item">
|
|
<el-table-column :key="index" :label="item">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- {{ scope.row.normalScore[index].score }}
|
|
|
|
|
|
+ {{ scope.row[item] }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</template>
|
|
</template>
|
|
@@ -48,11 +48,12 @@
|
|
ref="ImportFile"
|
|
ref="ImportFile"
|
|
title="导入平时成绩"
|
|
title="导入平时成绩"
|
|
:upload-url="uploadUrl"
|
|
:upload-url="uploadUrl"
|
|
|
|
+ :upload-data="filter"
|
|
:format="['xls', 'xlsx']"
|
|
:format="['xls', 'xlsx']"
|
|
:download-handle="downloadHandle"
|
|
:download-handle="downloadHandle"
|
|
:download-filename="dfilename"
|
|
:download-filename="dfilename"
|
|
:auto-upload="false"
|
|
:auto-upload="false"
|
|
- @upload-success="getList"
|
|
|
|
|
|
+ @upload-success="uploadSuccess"
|
|
></import-file>
|
|
></import-file>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -92,7 +93,7 @@ export default {
|
|
curRow: {},
|
|
curRow: {},
|
|
normalScoreItems: [],
|
|
normalScoreItems: [],
|
|
// import
|
|
// import
|
|
- uploadUrl: "/api/admin/course/degree/score/import",
|
|
|
|
|
|
+ uploadUrl: "/api/admin/course/degree/usual_score/import",
|
|
dfilename: "平时成绩导入模板.xlsx",
|
|
dfilename: "平时成绩导入模板.xlsx",
|
|
downloading: false,
|
|
downloading: false,
|
|
};
|
|
};
|
|
@@ -111,21 +112,21 @@ export default {
|
|
const data = await normalScoreListPage(datas);
|
|
const data = await normalScoreListPage(datas);
|
|
this.dataList = data.records.map((item) => {
|
|
this.dataList = data.records.map((item) => {
|
|
const nitem = { ...item };
|
|
const nitem = { ...item };
|
|
- if (!item.scoreNormal) {
|
|
|
|
- nitem.normalScore = [];
|
|
|
|
|
|
+ if (!item.score) {
|
|
return nitem;
|
|
return nitem;
|
|
}
|
|
}
|
|
|
|
|
|
- const { normalScore } = JSON.parse(item.scoreNormal);
|
|
|
|
- nitem.normalScore = normalScore;
|
|
|
|
|
|
+ nitem.normalScore = JSON.parse(item.score);
|
|
|
|
+ nitem.normalScore.forEach((sItem) => {
|
|
|
|
+ nitem[sItem.name] = sItem.score;
|
|
|
|
+ });
|
|
return nitem;
|
|
return nitem;
|
|
});
|
|
});
|
|
this.total = data.total;
|
|
this.total = data.total;
|
|
|
|
|
|
- const scoreNormal = this.dataList[0]?.scoreNormal;
|
|
|
|
- if (scoreNormal) {
|
|
|
|
- const { normalScore } = JSON.parse(scoreNormal);
|
|
|
|
- this.normalScoreItems = normalScore.map((item) => item.name);
|
|
|
|
|
|
+ const score = data.records[0]?.score;
|
|
|
|
+ if (score) {
|
|
|
|
+ this.normalScoreItems = JSON.parse(score).map((item) => item.name);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toPage(page) {
|
|
toPage(page) {
|
|
@@ -139,6 +140,14 @@ export default {
|
|
this.curRow = { ...row };
|
|
this.curRow = { ...row };
|
|
this.$refs.ModifyNormalScore.open();
|
|
this.$refs.ModifyNormalScore.open();
|
|
},
|
|
},
|
|
|
|
+ uploadSuccess({ data }) {
|
|
|
|
+ let msg = `${data.success}`;
|
|
|
|
+ if (data.error) {
|
|
|
|
+ msg = +`,${data.error}`;
|
|
|
|
+ }
|
|
|
|
+ this.$message.success(msg);
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
async downloadHandle() {
|
|
async downloadHandle() {
|
|
if (this.downloading) return;
|
|
if (this.downloading) return;
|
|
this.downloading = true;
|
|
this.downloading = true;
|
|
@@ -148,7 +157,6 @@ export default {
|
|
examId: this.course.examId,
|
|
examId: this.course.examId,
|
|
courseCode: this.course.courseCode,
|
|
courseCode: this.course.courseCode,
|
|
paperNumber: this.course.paperNumber,
|
|
paperNumber: this.course.paperNumber,
|
|
- paperType: this.course.paperType,
|
|
|
|
};
|
|
};
|
|
return scoreTemplateDownload(datas);
|
|
return scoreTemplateDownload(datas);
|
|
}).catch((e) => {
|
|
}).catch((e) => {
|
|
@@ -162,7 +170,7 @@ export default {
|
|
async toEnable(row) {
|
|
async toEnable(row) {
|
|
const action = row.enable ? "禁用" : "启用";
|
|
const action = row.enable ? "禁用" : "启用";
|
|
const confirm = await this.$confirm(
|
|
const confirm = await this.$confirm(
|
|
- `确定要${action}考生【${row.examStudentName}】的成绩吗?`,
|
|
|
|
|
|
+ `确定要${action}考生【${row.name}】的成绩吗?`,
|
|
"提示",
|
|
"提示",
|
|
{
|
|
{
|
|
type: "warning",
|
|
type: "warning",
|