Эх сурвалжийг харах

课程目标管理试卷编码去掉

zhangjie 1 жил өмнө
parent
commit
5f7241f015

+ 4 - 0
src/modules/course/api.js

@@ -86,6 +86,10 @@ export const endScorePaperPositiveSync = (datas) => {
     datas
   );
 };
+// 成绩管理-同步选择试卷
+export const endScoreSyncPaperList = (datas) => {
+  return $postParam("/api/admin/course/degree/final_score/choose_paper", datas);
+};
 
 // 报告管理 ------------------->
 export const targetReportListPage = (datas) => {

+ 11 - 18
src/modules/course/components/EndScoreManage.vue

@@ -108,6 +108,12 @@
     ></import-file>
     <!-- SetBlueDialog -->
     <set-blue-dialog ref="SetBlueDialog" :course="course"> </set-blue-dialog>
+    <!-- select papers -->
+    <sync-paper-dialog
+      ref="SyncPaperDialog"
+      :course="filter"
+      @modified="getList"
+    ></sync-paper-dialog>
   </div>
 </template>
 
@@ -116,17 +122,17 @@ import {
   endScoreListPage,
   endScoreEnable,
   endScoreTemplateDownload,
-  endScoreSync,
 } from "../api";
 import ModifyEndScore from "./ModifyEndScore.vue";
 import SetBlueDialog from "./SetBlueDialog.vue";
 import ImportFile from "@/components/ImportFile.vue";
+import SyncPaperDialog from "./SyncPaperDialog.vue";
 import { downloadByApi } from "@/plugins/download";
 import templateDownload from "@/mixins/templateDownload";
 
 export default {
   name: "end-score-manage",
-  components: { ModifyEndScore, SetBlueDialog, ImportFile },
+  components: { ModifyEndScore, SetBlueDialog, ImportFile, SyncPaperDialog },
   mixins: [templateDownload],
   props: {
     course: {
@@ -141,7 +147,6 @@ export default {
       filter: {
         examId: "",
         courseCode: "",
-        paperNumber: "",
         teachCourseId: "",
       },
       current: 1,
@@ -200,14 +205,8 @@ export default {
     toImportPaperStruct() {
       this.$refs.ImportPaperStruct.open();
     },
-    async toSync() {
-      if (this.syncing) return;
-      this.syncing = true;
-      const res = await endScoreSync(this.filter).catch(() => {});
-      this.syncing = false;
-      if (!res) return;
-      this.$message.success("操作成功!");
-      this.getList();
+    toSync() {
+      this.$refs.SyncPaperDialog.open();
     },
     toSetBlue() {
       this.$refs.SetBlueDialog.open();
@@ -233,13 +232,7 @@ export default {
       this.downloading = true;
 
       const res = await downloadByApi(() => {
-        const datas = {
-          examId: this.course.examId,
-          courseCode: this.course.courseCode,
-          paperNumber: this.course.paperNumber,
-          teachCourseId: this.course.teachCourseId,
-        };
-        return endScoreTemplateDownload(datas);
+        return endScoreTemplateDownload(this.filter);
       }).catch((e) => {
         this.$message.error(e || "下载失败,请重新尝试!");
       });

+ 8 - 10
src/modules/course/components/NormalScoreManage.vue

@@ -9,11 +9,15 @@
     <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="name" label="姓名" width="140"></el-table-column>
+        <el-table-column
+          prop="name"
+          label="姓名"
+          minWidth="140"
+        ></el-table-column>
         <el-table-column
           prop="studentCode"
           label="学号"
-          width="140"
+          minWidth="140"
         ></el-table-column>
         <template v-for="(item, index) in normalScoreItems">
           <el-table-column :key="index" :label="item">
@@ -101,7 +105,7 @@ export default {
       filter: {
         examId: "",
         courseCode: "",
-        paperNumber: "",
+        teachCourseId: "",
       },
       current: 1,
       size: this.GLOBAL.pageSize,
@@ -167,13 +171,7 @@ export default {
       this.downloading = true;
 
       const res = await downloadByApi(() => {
-        const datas = {
-          examId: this.course.examId,
-          courseCode: this.course.courseCode,
-          paperNumber: this.course.paperNumber,
-          teachCourseId: this.course.teachCourseId,
-        };
-        return scoreTemplateDownload(datas);
+        return scoreTemplateDownload(this.filter);
       }).catch((e) => {
         this.$message.error(e || "下载失败,请重新尝试!");
       });

+ 0 - 3
src/modules/course/components/SetBlueDialog.vue

@@ -153,7 +153,6 @@ export default {
       const res = await endScorePaperPositiveDetail({
         examId: this.course.examId,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
       });
       this.dataList = res || [];
@@ -175,7 +174,6 @@ export default {
       const res = await endScorePaperPositiveSync({
         examId: this.course.examId,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
       }).catch(() => {});
       this.loading = false;
@@ -253,7 +251,6 @@ export default {
       const datas = {
         examId: this.course.examId,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
         paperStruct: this.dataList,
       };

+ 107 - 0
src/modules/course/components/SyncPaperDialog.vue

@@ -0,0 +1,107 @@
+<template>
+  <el-dialog
+    :visible.sync="modalIsShow"
+    title="同步成绩"
+    top="10vh"
+    width="500px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form ref="modalFormComp" :model="modalForm" label-width="60px">
+      <el-form-item
+        prop="paperNumber"
+        label="试卷:"
+        :rules="{
+          required: true,
+          message: '请选择试卷',
+          trigger: 'change',
+        }"
+      >
+        <el-select
+          v-model="modalForm.paperNumber"
+          placeholder="选择试卷"
+          clearable
+          class="width-full"
+        >
+          <el-option
+            v-for="paper in papers"
+            :key="paper.paperNumber"
+            :value="paper.paperNumber"
+            :label="paper.paperNumber"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { endScoreSyncPaperList, endScoreSync } from "../api";
+
+export default {
+  name: "SyncPaperDialog",
+  props: {
+    course: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: { paperNumber: "" },
+      papers: [],
+    };
+  },
+  methods: {
+    async getPapers() {
+      if (this.papers.length) return;
+      const res = await endScoreSyncPaperList(this.course);
+      this.papers = res || [];
+    },
+    visibleChange() {
+      this.getPapers();
+      this.modalForm = { paperNumber: "" };
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      const datas = {
+        examId: this.course.examId,
+        courseCode: this.course.courseCode,
+        teachCourseId: this.course.teachCourseId,
+        paperNumber: this.modalForm.paperNumber,
+      };
+      const res = await endScoreSync(datas).catch(() => {});
+      this.isSubmit = false;
+
+      if (!res) return;
+
+      this.$message.success(`${res.success},错误:${res.error}`);
+      this.$emit("modified");
+      this.cancel();
+    },
+  },
+};
+</script>

+ 0 - 4
src/modules/course/components/TargetReportDetail.vue

@@ -482,7 +482,6 @@ export default {
       const data = await targetReportDetail({
         examId: this.course.examId,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
       });
       this.buildData(data);
@@ -491,7 +490,6 @@ export default {
       const res = await targetReportChangeCheck({
         examId: this.course.examId,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
         report: true,
       });
@@ -863,7 +861,6 @@ export default {
         examId: this.course.examId,
         courseName: this.course.courseName,
         courseCode: this.course.courseCode,
-        paperNumber: this.course.paperNumber,
         teachCourseId: this.course.teachCourseId,
         ...this.courseBasicInfo,
       }).catch(() => {});
@@ -881,7 +878,6 @@ export default {
         const datas = {
           examId: this.course.examId,
           courseCode: this.course.courseCode,
-          paperNumber: this.course.paperNumber,
           teachCourseId: this.course.teachCourseId,
         };
         return exportTargetReport(datas);

+ 0 - 5
src/modules/course/views/TargetReportManage.vue

@@ -35,11 +35,6 @@
             }})
           </template>
         </el-table-column>
-        <el-table-column
-          prop="paperNumber"
-          label="试卷编码"
-          min-width="200"
-        ></el-table-column>
         <el-table-column prop="userName" label="创建人">
           <span slot-scope="scope">
             {{ scope.row.userName }}({{ scope.row.userLoginName }})

+ 0 - 1
src/modules/course/views/TargetScoreManage.vue

@@ -35,7 +35,6 @@
             }})
           </template>
         </el-table-column>
-        <el-table-column prop="paperNumber" label="试卷编码"></el-table-column>
         <el-table-column prop="userName" label="创建人">
           <span slot-scope="scope">
             {{ scope.row.userName }}({{ scope.row.userLoginName }})