|
@@ -69,13 +69,46 @@
|
|
|
ref="ImportFile"
|
|
|
title="导入平时成绩"
|
|
|
:upload-url="uploadUrl"
|
|
|
- :upload-data="filter"
|
|
|
+ :upload-data="uploadData"
|
|
|
:format="['xls', 'xlsx']"
|
|
|
:download-handle="downloadHandle"
|
|
|
:download-filename="dfilename"
|
|
|
:auto-upload="false"
|
|
|
+ :before-submit-handle="beforeSubmitHandle"
|
|
|
@upload-success="uploadSuccess"
|
|
|
- ></import-file>
|
|
|
+ >
|
|
|
+ <div class="mt-1" slot="bodyfoot">
|
|
|
+ <el-table :data="evaluationList" border>
|
|
|
+ <el-table-column prop="name" label="评价方式"></el-table-column>
|
|
|
+ <el-table-column prop="value" label="评价方式满分" width="140px">
|
|
|
+ <template slot="header">
|
|
|
+ <span>评价方式满分</span>
|
|
|
+ <el-tooltip effect="dark" placement="top">
|
|
|
+ <div slot="content" class="tooltip-area">
|
|
|
+ <p>帮助说明</p>
|
|
|
+ <p>
|
|
|
+ 1.系统会根据填写满分自动转换成100分下得分,如该学生在该评价方式下得分8分,满分10分,导入后该学生在该评价方式下转换后的得分为80分;
|
|
|
+ </p>
|
|
|
+ <p>2.如果不填写满分,默认满分为100分。</p>
|
|
|
+ </div>
|
|
|
+ <i class="el-icon-info ml-1 tooltip-info-icon"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.row.value"
|
|
|
+ :min="1"
|
|
|
+ :max="999"
|
|
|
+ :step="1"
|
|
|
+ step-strictly
|
|
|
+ :controls="false"
|
|
|
+ style="width: 100px"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </import-file>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -84,6 +117,7 @@ import {
|
|
|
normalScoreListPage,
|
|
|
normalScoreEnable,
|
|
|
scoreTemplateDownload,
|
|
|
+ courseEvaluationList,
|
|
|
} from "../../api";
|
|
|
import ModifyNormalScore from "./ModifyNormalScore.vue";
|
|
|
import ImportFile from "@/components/ImportFile.vue";
|
|
@@ -112,7 +146,9 @@ export default {
|
|
|
dataList: [],
|
|
|
curRow: {},
|
|
|
normalScoreItems: [],
|
|
|
+ evaluationList: [],
|
|
|
// import
|
|
|
+ uploadData: {},
|
|
|
uploadUrl: "/api/admin/course/degree/usual_score/import",
|
|
|
dfilename: "平时成绩导入模板.xlsx",
|
|
|
downloading: false,
|
|
@@ -120,9 +156,19 @@ export default {
|
|
|
},
|
|
|
async mounted() {
|
|
|
this.filter = this.$objAssign(this.filter, this.course);
|
|
|
+ // this.getEvaluation();
|
|
|
await this.toPage(1);
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getEvaluation() {
|
|
|
+ const res = await courseEvaluationList(this.filter);
|
|
|
+ this.evaluationList = (res || []).map((item) => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ value: undefined,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
async getList() {
|
|
|
const datas = {
|
|
|
...this.filter,
|
|
@@ -154,12 +200,27 @@ export default {
|
|
|
await this.getList();
|
|
|
},
|
|
|
toImport() {
|
|
|
+ this.evaluationList.forEach((item) => {
|
|
|
+ item.value = undefined;
|
|
|
+ });
|
|
|
this.$refs.ImportFile.open();
|
|
|
},
|
|
|
toEdit(row) {
|
|
|
this.curRow = { ...row, ...this.filter };
|
|
|
this.$refs.ModifyNormalScore.open();
|
|
|
},
|
|
|
+ beforeSubmitHandle() {
|
|
|
+ const valid = !this.evaluationList.some((item) => !item.value);
|
|
|
+ if (!valid) {
|
|
|
+ this.$message.error("请完成评价方式满分设置!");
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+
|
|
|
+ this.uploadData = {
|
|
|
+ ...this.filter,
|
|
|
+ usualScoreList: JSON.stringify(this.evaluationList),
|
|
|
+ };
|
|
|
+ },
|
|
|
uploadSuccess({ data }) {
|
|
|
const msg = `${data.success},错误:${data.error}`;
|
|
|
this.$message.success(msg);
|