|
@@ -93,10 +93,6 @@ const initExamTaskDetail = {
|
|
|
};
|
|
|
|
|
|
const initPrintPlan = {
|
|
|
- name: "",
|
|
|
- examStartTime: "",
|
|
|
- examEndTime: "",
|
|
|
- semesterId: "",
|
|
|
printContent: [],
|
|
|
backupMethod: "ROOM",
|
|
|
backupCount: 1,
|
|
@@ -178,7 +174,8 @@ export default {
|
|
|
this.infos = {
|
|
|
examTask: { ...initExamTask },
|
|
|
examTaskDetail,
|
|
|
- printTask: { ...initPrintTask }
|
|
|
+ printTask: { ...initPrintTask },
|
|
|
+ examPrintPlan: {}
|
|
|
};
|
|
|
|
|
|
this.dataReady = true;
|
|
@@ -194,12 +191,47 @@ export default {
|
|
|
this.infos[key] = Object.assign(this.infos[key], val);
|
|
|
});
|
|
|
},
|
|
|
- printTaskRelateInfoChange(data) {
|
|
|
- this.dataChange(data);
|
|
|
+ async printTaskRelateInfoChange(data, type) {
|
|
|
+ if (type === "exam") {
|
|
|
+ const { examId, teachingRoomId } = data.examTask;
|
|
|
+ const {
|
|
|
+ examId: infoExamId,
|
|
|
+ teachingRoomId: infoTeachingRoomId
|
|
|
+ } = this.infos.examTask;
|
|
|
+ if (
|
|
|
+ examId &&
|
|
|
+ teachingRoomId &&
|
|
|
+ (examId !== infoExamId || teachingRoomId !== infoTeachingRoomId)
|
|
|
+ ) {
|
|
|
+ this.dataChange(data);
|
|
|
+ await this.updatePrintPlan({ examId, orgId: teachingRoomId });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.InfoPrintTask.updatePackageInfos();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.InfoPrintTask.initData();
|
|
|
- });
|
|
|
+ if (type === "course") {
|
|
|
+ this.dataChange(data);
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.InfoPrintTask.initData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async updatePrintPlan({ examId, orgId }) {
|
|
|
+ const printPlan = await examConfigByExamIdOrgId({
|
|
|
+ examId,
|
|
|
+ orgId
|
|
|
+ }).catch(() => {});
|
|
|
+ if (!printPlan) {
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let examPrintPlan = Object.assign({}, initPrintPlan, printPlan);
|
|
|
+ this.infos.examPrintPlan = examPrintPlan;
|
|
|
+ this.infos.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
|
},
|
|
|
async cancel() {
|
|
|
const result = await this.$confirm("确定取消该任务?", "提示", {
|
|
@@ -241,30 +273,15 @@ export default {
|
|
|
examDatas.forEach(item => {
|
|
|
this.dataChange(item);
|
|
|
});
|
|
|
- // 更新printPlan
|
|
|
- const printPlan = await examConfigByExamIdOrgId({
|
|
|
- examId: this.infos.examTask.examId,
|
|
|
- orgId: this.$ls.get("orgId")
|
|
|
- }).catch(() => {});
|
|
|
- if (!printPlan) {
|
|
|
- this.loading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- let examPrintPlan = Object.assign({}, initPrintPlan, printPlan);
|
|
|
- examPrintPlan.printContent = JSON.parse(data.printContent);
|
|
|
- this.infos.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
|
|
|
|
const examTaskContent = {
|
|
|
examTask: this.infos.examTask,
|
|
|
examTaskDetail: this.infos.examTaskDetail,
|
|
|
- examDetail: this.infos.printTask,
|
|
|
- examPrintPlan
|
|
|
+ examDetail: this.infos.printTask
|
|
|
};
|
|
|
let datas = {
|
|
|
examTaskContent: JSON.stringify(examTaskContent)
|
|
|
};
|
|
|
- if (this.infos.approveUserIds.length)
|
|
|
- datas.approveUserIds = this.infos.approveUserIds;
|
|
|
|
|
|
const data = await teacherSubmitTaskApply(datas).catch(() => {});
|
|
|
this.loading = false;
|