zhangjie пре 3 година
родитељ
комит
0eb27d3e11

+ 2 - 2
src/modules/exam/api.js

@@ -237,8 +237,8 @@ export const statisticsList = datas => {
 export const statisticsDelete = ids => {
   return $post("/api/admin/statistics/delete", { ids });
 };
-export const statisticsFreshen = () => {
-  return $postParam("/api/admin/statistics/freshen", {});
+export const statisticsFreshen = datas => {
+  return $postParam("/api/admin/statistics/freshen", datas);
 };
 // download-manage
 export const dataDownloadList = datas => {

+ 57 - 0
src/modules/exam/components/StatisticsDetailDialog.vue

@@ -0,0 +1,57 @@
+<template>
+  <el-dialog
+    class="statistics-detail-dialog"
+    :visible.sync="modalIsShow"
+    title="详情信息"
+    top="10vh"
+    width="620px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    destroy-on-close
+  >
+    <el-table ref="TableList" :data="contents">
+      <el-table-column prop="clazzName" label="班级"></el-table-column>
+      <el-table-column prop="status" label="状态">
+        <span slot-scope="scope">
+          {{ STATUS_TYPE[scope.row.status] }}
+        </span>
+      </el-table-column>
+    </el-table>
+    <div slot="footer">
+      <el-button @click="cancel">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: "statistics-detail-dialog",
+  props: {
+    contents: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      STATUS_TYPE: {
+        FINISH: "该班级命题任务已完成印刷",
+        UN_FINISH: "该班级命题任务未完成印刷",
+        EXCEPTION: "异常:包含该班级的命题任务印刷了多次"
+      }
+    };
+  },
+  methods: {
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    }
+  }
+};
+</script>

+ 54 - 11
src/modules/exam/views/StatisticsManage.vue

@@ -9,6 +9,7 @@
           <exam-select
             v-model="filter.examId"
             :semester-id="filter.semesterId"
+            @change="examChange"
           ></exam-select>
         </el-form-item>
         <el-form-item label="开课学院:">
@@ -87,6 +88,7 @@
           type="primary"
           icon="el-icon-refresh"
           :loading="loading"
+          :disabled="!filter.examId"
           @click="toFresh"
           >刷新数据</el-button
         >
@@ -102,8 +104,10 @@
           btn-content="导入"
           btn-type="success"
           :upload-url="uploadUrl"
+          :upload-data="uploadData"
           :format="['xls', 'xlsx']"
           accept=".xls,.xlsx"
+          :disabled="!filter.examId"
           @valid-error="validError"
           @upload-success="uploadSuccess"
         >
@@ -128,21 +132,31 @@
           :index="indexMethod"
         ></el-table-column>
         <el-table-column prop="collegeName" label="开课学院"></el-table-column>
-        <el-table-column
-          prop="teachingRoomName"
-          label="开课部门"
-        ></el-table-column>
+        <el-table-column prop="teachingRoom" label="开课部门"></el-table-column>
         <el-table-column prop="courseCode" label="课程代码"></el-table-column>
         <el-table-column prop="courseName" label="课程名称"></el-table-column>
-        <el-table-column prop="teacherName" label="任课老师"></el-table-column>
-        <el-table-column prop="clazzName" label="班级名称"></el-table-column>
+        <el-table-column prop="teacher" label="任课老师"></el-table-column>
+        <el-table-column prop="clazzNames" label="班级名称"></el-table-column>
         <el-table-column prop="paperNumber" label="试卷编号"></el-table-column>
         <el-table-column
-          prop="printPlanName"
+          prop="examPrintPlanName"
           label="印刷计划"
         ></el-table-column>
-        <el-table-column prop="printSum" label="总印份数"></el-table-column>
-        <el-table-column prop="statusStr" label="状态"> </el-table-column>
+        <el-table-column prop="studentCount" label="总印份数"></el-table-column>
+        <el-table-column prop="status" label="状态">
+          <span slot-scope="scope">{{ FINISH_STATUS[scope.row.status] }}</span>
+        </el-table-column>
+        <el-table-column class-name="action-column" label="操作" width="100px">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.clazzContent"
+              class="btn-primary"
+              type="text"
+              @click="toDetail(scope.row)"
+              >详情</el-button
+            ></template
+          ></el-table-column
+        >
       </el-table>
       <div class="part-page">
         <el-pagination
@@ -156,6 +170,12 @@
         </el-pagination>
       </div>
     </div>
+
+    <!-- StatisticsDetailDialog -->
+    <statistics-detail-dialog
+      :contents="curContents"
+      ref="StatisticsDetailDialog"
+    ></statistics-detail-dialog>
   </div>
 </template>
 
@@ -163,10 +183,11 @@
 import { statisticsList, statisticsDelete, statisticsFreshen } from "../api";
 import { organizationFindByTypeList } from "../../base/api";
 import UploadButton from "../../../components/UploadButton";
+import StatisticsDetailDialog from "../components/StatisticsDetailDialog.vue";
 
 export default {
   name: "exam-statistics",
-  components: { UploadButton },
+  components: { UploadButton, StatisticsDetailDialog },
   data() {
     return {
       filter: {
@@ -184,10 +205,12 @@ export default {
       total: 0,
       dataList: [],
       curRow: {},
+      curContents: [],
       teachingRooms: [],
       multipleSelection: [],
       FINISH_STATUS: { UN_FINISH: "未完成", FINISH: "已完成" },
       // import
+      uploadData: {},
       uploadUrl: "/api/admin/statistics/import",
       downloadUrl: "/temps/examStatisticsTemplate.xlsx",
       dfilename: "命题计划导入模板.xlsx"
@@ -227,6 +250,11 @@ export default {
       if (!val) return;
       this.getTeachingRooms();
     },
+    examChange() {
+      this.uploadData = {
+        examId: this.filter.examId
+      };
+    },
     handleSelectionChange(val) {
       this.multipleSelection = val.map(item => item.id);
     },
@@ -253,14 +281,29 @@ export default {
       this.toPage(this.current);
     },
     async toFresh() {
+      if (!this.filter.examId) {
+        this.$message.error("请先选择考试");
+        return;
+      }
+
       this.loading = true;
-      const data = await statisticsFreshen().catch(() => {});
+      const data = await statisticsFreshen({
+        examId: this.filter.examId
+      }).catch(() => {});
       this.loading = false;
       if (!data) return;
 
       this.$message.success("刷新成功!");
       this.toPage(1);
     },
+    toDetail(row) {
+      if (!row.clazzContent) {
+        this.$message.error("当前无详情展示");
+        return;
+      }
+      this.curContents = JSON.parse(row.clazzContent);
+      this.$refs.StatisticsDetailDialog.open();
+    },
     // import
     validError(errorData) {
       this.$message.error(errorData.message);

+ 5 - 13
src/modules/stmms/components/markParam/MarkPaperStructure.vue

@@ -325,18 +325,8 @@ export default {
         return;
       }
 
-      this.$confirm(
-        `当前试卷总分为${this.paperTotalScore}分, 确定要下一步吗?`,
-        "提示",
-        {
-          type: "warning"
-        }
-      )
-        .then(() => {
-          this.updateData();
-          this.$emit("next-step");
-        })
-        .catch(() => {});
+      this.updateData();
+      this.$emit("next-step");
     },
     getData() {
       return this.tableData.map(item => {
@@ -344,7 +334,9 @@ export default {
       });
     },
     updateData() {
-      this.$emit("data-change", { paperStructureInfo: this.getData() });
+      this.$emit("data-change", {
+        paperStructureInfo: this.getData()
+      });
     }
   }
 };

+ 53 - 9
src/modules/stmms/components/markParam/ModifyMarkParams.vue

@@ -67,6 +67,7 @@ import MarkPaperMarker from "./MarkPaperMarker.vue";
 import MarkPaperStructure from "./MarkPaperStructure.vue";
 // import paramData from "./paramData";
 import { examStructureSubmit } from "../../api";
+import { calcSum } from "@/plugins/utils";
 
 const STEPS_LIST = [
   {
@@ -98,7 +99,8 @@ export default {
       infos: {
         basicPaperInfo: {},
         paperStructureInfo: [],
-        groupInfo: []
+        groupInfo: [],
+        paperStat: {}
       },
       // step
       steps: STEPS_LIST,
@@ -138,16 +140,37 @@ export default {
           groupInfo,
           basicPaperInfo: { ...this.instance }
         };
+        this.infos.paperStat = this.statPaperStructure(
+          this.infos.paperStructureInfo
+        );
       } else {
         this.infos = {
           paperStructureInfo: [],
           groupInfo: [],
-          basicPaperInfo: { ...this.instance }
+          basicPaperInfo: { ...this.instance },
+          paperStat: this.statPaperStructure([])
         };
       }
 
       this.dataReady = true;
     },
+    statPaperStructure(paperStructureInfo) {
+      const questionCount = paperStructureInfo.length;
+
+      const subjectiveQuestionCount = paperStructureInfo.filter(
+        item => item.qType === "subjective"
+      ).length;
+
+      return {
+        questionCount,
+        paperTotalScore: calcSum(
+          paperStructureInfo.map(item => item.totalScore || 0)
+        ),
+        subjectiveQuestionCount,
+        objectiveQuestionCount: questionCount - subjectiveQuestionCount,
+        structChanged: false
+      };
+    },
     async cancel() {
       const res = await this.$confirm("确定要退出阅卷参数编辑吗?", "提示", {
         type: "warning"
@@ -189,7 +212,30 @@ export default {
       if (this.isLastStep) {
         this.submit();
       } else {
-        this.current += 1;
+        const paperStat = this.infos.paperStat;
+
+        let tipsContent = `本试卷共${paperStat.questionCount}道小题,客观题${paperStat.objectiveQuestionCount}道,主观题${paperStat.subjectiveQuestionCount}道,总分为${paperStat.paperTotalScore}分。`;
+        if (paperStat.structChanged) {
+          tipsContent += "试卷结构有变动,评卷员将被清空。";
+        }
+        if (paperStat.subjectiveQuestionCount) {
+          this.$confirm(`${tipsContent}确定要下一步吗?`, "提示", {
+            type: "warning"
+          })
+            .then(() => {
+              this.current += 1;
+            })
+            .catch(() => {});
+        } else {
+          // 没有主观题,可以直接提交,不需要设置评卷员分组
+          this.$confirm(`${tipsContent}, 是否立即提交?`, "提示", {
+            type: "warning"
+          })
+            .then(() => {
+              this.submit();
+            })
+            .catch(() => {});
+        }
       }
     },
     getPaperStructData(paperStructureInfo) {
@@ -210,6 +256,9 @@ export default {
       return originStruct;
     },
     dataChange(data) {
+      if (data.paperStructureInfo) {
+        data.paperStat = this.statPaperStructure(data.paperStructureInfo);
+      }
       if (data.paperStructureInfo && this.infos.paperStructureInfo.length) {
         // 检验试卷结构是否有变化
         const originStruct = this.getPaperStructData(
@@ -218,12 +267,7 @@ export default {
         const curStruct = this.getPaperStructData(data.paperStructureInfo);
         if (curStruct.join("") !== originStruct.join("")) {
           data.groupInfo = [];
-          this.$notify({
-            title: "警告",
-            message: "试卷结构有变动,评卷员将被清空,请重新设置!",
-            type: "warning",
-            duration: 5000
-          });
+          data.paperStat.structChanged = true;
         } else {
           // 更新分组中的试题信息
           const paperMap = {};

+ 2 - 9
src/modules/stmms/views/UploadStructure.vue

@@ -45,10 +45,7 @@
           label="试卷类型"
           width="100"
         ></el-table-column>
-        <el-table-column prop="status" label="状态" width="100">
-          <template slot-scope="scope">
-            {{ scope.row.status | markTaskSyncStatusFilter }}
-          </template>
+        <el-table-column prop="statusStr" label="状态" width="100">
         </el-table-column>
         <el-table-column class-name="action-column" label="操作" width="220px">
           <template slot-scope="scope">
@@ -69,15 +66,11 @@
               v-if="checkPrivilege('link', 'Upload')"
               class="btn-primary"
               type="text"
-              :disabled="!scope.row.paperInfoJson"
               @click="toUpload(scope.row)"
               >上传标答文件</el-button
             >
             <el-button
-              v-if="
-                checkPrivilege('link', 'Preview') &&
-                  scope.row.status === 'FINISH'
-              "
+              v-if="checkPrivilege('link', 'Preview')"
               class="btn-primary"
               type="text"
               :disabled="!scope.row.paperAnswer"