zhangjie 2 лет назад
Родитель
Сommit
d52e3562e8

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

@@ -14,6 +14,6 @@ export const saveCard = (datas, config = {}) => {
     return $post("/api/admin/exam/card/save", datas, config);
   }
 };
-export const copyCard = cardId => {
-  return $postParam("/api/admin/exam/card/copy", { id: cardId });
+export const copyCard = (cardId, courseCode) => {
+  return $postParam("/api/admin/exam/card/copy", { id: cardId, courseCode });
 };

+ 5 - 2
src/modules/exam/components/ApplyContent.vue

@@ -892,13 +892,16 @@ export default {
     },
     async toCopyCard(attachment) {
       this.curAttachment = { ...attachment };
-      const newCardId = await copyCard(attachment.cardId);
+      const newCardId = await copyCard(
+        attachment.cardId,
+        this.curTaskApply.courseCode
+      );
       this.cardModified(newCardId);
     },
     toEditCard(attachment) {
       this.curAttachment = { ...attachment };
       this.$ls.set("prepareTcPCard", {
-        cardId: attachment.cardId,
+        id: attachment.cardId,
         examTaskId: this.curTaskApply.examTaskId,
         courseCode: this.curTaskApply.courseCode,
         courseName: this.curTaskApply.courseName,

+ 5 - 2
src/modules/exam/components/ModifyTaskPaper.vue

@@ -432,13 +432,16 @@ export default {
     },
     async toCopyCard(attachment) {
       this.curAttachment = { ...attachment };
-      const newCardId = await copyCard(attachment.cardId);
+      const newCardId = await copyCard(
+        attachment.cardId,
+        this.curTaskApply.courseCode
+      );
       this.cardModified(newCardId);
     },
     toEditCard(attachment) {
       this.curAttachment = { ...attachment };
       this.$ls.set("prepareTcPCard", {
-        cardId: attachment.cardId,
+        id: attachment.cardId,
         examTaskId: this.curTaskApply.examTaskId,
         courseCode: this.curTaskApply.courseCode,
         courseName: this.curTaskApply.courseName,

+ 0 - 1
src/modules/exam/components/createExamAndPrintTask/CreateExamAndPrintTask.vue

@@ -105,7 +105,6 @@ const initExamTask = {
   semesterId: "",
   examId: "",
   examModel: "",
-  courseId: "",
   courseCode: "",
   courseName: "",
   paperNumber: "",

+ 4 - 3
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -453,10 +453,8 @@ export default {
       if (val) {
         const course = this.courses.find(item => item.code === val);
         this.examTask.courseName = course.name;
-        this.examTask.courseId = course.id;
       } else {
         this.examTask.courseName = "";
-        this.examTask.courseId = "";
       }
       this.paperAttachments.forEach(item => {
         item.cardId = "";
@@ -540,7 +538,10 @@ export default {
     },
     async toCopyCard(attachment) {
       this.curAttachment = { ...attachment };
-      const newCardId = await copyCard(attachment.cardId);
+      const newCardId = await copyCard(
+        attachment.cardId,
+        this.examTask.courseCode
+      );
       this.cardModified(newCardId);
     },
     async cardModified(cardId) {

+ 2 - 2
src/modules/exam/components/createExamAndPrintTask/InfoPrintTask.vue

@@ -218,7 +218,7 @@
     <modify-exam-student
       ref="ModifyExamStudent"
       :disabled-ids="disabledStudentIds"
-      :course-id="infoExamTask.courseId"
+      :course-code="infoExamTask.courseCode"
       @modified="examStudentModified"
     ></modify-exam-student>
     <!-- PreviewTaskStudent -->
@@ -459,7 +459,7 @@ export default {
       }
     },
     toAdd() {
-      if (!this.infoExamTask.courseId) {
+      if (!this.infoExamTask.courseCode) {
         this.$message.error("请先选择课程");
         return;
       }

+ 5 - 5
src/modules/exam/components/createExamAndPrintTask/ModifyExamStudent.vue

@@ -88,7 +88,7 @@ export default {
         return [];
       }
     },
-    courseId: {
+    courseCode: {
       type: String,
       default: ""
     }
@@ -98,7 +98,7 @@ export default {
     return {
       modalIsShow: false,
       examObjectType: "TEACH_CLAZZ_STUDENT",
-      basicCourseId: null,
+      basicCourseCode: null,
       EXAM_OBJECT_TYPE,
       dataTree: {
         TEACH_CLAZZ_STUDENT: [],
@@ -120,7 +120,7 @@ export default {
         examObjectType: examObjectType || this.examObjectType
       };
       if (datas.examObjectType === "TEACH_CLAZZ_STUDENT")
-        datas.basicCourseId = this.courseId;
+        datas.courseCode = this.courseCode;
       const data = await uploadOrFindExamTaskStudent(datas);
       this.dataTree[datas.examObjectType] = this.parseStudentData(data);
     },
@@ -206,8 +206,8 @@ export default {
       this.checkChange();
     },
     async visibleChange() {
-      if (this.basicCourseId !== this.courseId) {
-        this.basicCourseId = this.courseId;
+      if (this.basicCourseCode !== this.courseCode) {
+        this.basicCourseCode = this.courseCode;
         await this.getStudents("TEACH_CLAZZ_STUDENT");
       }