|
@@ -630,14 +630,6 @@ export default {
|
|
);
|
|
);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- watch: {
|
|
|
|
- "examTask.examId": function (val, oldval) {
|
|
|
|
- if (val !== oldval) this.examAndRoomChange();
|
|
|
|
- },
|
|
|
|
- "examTask.teachingRoomId": function (val, oldval) {
|
|
|
|
- if (val !== oldval) this.examAndRoomChange();
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
mounted() {
|
|
mounted() {
|
|
this.initData();
|
|
this.initData();
|
|
},
|
|
},
|
|
@@ -725,9 +717,7 @@ export default {
|
|
).catch(() => {});
|
|
).catch(() => {});
|
|
if (result !== "confirm") return;
|
|
if (result !== "confirm") return;
|
|
|
|
|
|
- this.paperAttachments = [];
|
|
|
|
- this.addAtachment();
|
|
|
|
-
|
|
|
|
|
|
+ this.initPaperAttachments();
|
|
this.curTab = tab;
|
|
this.curTab = tab;
|
|
},
|
|
},
|
|
async getCardList() {
|
|
async getCardList() {
|
|
@@ -794,8 +784,12 @@ export default {
|
|
// this.clearTaskData();
|
|
// this.clearTaskData();
|
|
|
|
|
|
this.examTask.courseId = "";
|
|
this.examTask.courseId = "";
|
|
|
|
+ this.examTask.courseName = "";
|
|
this.getCourses();
|
|
this.getCourses();
|
|
- this.courseChange();
|
|
|
|
|
|
+
|
|
|
|
+ this.paperAttachments = [];
|
|
|
|
+ this.addAtachment();
|
|
|
|
+ this.examAndRoomChange();
|
|
},
|
|
},
|
|
courseChange(val) {
|
|
courseChange(val) {
|
|
if (val) {
|
|
if (val) {
|
|
@@ -805,15 +799,17 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.examTask.courseName = "";
|
|
this.examTask.courseName = "";
|
|
}
|
|
}
|
|
- this.clearTaskData();
|
|
|
|
|
|
+ this.cards = [];
|
|
|
|
+ this.getCardList();
|
|
|
|
+ this.initPaperAttachments();
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
},
|
|
},
|
|
- clearTaskData() {
|
|
|
|
|
|
+ initPaperAttachments() {
|
|
this.paperAttachments = [];
|
|
this.paperAttachments = [];
|
|
this.addAtachment();
|
|
this.addAtachment();
|
|
-
|
|
|
|
- this.cards = [];
|
|
|
|
- this.getCardList();
|
|
|
|
|
|
+ if (this.examTask.twoPaperEnable) {
|
|
|
|
+ this.addAtachment();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
updateExamTaskDetail() {
|
|
updateExamTaskDetail() {
|
|
this.paperAttachments.forEach((paperAttachment) => {
|
|
this.paperAttachments.forEach((paperAttachment) => {
|
|
@@ -847,32 +843,32 @@ export default {
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
|
|
|
|
const { examId, teachingRoomId } = this.examTask;
|
|
const { examId, teachingRoomId } = this.examTask;
|
|
- if (examId && teachingRoomId) {
|
|
|
|
- const examPrintPlan = await examConfigByExamIdOrgId({
|
|
|
|
- examId,
|
|
|
|
- orgId: teachingRoomId,
|
|
|
|
- });
|
|
|
|
- this.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
|
|
- this.examTask.review = examPrintPlan.review;
|
|
|
|
- this.examTask.includePaper =
|
|
|
|
- examPrintPlan.printContent.indexOf("PAPER") !== -1;
|
|
|
|
- this.examTask.twoPaperEnable = examPrintPlan.twoPaperEnable;
|
|
|
|
- // 如果启用二卷,且当前没有二卷,则添加二卷
|
|
|
|
- if (examPrintPlan.twoPaperEnable && !this.paperAttachments.length < 2) {
|
|
|
|
- this.addAtachment();
|
|
|
|
- }
|
|
|
|
- this.updateExamTaskDetail();
|
|
|
|
|
|
+ if (!examId || !teachingRoomId) return;
|
|
|
|
|
|
- this.updateTaskInfo({
|
|
|
|
- infoExamPrintPlan: Object.assign(
|
|
|
|
- {},
|
|
|
|
- this.infoExamPrintPlan,
|
|
|
|
- examPrintPlan
|
|
|
|
- ),
|
|
|
|
- infoExamTask: this.examTask,
|
|
|
|
- infoExamTaskDetail: this.examTaskDetail,
|
|
|
|
- });
|
|
|
|
|
|
+ const examPrintPlan = await examConfigByExamIdOrgId({
|
|
|
|
+ examId,
|
|
|
|
+ orgId: teachingRoomId,
|
|
|
|
+ });
|
|
|
|
+ this.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
|
|
+ this.examTask.review = examPrintPlan.review;
|
|
|
|
+ this.examTask.includePaper =
|
|
|
|
+ examPrintPlan.printContent.indexOf("PAPER") !== -1;
|
|
|
|
+ this.examTask.twoPaperEnable = examPrintPlan.twoPaperEnable;
|
|
|
|
+ // 如果启用二卷,且当前没有二卷,则添加二卷
|
|
|
|
+ if (examPrintPlan.twoPaperEnable && !this.paperAttachments.length < 2) {
|
|
|
|
+ this.addAtachment();
|
|
}
|
|
}
|
|
|
|
+ this.updateExamTaskDetail();
|
|
|
|
+
|
|
|
|
+ this.updateTaskInfo({
|
|
|
|
+ infoExamPrintPlan: Object.assign(
|
|
|
|
+ {},
|
|
|
|
+ this.infoExamPrintPlan,
|
|
|
|
+ examPrintPlan
|
|
|
|
+ ),
|
|
|
|
+ infoExamTask: this.examTask,
|
|
|
|
+ infoExamTaskDetail: this.examTaskDetail,
|
|
|
|
+ });
|
|
},
|
|
},
|
|
async cardChange(attachment) {
|
|
async cardChange(attachment) {
|
|
const card = this.cards.find((item) => item.id === attachment.cardId);
|
|
const card = this.cards.find((item) => item.id === attachment.cardId);
|