Sfoglia il codice sorgente

阅卷工作可选多个考试

xiatian 5 anni fa
parent
commit
8ed642f15c

+ 11 - 10
src/modules/examwork/view/notice.vue

@@ -446,20 +446,21 @@
               >
                 <el-table-column type="selection" width="55"></el-table-column>
                 <!-- <el-table-column label="考试id" prop="id"></el-table-column> -->
-                <el-table-column
-                  label="考试名称"
-                  prop="examName"
-                ></el-table-column>
                 <el-table-column
                   label="评卷工作名称"
                   prop="name"
                 ></el-table-column>
-                <el-table-column width="130" label="考试类型" sortable>
-                  <template slot-scope="scope">
-                    <div>
-                      <span>{{ getExamType(scope.row.examType) }}</span>
-                    </div>
-                  </template>
+                <el-table-column label="考试名称-类型" width="300">
+                  <template slot-scope="scope"
+                    ><div>
+                      <span
+                        style="display: block;"
+                        v-for="item in scope.row.examNameAndType"
+                        :key="item.index"
+                        >{{ item }}</span
+                      >
+                    </div></template
+                  >
                 </el-table-column>
               </el-table>
               <div class="page pull-right">

+ 5 - 6
src/modules/marking/routes/routes.js

@@ -28,8 +28,7 @@ export default [
         component: MarkWorkOverview
       },
       {
-        path:
-          "course_detail/:workId/:examId/:markWorkName/:courseCode/:courseName", //课程详情
+        path: "course_detail/:workId/:markWorkName/:courseCode/:courseName", //课程详情
         component: CourseDetail
       },
       {
@@ -42,11 +41,11 @@ export default [
         component: MarkerDetail
       },
       {
-        path: "mark_setting_main/:workId/:examId/:name", //评卷设置主页面
+        path: "mark_setting_main/:workId/:name", //评卷设置主页面
         component: MarkSettingMain
       },
       {
-        path: "mark_setting_fast/:workId/:examId/:name/:courseCode/:courseName", //评卷快速设置主页面
+        path: "mark_setting_fast/:workId/:name/:courseCode/:courseName", //评卷快速设置主页面
         component: MarkSettingFast
       },
       {
@@ -65,13 +64,13 @@ export default [
         component: MarkSettingWork
       },
       {
-        path: "view_paper/:workId/:examId/:studentPaperId/:examType", //查看原卷
+        path: "view_paper/:workId/:studentPaperId", //查看原卷
         component: ViewPaper
       }
     ]
   },
   {
-    path: "/marking/:workId/:examType", //试卷正评
+    path: "/marking/:workId", //试卷正评
     component: Marking
   },
   { path: "*", redirect: "/login" }

+ 0 - 8
src/modules/marking/views/CourseDetail.vue

@@ -130,7 +130,6 @@ export default {
       total: 10,
       loading: true,
       workId: "",
-      examId: "",
       courseCode: ""
     };
   },
@@ -168,8 +167,6 @@ export default {
             this.pageSize +
             "?workId=" +
             this.workId +
-            "&examId=" +
-            this.examId +
             "&courseCode=" +
             this.courseCode
         )
@@ -191,8 +188,6 @@ export default {
             this.pageSize +
             "?workId=" +
             this.workId +
-            "&examId=" +
-            this.examId +
             "&courseCode=" +
             this.courseCode,
           { params: this.formSearch }
@@ -208,8 +203,6 @@ export default {
       window.location.href =
         "/api/ecs_data_process/markTasks/exportMarker?workId=" +
         this.workId +
-        "&examId=" +
-        this.examId +
         "&courseCode=" +
         this.courseCode;
     },
@@ -225,7 +218,6 @@ export default {
   },
   created() {
     this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
     this.courseCode = this.$route.params.courseCode;
     this.initSetting();
   }

+ 3 - 26
src/modules/marking/views/MarkPaperCheck.vue

@@ -274,7 +274,6 @@ export default {
         courseCode: "",
         userId: "",
         workId: "",
-        examType: "",
         markRemark: "",
         examRecordDataId: "",
         identityNumber: ""
@@ -288,10 +287,8 @@ export default {
       pageSize: 10,
       total: 0,
       paginationShow: false,
-      examId: "",
       tags: [],
       loading: false,
-      examType: "",
       getOrgsSearchLoading: false,
       markWorkList: []
     };
@@ -303,8 +300,7 @@ export default {
       for (let markWork of this.markWorkList) {
         markWorkNames.push({
           workId: markWork.id,
-          markName: markWork.name,
-          examId: markWork.examId
+          markName: markWork.name
         });
       }
       return markWorkNames;
@@ -323,15 +319,6 @@ export default {
       if (this.$route.query) {
         this.$router.push({ path: "/marking/mark_paper_check" });
       }
-      let obj = {};
-      for (let item of this.markWorkList) {
-        if (item.id === this.formSearch.workId) {
-          obj = item;
-          break;
-        }
-      }
-      this.examId = obj.examId;
-      this.examType = obj.examType;
       this.getCourses();
       this.formSearch = Object.assign(this.formSearch, {
         orgCode: "",
@@ -340,7 +327,6 @@ export default {
         tag: "",
         courseCode: "",
         userId: "",
-        examType: "",
         markRemark: "",
         examRecordDataId: "",
         identityNumber: ""
@@ -448,7 +434,6 @@ export default {
         (this.currentPage - 1) +
         "/" +
         this.pageSize;
-      this.formSearch.examType = this.examType;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.list;
         this.total = response.data.total;
@@ -464,8 +449,6 @@ export default {
             courseCode: this.formSearch.courseCode,
             userId: this.formSearch.userId,
             markRemark: this.formSearch.markRemark,
-            examId: this.examId,
-            examType: this.examType,
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             examRecordDataId: this.formSearch.examRecordDataId,
@@ -505,17 +488,13 @@ export default {
     },
     //查看原卷
     viewPaper(row) {
-      if (this.examType != "OFFLINE") {
+      if (row.examType != "OFFLINE") {
         var studentPaperId = row.studentPaper.id;
         var urls =
           "/marking/view_paper/" +
           this.formSearch.workId +
           "/" +
-          this.examId +
-          "/" +
-          studentPaperId +
-          "/" +
-          this.examType;
+          studentPaperId;
         this.$router.push({
           path: urls
         });
@@ -546,8 +525,6 @@ export default {
         this.formSearch.tag = formData.tag;
         this.formSearch.examRecordDataId = formData.examRecordDataId;
         this.formSearch.identityNumber = formData.identityNumber;
-        this.examId = formData.examId;
-        this.examType = formData.examType;
         this.currentPage = parseInt(formData.currentPage);
         this.pageSize = parseInt(formData.pageSize);
         this.getCourses();

+ 0 - 5
src/modules/marking/views/MarkSettingFast.vue

@@ -117,7 +117,6 @@ export default {
       pageSize: 10,
       loading: true,
       workId: "",
-      examId: "",
       examName: "",
       courseCode: "",
       markTasks: {
@@ -152,7 +151,6 @@ export default {
         this.markTasks = {
           workId: this.workId,
           userIds: this.selectedIds,
-          examId: this.examId,
           courseCode: this.courseCode
         };
         this.loading = true;
@@ -277,8 +275,6 @@ export default {
           "/marking/mark_setting_main/" +
           this.$route.params.workId +
           "/" +
-          this.$route.params.examId +
-          "/" +
           this.$route.params.name
       });
     },
@@ -337,7 +333,6 @@ export default {
   },
   created() {
     this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
     this.examName = this.$route.params.name;
     this.courseCode = this.$route.params.courseCode;
     this.initMarker();

+ 0 - 6
src/modules/marking/views/MarkSettingMain.vue

@@ -274,8 +274,6 @@ export default {
       total: 10,
       loading: true,
       workId: "",
-      examId: "",
-      examName: "",
       markTasks: {
         workId: "",
         userId: [],
@@ -361,8 +359,6 @@ export default {
         "/marking/mark_setting_fast/" +
         this.$route.params.workId +
         "/" +
-        this.$route.params.examId +
-        "/" +
         this.$route.params.name +
         "/" +
         row.code +
@@ -577,8 +573,6 @@ export default {
   },
   created() {
     this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
-    this.examName = this.$route.params.name;
     this.uploadData.workId = this.workId;
     this.uploadHeaders = {
       key: this.user.key,

+ 8 - 17
src/modules/marking/views/MarkSettingWork.vue

@@ -28,12 +28,15 @@
           >
             <el-table-column label="评卷工作名称" width="250" prop="name">
             </el-table-column>
-            <el-table-column label="考试批次" width="250" prop="examName">
-            </el-table-column>
-            <el-table-column label="考试类型" width="100">
+            <el-table-column label="考试名称-类型" width="300">
               <template slot-scope="scope">
                 <div>
-                  <span>{{ scope.row.examType | examTypeFilter }}</span>
+                  <span
+                    style="display: block;"
+                    v-for="item in scope.row.examNameAndType"
+                    :key="item.index"
+                    >{{ item }}</span
+                  >
                 </div>
               </template>
             </el-table-column>
@@ -152,22 +155,10 @@ export default {
       console.log(tempData);
       this.tableData = tempData;
     },
-    settingMarkWork(row) {
-      var url =
-        "/marking/mark_setting_main/" +
-        row.id +
-        "/" +
-        row.examId +
-        "/" +
-        row.name;
-      this.$router.push({
-        path: url
-      });
-    },
     marking(row) {
       var userId = this.user.userId;
       var self = this;
-      var url = "/marking/" + row.id + "/" + row.examType;
+      var url = "/marking/" + row.id;
       self.$http
         .get(
           MARKING_API +

+ 54 - 63
src/modules/marking/views/MarkWork.vue

@@ -45,17 +45,15 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="考试批次" width="200">
+            <el-table-column label="考试名称-类型" width="300">
               <template slot-scope="scope">
                 <div>
-                  <span>{{ scope.row.examName }}</span>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="考试类型" width="100">
-              <template slot-scope="scope">
-                <div>
-                  <span>{{ scope.row.examType | examTypeFilter }}</span>
+                  <span
+                    style="display: block;"
+                    v-for="item in scope.row.examNameAndType"
+                    :key="item.index"
+                    >{{ item }}</span
+                  >
                 </div>
               </template>
             </el-table-column>
@@ -207,12 +205,12 @@
                   style="width: 200px"
                 ></el-input>
               </el-form-item>
-              <el-form-item label="考试批次" prop="examId">
+              <el-form-item label="考试批次" prop="examIds">
                 <el-select
-                  v-if="!examDisabled"
-                  @change="update"
-                  v-model="formMarkWork.examId"
+                  :disabled="examDisabled"
+                  v-model="formMarkWork.examIds"
                   filterable
+                  multiple
                   placeholder="考试批次"
                   style="width: 200px"
                 >
@@ -223,11 +221,6 @@
                     :key="item.value"
                   ></el-option>
                 </el-select>
-                <el-input
-                  v-if="examDisabled"
-                  :disabled="true"
-                  v-model="formMarkWork.examName"
-                ></el-input>
               </el-form-item>
               <el-form-item label="备注" prop="remark">
                 <el-input
@@ -267,13 +260,18 @@ export default {
       },
       formMarkWork: {
         name: "",
-        examId: "",
+        examIds: [],
         remark: ""
       },
       rules: {
         name: [{ required: true, message: "请输入名称", trigger: "blur" }],
-        examId: [
-          { required: true, message: "请选择考试批次", trigger: "blur,change" }
+        examIds: [
+          {
+            required: true,
+            message: "请选择考试批次",
+            trigger: "blur,change",
+            type: "array"
+          }
         ]
       },
       statusList: [
@@ -314,8 +312,6 @@ export default {
         "/marking/mark_setting_main/" +
         row.id +
         "/" +
-        row.examId +
-        "/" +
         encodeURIComponent(row.name);
       this.$router.push({
         path: url
@@ -362,20 +358,23 @@ export default {
     },
     getExamSelect() {
       var orgId = this.user.rootOrgId;
+      var examIds = this.formMarkWork.examIds;
       var tempSelect = [];
       //this.loading = true;
-      this.$http
-        .get(DATA_PROCESS_API + "/exam/all?orgId=" + orgId)
-        .then(response => {
-          response.data.forEach((element, index) => {
-            tempSelect[index] = {
-              value: element.id.toString(),
-              label: element.name
-            };
-          });
-          this.examSelect = tempSelect;
-          //this.loading = false;
+      var params = "?orgId=" + orgId;
+      if (examIds) {
+        params = params + "&examIds=" + examIds;
+      }
+      this.$http.get(DATA_PROCESS_API + "/exam/all" + params).then(response => {
+        response.data.forEach((element, index) => {
+          tempSelect[index] = {
+            value: element.id,
+            label: element.name
+          };
         });
+        this.examSelect = tempSelect;
+        //this.loading = false;
+      });
     },
     initMarkWorkData() {
       var orgId = this.user.rootOrgId;
@@ -458,29 +457,27 @@ export default {
     closeModal() {
       console.log("close");
     },
-    initModal() {
-      this.formMarkWork = { name: "", examId: "", remark: "" };
+    addMarkWorkModal() {
+      this.formMarkWork = { name: "", remark: "" };
       this.markWorkId = "";
       this.examDisabled = false;
-      this.markWorkDialog = true;
-      this.getExamSelect();
-    },
-    addMarkWorkModal() {
-      this.initModal();
       this.examTitle = "新增评卷工作";
       this.oldWorkName = "";
       if (this.$refs["formMarkWork"] !== undefined) {
         this.$refs["formMarkWork"].resetFields();
       }
+      this.getExamSelect();
+      this.markWorkDialog = true;
     },
     editMarkWorkModal(row) {
-      this.initModal();
       this.examTitle = "编辑评卷工作";
       this.formMarkWork = Object.assign({}, row);
       this.oldWorkName = this.formMarkWork.name;
       this.markWorkId = row.id;
-      this.examDisabled = true;
+      this.getExamSelect();
       this.loading = false;
+      this.examDisabled = true;
+      this.markWorkDialog = true;
     },
     delMarkWork(row) {
       if (Number.parseInt(row.status) == 0) {
@@ -578,22 +575,20 @@ export default {
         type: "warning"
       }).then(() => {
         this.loading = true;
-        this.$http
-          .post(DATA_PROCESS_API + "/markWorks/" + row.examId + "/publish")
-          .then(
-            () => {
-              this.$notify({
-                message: "成绩发布成功",
-                type: "success"
-              });
-            },
-            () => {
-              this.$notify({
-                message: "成绩发布失败",
-                type: "error"
-              });
-            }
-          );
+        this.$http.post(MARKING_API + "/markWorks/" + row.id + "/publish").then(
+          () => {
+            this.$notify({
+              message: "成绩发布成功",
+              type: "success"
+            });
+          },
+          () => {
+            this.$notify({
+              message: "成绩发布失败",
+              type: "error"
+            });
+          }
+        );
         this.initMarkWorkData();
         this.loading = false;
       });
@@ -692,7 +687,6 @@ export default {
         //新增
         this.formMarkWork = Object.assign(this.formMarkWork, {
           remark: "",
-          examId: "",
           examName: "",
           name: ""
         });
@@ -709,9 +703,6 @@ export default {
       this.pageSize = val;
       this.filterMarkWork();
       this.paging();
-    },
-    update(selected) {
-      this.formMarkWork.examId = selected;
     }
   },
   created() {

+ 1 - 9
src/modules/marking/views/MarkWorkOverview.vue

@@ -174,7 +174,6 @@ export default {
       total: 10,
       loading: false,
       workId: "",
-      examId: "",
       markWorkName: "",
       courseList: [],
       markWorkList: [],
@@ -404,7 +403,6 @@ export default {
       }
       this.quertTemp["markId"] = this.markWorkSearchForm.markId;
       this.quertTemp["courseCode"] = this.formSearch.courseCode;
-      this.quertTemp["examId"] = this.examId;
       this.quertTemp["markWorkName"] = this.markWorkName;
       this.quertTemp["currentPage"] = this.currentPage;
       this.quertTemp["pageSize"] = this.pageSize;
@@ -439,8 +437,6 @@ export default {
         "/marking/course_detail/" +
         this.workId +
         "/" +
-        this.examId +
-        "/" +
         encodeURIComponent(this.markWorkName) +
         "/" +
         row.code +
@@ -567,7 +563,6 @@ export default {
             break;
           }
         }
-        this.examId = obj.examId;
         this.markWorkName = obj.name;
         this.workId = this.markWorkSearchForm.markId;
         this.doPie();
@@ -582,8 +577,6 @@ export default {
         this.markWorkSearchForm.markId = parseInt(formData.markId);
         this.formSearch.courseCode = formData.courseCode;
         this.currentPage = parseInt(formData.currentPage);
-        this.pageSize = parseInt(formData.pageSize);
-        this.examId = parseInt(formData.examId);
         this.markWorkName = formData.markWorkName;
         this.doPie();
         this.getCourses();
@@ -606,8 +599,7 @@ export default {
       for (let markWork of this.markWorkList) {
         markWorkNames.push({
           markId: markWork.id,
-          markName: markWork.name,
-          examId: markWork.examId
+          markName: markWork.name
         });
       }
       return markWorkNames;

+ 1 - 2
src/modules/marking/views/Marker.vue

@@ -294,8 +294,7 @@ export default {
       for (let markWork of this.markWorkList) {
         markWorkNames.push({
           workId: markWork.id,
-          markName: markWork.name,
-          examId: markWork.examId
+          markName: markWork.name
         });
       }
       return markWorkNames;

+ 4 - 15
src/modules/marking/views/Marking.vue

@@ -407,7 +407,6 @@ export default {
       console.log("markInit");
       var self = this;
       this.workId = this.$route.params.workId;
-      this.examType = this.$route.params.examType;
       var userId = this.user.userId;
       await self.$http
         .get(
@@ -498,13 +497,7 @@ export default {
       console.log("getPaper");
       var self = this;
       await self.$http
-        .get(
-          DATA_PROCESS_API +
-            "/studentPapers?markTaskId=" +
-            self.task.id +
-            "&examType=" +
-            self.examType
-        )
+        .get(DATA_PROCESS_API + "/studentPapers?markTaskId=" + self.task.id)
         .then(response => {
           if (!response.data) {
             self.$notify({
@@ -517,6 +510,7 @@ export default {
             return false;
           } else {
             self.studentPaper = response.data;
+            self.examType = response.data.examType;
             self.paperMark = true;
             console.log("paper", self.studentPaper);
           }
@@ -546,15 +540,10 @@ export default {
     async getMarkedPaper(studentPaperId) {
       var self = this;
       await self.$http
-        .get(
-          DATA_PROCESS_API +
-            "/studentPapers/" +
-            studentPaperId +
-            "/" +
-            this.examType
-        )
+        .get(DATA_PROCESS_API + "/studentPapers/" + studentPaperId)
         .then(response => {
           self.studentPaper = response.data;
+          self.examType = response.data.examType;
         });
     },
     async getMarkedResultItems(markResultId) {

+ 1 - 9
src/modules/marking/views/ViewPaper.vue

@@ -25,9 +25,7 @@ export default {
   data() {
     return {
       workId: "",
-      examId: "",
       studentPaperId: "",
-      examType: "",
       html: "",
       picModelKey: Math.random(),
       picModel: false,
@@ -79,11 +77,7 @@ export default {
     },
     getStudentPaper() {
       var url =
-        DATA_PROCESS_API +
-        "/studentPapers/check/" +
-        this.studentPaperId +
-        "/" +
-        this.examType;
+        DATA_PROCESS_API + "/studentPapers/check/" + this.studentPaperId;
       this.$http.get(url).then(response => {
         console.log(response);
         this.html = response.data.studentSubjectiveHtml;
@@ -92,9 +86,7 @@ export default {
   },
   created() {
     this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
     this.studentPaperId = this.$route.params.studentPaperId;
-    this.examType = this.$route.params.examType;
     this.getStudentPaper();
   },
   mounted() {