|
@@ -171,11 +171,21 @@ export default {
|
|
|
let planyearid = _.get(this.defaultOption, 'planyearid');
|
|
|
const res = await this.trainplanQuery({ planyearid: planyearid });
|
|
|
var arr = res.data.filter(item => item.id === planid);
|
|
|
- if (this.$checkRes(arr)) this.$set(this, `termList`, arr[0].termnum);
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
+ this.$set(this, `termList`, arr[0].termnum);
|
|
|
+ let { termid, batchid } = this.info;
|
|
|
+ if (termid) this.termChange({ data: termid, model: 'termid' });
|
|
|
+ if (batchid) this.termChange({ data: batchid, model: 'batchid' });
|
|
|
+ }
|
|
|
},
|
|
|
async search() {
|
|
|
const res = await this.fetch(this.id);
|
|
|
- if (this.$checkRes(res)) this.$set(this, `info`, res.data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
+ let { batchid, termid } = res.data;
|
|
|
+ if (termid) this.termChange({ data: termid, model: 'termid' });
|
|
|
+ if (batchid) this.termChange({ data: batchid, model: 'batchid' });
|
|
|
+ }
|
|
|
this.loading = false;
|
|
|
},
|
|
|
async handleSave({ isNew, data }) {
|