|
@@ -115,27 +115,24 @@ export default {
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
let { arrange } = res.data;
|
|
let { arrange } = res.data;
|
|
let { termnum } = this.plan;
|
|
let { termnum } = this.plan;
|
|
- arrange = arrange.map(i => {
|
|
|
|
- let mid = termnum.map(i => i.batchnum).flat();
|
|
|
|
- //数组 变量 orderby按顺序排列 升序降序
|
|
|
|
- let start = _.get(_.head(_.orderBy(mid, 'startdate', 'asc')), 'startdate');
|
|
|
|
- let end = _.get(_.head(_.orderBy(mid, 'enddate', 'desc')), 'enddate');
|
|
|
|
- let planrange = `${start} 至 ${end}`;
|
|
|
|
- i.planrange = planrange;
|
|
|
|
- let rt = termnum.find(f => f.term == i.term);
|
|
|
|
- if (rt) {
|
|
|
|
- let rb = rt.batchnum.find(f => f.batch == i.batch);
|
|
|
|
- if (rb) {
|
|
|
|
- let bh = _.head(rb.class);
|
|
|
|
- let { type } = bh;
|
|
|
|
- i.type = type;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return i;
|
|
|
|
- });
|
|
|
|
- arrange = _.orderBy(arrange, ['term', 'batch'], ['asc', 'asc']);
|
|
|
|
|
|
+ let resArr = [];
|
|
|
|
+ for (const arr of arrange) {
|
|
|
|
+ const { number } = arr;
|
|
|
|
+ const { batchid, termid } = arr;
|
|
|
|
+ const terminfo = termnum.find(f => f._id == termid);
|
|
|
|
+ if (!terminfo) continue;
|
|
|
|
+ const { batchnum, term } = terminfo;
|
|
|
|
+ const batchinfo = batchnum.find(f => f._id == batchid);
|
|
|
|
+ if (!batchinfo) continue;
|
|
|
|
+ const { batch, startdate, enddate, class: classList } = batchinfo;
|
|
|
|
+ const obj = { term, batch, number, planrange: `${startdate} 至 ${enddate}` };
|
|
|
|
+ const head = _.head(classList);
|
|
|
|
+ if (head) obj.type = head.type;
|
|
|
|
+ resArr.push({ ...obj, ...arr });
|
|
|
|
+ }
|
|
|
|
+ resArr = _.orderBy(resArr, ['term', 'batch'], ['asc', 'asc']);
|
|
this.$set(this, `info`, res.data);
|
|
this.$set(this, `info`, res.data);
|
|
- this.$set(this, `list`, arrange);
|
|
|
|
|
|
+ this.$set(this, `list`, resArr);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toNamelist({ data }) {
|
|
toNamelist({ data }) {
|