|
@@ -30,7 +30,9 @@
|
|
|
<exam-select
|
|
|
v-model="examTask.examId"
|
|
|
:semester-id="examTask.semesterId"
|
|
|
+ :clearable="false"
|
|
|
class="width-full"
|
|
|
+ @change="emitRelateInfo"
|
|
|
></exam-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -341,15 +343,14 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.examTaskComp.clearValidate();
|
|
|
});
|
|
|
-
|
|
|
- this.$emit("on-ready");
|
|
|
},
|
|
|
async getCardList() {
|
|
|
if (!this.examTask.courseCode) return;
|
|
|
const data = await cardForSelectList({
|
|
|
courseCode: this.examTask.courseCode,
|
|
|
paperType: this.paperAttachments.map(item => item.name).join(","),
|
|
|
- cardRuleId: this.examTask.cardRuleId
|
|
|
+ cardRuleId: this.examTask.cardRuleId,
|
|
|
+ examId: this.examTask.examId
|
|
|
});
|
|
|
this.cards = data || [];
|
|
|
if (this.cards.length) {
|
|
@@ -375,6 +376,27 @@ export default {
|
|
|
);
|
|
|
this.examTask.paperName = curSemester.name;
|
|
|
},
|
|
|
+ teachingRoomChange() {
|
|
|
+ this.examTask.courseCode = "";
|
|
|
+ this.examTask.courseName = "";
|
|
|
+ this.courses = [];
|
|
|
+ this.examTaskDetail.cardId = "";
|
|
|
+ this.cards = [];
|
|
|
+ this.getCourses();
|
|
|
+ },
|
|
|
+ courseChange(val) {
|
|
|
+ if (val) {
|
|
|
+ const course = this.courses.find(item => item.code === val);
|
|
|
+ this.examTask.courseName = course.name;
|
|
|
+ } else {
|
|
|
+ this.examTask.courseName = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ this.examTaskDetail.cardId = "";
|
|
|
+ this.cards = [];
|
|
|
+ this.getCardList();
|
|
|
+ this.emitRelateInfo();
|
|
|
+ },
|
|
|
async checkData() {
|
|
|
const valid = await this.$refs.examTaskComp.validate().catch(() => {});
|
|
|
if (!valid) return Promise.reject();
|
|
@@ -406,8 +428,8 @@ export default {
|
|
|
};
|
|
|
return data;
|
|
|
},
|
|
|
- updateData() {
|
|
|
- this.$emit("data-change", this.getData());
|
|
|
+ emitRelateInfo() {
|
|
|
+ this.$emit("relate-info-change", this.getData());
|
|
|
},
|
|
|
// exam-task-detail edit
|
|
|
addAtachment() {
|
|
@@ -479,27 +501,6 @@ export default {
|
|
|
cardConfirm(data) {
|
|
|
this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
|
|
|
},
|
|
|
- teachingRoomChange() {
|
|
|
- this.examTask.courseCode = "";
|
|
|
- this.examTask.courseName = "";
|
|
|
- this.courses = [];
|
|
|
- this.examTaskDetail.cardId = "";
|
|
|
- this.cards = [];
|
|
|
- this.getCourses();
|
|
|
- },
|
|
|
- courseChange(val) {
|
|
|
- if (val) {
|
|
|
- const course = this.courses.find(item => item.code === val);
|
|
|
- this.examTask.courseName = course.name;
|
|
|
- } else {
|
|
|
- this.examTask.courseName = "";
|
|
|
- }
|
|
|
-
|
|
|
- this.examTaskDetail.cardId = "";
|
|
|
- this.cards = [];
|
|
|
- this.getCardList();
|
|
|
- this.$emit("course-change", this.getData());
|
|
|
- },
|
|
|
getTaskDetailData() {
|
|
|
let data = { ...this.examTaskDetail };
|
|
|
data.paperType = this.paperAttachments.map(item => item.name).join(",");
|