|
@@ -13,69 +13,34 @@
|
|
<span class="el-dialog__title">新增命题申请</span>
|
|
<span class="el-dialog__title">新增命题申请</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-steps
|
|
|
|
- class="apply-step"
|
|
|
|
- :active="current"
|
|
|
|
- align-center
|
|
|
|
- finish-status="success"
|
|
|
|
- >
|
|
|
|
- <el-step v-for="step in steps" :key="step.name" :title="step.title">
|
|
|
|
- </el-step>
|
|
|
|
- </el-steps>
|
|
|
|
-
|
|
|
|
<div class="apply-body" v-if="dataReady">
|
|
<div class="apply-body" v-if="dataReady">
|
|
- <component
|
|
|
|
- :is="currentComponent"
|
|
|
|
- :ref="currentComponent"
|
|
|
|
|
|
+ <info-exam-task
|
|
|
|
+ ref="InfoExamTask"
|
|
|
|
+ :datas="infos"
|
|
|
|
+ @data-change="dataChange"
|
|
|
|
+ ></info-exam-task>
|
|
|
|
+ <info-print-task
|
|
|
|
+ ref="InfoPrintTask"
|
|
:datas="infos"
|
|
:datas="infos"
|
|
- @next-step="toNext"
|
|
|
|
- @on-ready="compReady"
|
|
|
|
@data-change="dataChange"
|
|
@data-change="dataChange"
|
|
- ></component>
|
|
|
|
|
|
+ ></info-print-task>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="text-center">
|
|
|
|
- <el-button
|
|
|
|
- v-if="!isFirstStep"
|
|
|
|
- type="primary"
|
|
|
|
- :disabled="loading"
|
|
|
|
- @click="prevStep"
|
|
|
|
- >上一步</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- v-if="isLastStep"
|
|
|
|
- type="success"
|
|
|
|
- :disabled="loading"
|
|
|
|
- @click="nextStep"
|
|
|
|
|
|
+ <div slot="footer" class="text-center">
|
|
|
|
+ <el-button type="success" :disabled="loading" @click="nextStep"
|
|
>确认提交</el-button
|
|
>确认提交</el-button
|
|
>
|
|
>
|
|
- <el-button v-else type="primary" @click="nextStep" :disabled="loading"
|
|
|
|
- >下一步</el-button
|
|
|
|
- >
|
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
</div>
|
|
</div>
|
|
- <div slot="footer"></div>
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { examRuleDetail } from "../../../base/api";
|
|
|
|
|
|
+import { examConfigByExamIdOrgId, examRuleDetail } from "../../../base/api";
|
|
import { teacherSubmitTaskApply } from "../../api";
|
|
import { teacherSubmitTaskApply } from "../../api";
|
|
-import { printPlanTemplateList } from "../../../print/api";
|
|
|
|
import InfoExamTask from "./InfoExamTask";
|
|
import InfoExamTask from "./InfoExamTask";
|
|
import InfoPrintTask from "./InfoPrintTask";
|
|
import InfoPrintTask from "./InfoPrintTask";
|
|
-// import { deepCopy } from "@/plugins/utils";
|
|
|
|
-
|
|
|
|
-const STEPS_LIST = [
|
|
|
|
- {
|
|
|
|
- name: "exam-task",
|
|
|
|
- title: "命题信息"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "print-task",
|
|
|
|
- title: "考务信息"
|
|
|
|
- }
|
|
|
|
-];
|
|
|
|
|
|
+import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
const initExamTask = {
|
|
const initExamTask = {
|
|
semesterId: "",
|
|
semesterId: "",
|
|
@@ -83,6 +48,7 @@ const initExamTask = {
|
|
courseCode: "",
|
|
courseCode: "",
|
|
courseName: "",
|
|
courseName: "",
|
|
paperNumber: "",
|
|
paperNumber: "",
|
|
|
|
+ cardRuleId: "",
|
|
teachingRoomId: "",
|
|
teachingRoomId: "",
|
|
teacherName: "",
|
|
teacherName: "",
|
|
paperName: ""
|
|
paperName: ""
|
|
@@ -105,6 +71,43 @@ const initExamTaskDetail = {
|
|
customCard: false
|
|
customCard: false
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const initPrintPlan = {
|
|
|
|
+ name: "",
|
|
|
|
+ examStartTime: "",
|
|
|
|
+ examEndTime: "",
|
|
|
|
+ semesterId: "",
|
|
|
|
+ printContent: [],
|
|
|
|
+ backupMethod: "ROOM",
|
|
|
|
+ backupCount: 1,
|
|
|
|
+ drawRule: "ONE",
|
|
|
|
+ templateSources: {},
|
|
|
|
+ variableContent: [
|
|
|
|
+ {
|
|
|
|
+ type: "SIGN",
|
|
|
|
+ templateId: "",
|
|
|
|
+ oldTemplateId: "",
|
|
|
|
+ backupMethod: "ROOM",
|
|
|
|
+ backupCount: 1
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "PACKAGE",
|
|
|
|
+ templateId: "",
|
|
|
|
+ oldTemplateId: "",
|
|
|
|
+ backupMethod: "ROOM",
|
|
|
|
+ backupCount: 1
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ ordinaryContent: [
|
|
|
|
+ {
|
|
|
|
+ type: "CHECK_IN",
|
|
|
|
+ templateId: "",
|
|
|
|
+ oldTemplateId: "",
|
|
|
|
+ backupMethod: "ROOM",
|
|
|
|
+ backupCount: 1
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+};
|
|
|
|
+
|
|
const initPrintTask = {
|
|
const initPrintTask = {
|
|
examStartTime: "",
|
|
examStartTime: "",
|
|
examEndTime: "",
|
|
examEndTime: "",
|
|
@@ -124,41 +127,30 @@ export default {
|
|
examRule: {},
|
|
examRule: {},
|
|
infos: {},
|
|
infos: {},
|
|
templateSources: {},
|
|
templateSources: {},
|
|
- // step
|
|
|
|
- steps: STEPS_LIST,
|
|
|
|
- current: 0,
|
|
|
|
loading: false,
|
|
loading: false,
|
|
dataReady: false
|
|
dataReady: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- currentComponent() {
|
|
|
|
- return `info-${this.steps[this.current].name}`;
|
|
|
|
- },
|
|
|
|
- isFirstStep() {
|
|
|
|
- return this.current === 0;
|
|
|
|
- },
|
|
|
|
- isLastStep() {
|
|
|
|
- return this.current === this.lastStep;
|
|
|
|
- },
|
|
|
|
- lastStep() {
|
|
|
|
- return this.steps.length - 1;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
async getExamRule() {
|
|
async getExamRule() {
|
|
const examRule = await examRuleDetail();
|
|
const examRule = await examRuleDetail();
|
|
this.examRule = examRule || {};
|
|
this.examRule = examRule || {};
|
|
this.needReview = examRule && examRule.review;
|
|
this.needReview = examRule && examRule.review;
|
|
},
|
|
},
|
|
- async getTemplates() {
|
|
|
|
- const data = await printPlanTemplateList();
|
|
|
|
- const templateSources = {};
|
|
|
|
- const templates = [...data.variable, ...data.ordinary];
|
|
|
|
- templates.forEach(item => {
|
|
|
|
- templateSources[item.type] = item.template;
|
|
|
|
|
|
+ async getPrintPlanInfo(examId) {
|
|
|
|
+ const data = await examConfigByExamIdOrgId({
|
|
|
|
+ examId,
|
|
|
|
+ orgId: this.$ls.get("orgId")
|
|
});
|
|
});
|
|
- this.templateSources = templateSources;
|
|
|
|
|
|
+ let printPlan = deepCopy(initPrintPlan);
|
|
|
|
+ printPlan.variableContent = JSON.parse(data.variableContent);
|
|
|
|
+ printPlan.ordinaryContent = JSON.parse(data.ordinaryContent);
|
|
|
|
+ printPlan.printContent = JSON.parse(data.printContent);
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ printPlan,
|
|
|
|
+ cardRuleId: data.cardRuleId
|
|
|
|
+ };
|
|
},
|
|
},
|
|
async initData() {
|
|
async initData() {
|
|
await this.getExamRule();
|
|
await this.getExamRule();
|
|
@@ -181,26 +173,9 @@ export default {
|
|
},
|
|
},
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.dataReady = false;
|
|
this.dataReady = false;
|
|
- this.current = 0;
|
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.initData();
|
|
this.initData();
|
|
},
|
|
},
|
|
- prevStep() {
|
|
|
|
- if (this.isFirstStep) return;
|
|
|
|
- this.$refs[this.currentComponent].updateData();
|
|
|
|
- this.current -= 1;
|
|
|
|
- },
|
|
|
|
- nextStep() {
|
|
|
|
- this.loading = true;
|
|
|
|
- this.$refs[this.currentComponent].checkData();
|
|
|
|
- },
|
|
|
|
- toNext() {
|
|
|
|
- if (this.isLastStep) {
|
|
|
|
- this.submit();
|
|
|
|
- } else {
|
|
|
|
- this.current += 1;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
dataChange(data) {
|
|
dataChange(data) {
|
|
// console.log(data);
|
|
// console.log(data);
|
|
Object.entries(data).forEach(([key, val]) => {
|
|
Object.entries(data).forEach(([key, val]) => {
|
|
@@ -208,16 +183,9 @@ export default {
|
|
this.infos[key] = [...val];
|
|
this.infos[key] = [...val];
|
|
} else {
|
|
} else {
|
|
this.infos[key] = Object.assign(this.infos[key], val);
|
|
this.infos[key] = Object.assign(this.infos[key], val);
|
|
-
|
|
|
|
- if (key === "examTask") {
|
|
|
|
- this.infos.printPlan.semesterId = val.semesterId;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- compReady(type = false) {
|
|
|
|
- this.loading = type;
|
|
|
|
- },
|
|
|
|
async cancel() {
|
|
async cancel() {
|
|
const result = await this.$confirm("确定取消该任务?", "提示", {
|
|
const result = await this.$confirm("确定取消该任务?", "提示", {
|
|
type: "warning"
|
|
type: "warning"
|
|
@@ -238,15 +206,23 @@ export default {
|
|
type: "warning"
|
|
type: "warning"
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
|
|
|
|
- if (result !== "confirm") {
|
|
|
|
- this.loading = false;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ if (result !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ // TODO:check valid
|
|
|
|
+
|
|
|
|
+ const printPlan = await examConfigByExamIdOrgId({
|
|
|
|
+ examId,
|
|
|
|
+ orgId: this.$ls.get("orgId")
|
|
|
|
+ });
|
|
|
|
+ let examPrintPlan = Object.assign({}, initPrintPlan, printPlan);
|
|
|
|
+ examPrintPlan.printContent = JSON.parse(data.printContent);
|
|
|
|
+ this.infos.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
|
|
|
|
const examTaskContent = {
|
|
const examTaskContent = {
|
|
examTask: this.infos.examTask,
|
|
examTask: this.infos.examTask,
|
|
examTaskDetail: this.infos.examTaskDetail,
|
|
examTaskDetail: this.infos.examTaskDetail,
|
|
- examDetail: this.infos.printTask
|
|
|
|
|
|
+ examDetail: this.infos.printTask,
|
|
|
|
+ examPrintPlan
|
|
};
|
|
};
|
|
let datas = {
|
|
let datas = {
|
|
examTaskContent: JSON.stringify(examTaskContent)
|
|
examTaskContent: JSON.stringify(examTaskContent)
|