|
@@ -64,6 +64,7 @@ const { mapActions } = createNamespacedHelpers('trainplan');
|
|
|
const { mapActions: teaplan } = createNamespacedHelpers('teaplan');
|
|
|
const { mapActions: teacher } = createNamespacedHelpers('teacher');
|
|
|
const { mapActions: subject } = createNamespacedHelpers('subject');
|
|
|
+const { mapActions: classtype } = createNamespacedHelpers('classtype');
|
|
|
|
|
|
export default {
|
|
|
metaInfo: { title: '计划一览' },
|
|
@@ -92,6 +93,7 @@ export default {
|
|
|
],
|
|
|
fields: [
|
|
|
{ label: '期', prop: 'term' },
|
|
|
+ { label: '班级类型', prop: 'classtype' },
|
|
|
{ label: '科目', prop: 'subname' },
|
|
|
{ label: '日期', prop: 'day' },
|
|
|
{ label: '时间', prop: 'time', custom: true },
|
|
@@ -100,14 +102,17 @@ export default {
|
|
|
subjectList: [],
|
|
|
applyList: [],
|
|
|
needConfirm: true,
|
|
|
+ classTypeList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
this.getSubject();
|
|
|
+ this.getCTList();
|
|
|
await this.getTeacherInfo();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...classtype({ getClassTypeList: 'query' }),
|
|
|
...subject({ getSubjectList: 'query' }),
|
|
|
...teacher({ getTeacher: 'fetch' }),
|
|
|
...mapActions(['query', 'delete', 'fetch']),
|
|
@@ -127,7 +132,19 @@ export default {
|
|
|
.map(t => {
|
|
|
let { term, _id: termid } = t;
|
|
|
let obj = { term, termid };
|
|
|
- let lessons = t.batchnum.map(b => b.lessons.map(l => ({ ...l, ...obj })));
|
|
|
+ let lessons = t.batchnum.map(b => {
|
|
|
+ let classtype = '';
|
|
|
+ if (b.class && b.class.length > 0) {
|
|
|
+ const head = _.head(b.class);
|
|
|
+ // 该批次班级类型,也就是这些课程对应的班级类型
|
|
|
+ const { type } = head;
|
|
|
+ const ctres = this.classTypeList.find(f => f.code == type);
|
|
|
+ if (ctres) classtype = ctres.name;
|
|
|
+ }
|
|
|
+ b.lessons = b.lessons.map(l => ({ ...l, ...obj, classtype }));
|
|
|
+
|
|
|
+ return b.lessons;
|
|
|
+ });
|
|
|
return lessons.flat();
|
|
|
})
|
|
|
.flat();
|
|
@@ -206,6 +223,14 @@ export default {
|
|
|
});
|
|
|
return list;
|
|
|
},
|
|
|
+
|
|
|
+ //查找班级类型
|
|
|
+ async getCTList() {
|
|
|
+ const res = await this.getClassTypeList();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `classTypeList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user', 'defaultOption']),
|