|
@@ -0,0 +1,137 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="normal-score-manage">
|
|
|
|
+ <div class="part-box part-box-pad box-justify">
|
|
|
|
+ <p>请根据权重管理里权重项导入相应的平时成绩</p>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="success" @click="toImport">导入平时成绩</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
|
+ <el-table :data="dataList">
|
|
|
|
+ <el-table-column type="index" label="序号" width="70"></el-table-column>
|
|
|
|
+ <el-table-column prop="targetName" label="姓名"></el-table-column>
|
|
|
|
+ <el-table-column prop="targetName" label="学号"></el-table-column>
|
|
|
|
+ <el-table-column prop="targetValue" label="毕业要求指标">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column class-name="action-column" label="操作" width="120px">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ :class="scope.row.enable ? 'btn-danger' : 'btn-primary'"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toEnable(scope.row)"
|
|
|
|
+ >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- ModifyNormalScore -->
|
|
|
|
+ <modify-normal-score
|
|
|
|
+ ref="ModifyNormalScore"
|
|
|
|
+ :instance="curRow"
|
|
|
|
+ @modified="getList"
|
|
|
|
+ ></modify-normal-score>
|
|
|
|
+ <!-- ImportFile -->
|
|
|
|
+ <import-file
|
|
|
|
+ ref="ImportFile"
|
|
|
|
+ title="导入平时成绩"
|
|
|
|
+ :upload-url="uploadUrl"
|
|
|
|
+ :format="['xls', 'xlsx']"
|
|
|
|
+ :download-handle="() => downloadTemplate('normalScore')"
|
|
|
|
+ :download-filename="dfilename"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ @upload-success="getList"
|
|
|
|
+ ></import-file>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { normalScoreListPage, normalScoreEnable } from "../api";
|
|
|
|
+import ModifyNormalScore from "./ModifyNormalScore.vue";
|
|
|
|
+import ImportFile from "@/components/ImportFile.vue";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "normal-score-manage",
|
|
|
|
+ components: { ModifyNormalScore, ImportFile },
|
|
|
|
+ props: {
|
|
|
|
+ course: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default() {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ filter: {
|
|
|
|
+ examId: "",
|
|
|
|
+ courseCode: "",
|
|
|
|
+ paperNumber: "",
|
|
|
|
+ },
|
|
|
|
+ current: 1,
|
|
|
|
+ size: this.GLOBAL.pageSize,
|
|
|
|
+ total: 0,
|
|
|
|
+ dataList: [],
|
|
|
|
+ curRow: {},
|
|
|
|
+ // import
|
|
|
|
+ uploadUrl: "/api/admin/course/degree/score/import",
|
|
|
|
+ dfilename: "平时成绩导入模板.xlsx",
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.filter = this.$objAssign(this.filter, this.course);
|
|
|
|
+ // this.toPage(1);
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async getList() {
|
|
|
|
+ const datas = {
|
|
|
|
+ ...this.filter,
|
|
|
|
+ pageNumber: this.current,
|
|
|
|
+ pageSize: this.size,
|
|
|
|
+ };
|
|
|
|
+ const data = await normalScoreListPage(datas);
|
|
|
|
+ this.dataList = data.records;
|
|
|
|
+ this.total = data.total;
|
|
|
|
+ },
|
|
|
|
+ toPage(page) {
|
|
|
|
+ this.current = page;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ toImport() {
|
|
|
|
+ // TODO:
|
|
|
|
+ this.$refs.ImportFile.open();
|
|
|
|
+ },
|
|
|
|
+ toEdit(row) {
|
|
|
|
+ this.curRow = { ...row };
|
|
|
|
+ this.$refs.ModifyNormalScore.open();
|
|
|
|
+ // TODO:
|
|
|
|
+ },
|
|
|
|
+ async toEnable(row) {
|
|
|
|
+ const action = row.enable ? "禁用" : "启用";
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `确定要${action}考生【${row.examStudentName}】的成绩吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const enable = !row.enable;
|
|
|
|
+ await normalScoreEnable({
|
|
|
|
+ id: row.id,
|
|
|
|
+ enable,
|
|
|
|
+ });
|
|
|
|
+ row.enable = enable;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|