|
@@ -3,15 +3,10 @@
|
|
|
<list-frame title="学生管理" @query="search" :total="total" :needFilter="false" @add="$router.push({ path: '/student/detail' })">
|
|
|
<el-form :inline="true" size="mini">
|
|
|
<el-form-item label="期">
|
|
|
- <el-select v-model="form.termid" placeholder="请选择期数" @change="getBatch">
|
|
|
+ <el-select v-model="form.termid" placeholder="请选择期数" @change="getClasses">
|
|
|
<el-option v-for="(i, index) in termList" :key="index" :label="`第${i.term}期`" :value="i._id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="批次">
|
|
|
- <el-select v-model="form.batchid" placeholder="请先选择期数" @change="getClasses">
|
|
|
- <el-option v-for="(i, index) in batchList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="班级">
|
|
|
<el-select v-model="form.classid" placeholder="请先选择批次">
|
|
|
<el-option v-for="(i, index) in classList" :key="index" :label="i.name" :value="i._id"></el-option>
|
|
@@ -130,18 +125,11 @@ export default {
|
|
|
this.$set(this, `termList`, terms);
|
|
|
if (this.defaultOption.termid) {
|
|
|
this.form.termid = this.defaultOption.termid;
|
|
|
- this.getBatch(this.form.termid);
|
|
|
- }
|
|
|
- },
|
|
|
- getBatch(termid) {
|
|
|
- let batchs = this.termList.filter(f => f._id === termid);
|
|
|
- if (batchs.length > 0) {
|
|
|
- let { batchnum } = batchs[0];
|
|
|
- this.$set(this, `batchList`, batchnum);
|
|
|
+ this.getClasses(this.form.termid);
|
|
|
}
|
|
|
},
|
|
|
- async getClasses(batchid) {
|
|
|
- const res = await this.classesquery({ batchid });
|
|
|
+ async getClasses(termid) {
|
|
|
+ const res = await this.classesquery({ termid });
|
|
|
this.$set(this, `classList`, res.data);
|
|
|
},
|
|
|
async toTurnClass({ data }) {
|
|
@@ -169,7 +157,7 @@ export default {
|
|
|
defaultOption: {
|
|
|
handler(val) {
|
|
|
this.form.termid = this.defaultOption.termid;
|
|
|
- this.getBatch(this.form.termid);
|
|
|
+ this.getClasses(this.form.termid);
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|