|
@@ -9,12 +9,12 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="期">
|
|
|
<el-select v-model="form.termid" placeholder="请选择期数" @change="getBatch">
|
|
|
- <el-option v-for="(i, index) in termList" :key="index" :label="`第${i.term}期`" :value="i._id"></el-option>
|
|
|
+ <el-option v-for="(i, index) in termList" :key="index" :label="`第${i.term}期`" :value="i.termid"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="批次">
|
|
|
- <el-select v-model="form.batchid" placeholder="请先选择期数">
|
|
|
- <el-option v-for="(i, index) in batchList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
|
+ <el-select v-model="form.batchid" placeholder="请先选择期数" @change="getClass">
|
|
|
+ <el-option v-for="(i, index) in batchList" :key="index" :label="`第${i.batch}批`" :value="i.batchid"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="班级">
|
|
@@ -41,6 +41,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import _ from 'lodash';
|
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
|
import dataTable from '@frame/components/data-table';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
@@ -98,6 +99,7 @@ export default {
|
|
|
form: {},
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
+ arrange: [],
|
|
|
}),
|
|
|
created() {
|
|
|
this.searchinfo();
|
|
@@ -117,20 +119,29 @@ export default {
|
|
|
//计划
|
|
|
async changejh(ids) {
|
|
|
const res = await this.fetchUtil({ model: 'schtime', planid: ids, schid: this.user.code });
|
|
|
-
|
|
|
- this.$set(this, `termList`, res.data.term);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let { arrange } = res.data;
|
|
|
+ this.$set(this, `arrange`, arrange);
|
|
|
+ let termList = arrange.map(i => {
|
|
|
+ let { term, termid } = i;
|
|
|
+ return { term, termid };
|
|
|
+ });
|
|
|
+ termList = _.orderBy(_.uniqBy(termList, 'termid'), ['term'], ['asc']);
|
|
|
+ this.$set(this, `termList`, termList);
|
|
|
+ }
|
|
|
},
|
|
|
getBatch(termid) {
|
|
|
- let batchs = this.termList.filter(f => f._id === termid);
|
|
|
- if (batchs.length > 0) {
|
|
|
- let { batchnum } = batchs[0];
|
|
|
- this.$set(this, `batchList`, batchnum);
|
|
|
- }
|
|
|
+ let batchs = this.arrange.filter(f => f.termid === termid);
|
|
|
+ let batchList = batchs.map(i => {
|
|
|
+ let { batch, batchid } = i;
|
|
|
+ return { batch, batchid };
|
|
|
+ });
|
|
|
+ batchList = _.orderBy(_.uniqBy(batchList, 'batchid'), ['batch'], ['asc']);
|
|
|
+ this.$set(this, `batchList`, batchList);
|
|
|
},
|
|
|
- async changeqi(termid) {
|
|
|
- const res = await this.classesquery({ termid });
|
|
|
- console.log(res.data);
|
|
|
- this.$set(this, `classList`, res.data);
|
|
|
+ async getClass(batchid) {
|
|
|
+ const res = await this.classesquery({ batchid });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `classList`, res.data);
|
|
|
},
|
|
|
|
|
|
async onsearch({ skip = 0, limit = 10, ...info } = {}) {
|