Commit 476a361a authored by 王's avatar

期数列表bug

parent 196c84f5
...@@ -184,6 +184,7 @@ ...@@ -184,6 +184,7 @@
this.newDialog.form.id = ''; this.newDialog.form.id = '';
this.newDialog.start_num = ''; this.newDialog.start_num = '';
this.newDialog.form.goods_id = ''; this.newDialog.form.goods_id = '';
this.newDialog.form.course_id = '';
this.newDialog.form.title = ''; this.newDialog.form.title = '';
this.newDialog.form.start_at = ''; this.newDialog.form.start_at = '';
this.newDialog.form.rest_week_day = []; this.newDialog.form.rest_week_day = [];
...@@ -197,6 +198,7 @@ ...@@ -197,6 +198,7 @@
this.newDialog.form.start_at = row.start_at; this.newDialog.form.start_at = row.start_at;
this.newDialog.form.title = row.title; this.newDialog.form.title = row.title;
this.newDialog.form.goods_id = row.goods_id; this.newDialog.form.goods_id = row.goods_id;
this.newDialog.form.course_id = row.course_id;
console.log('row', row) console.log('row', row)
let weekList = []; let weekList = [];
if(row.rest_week_day){ if(row.rest_week_day){
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="商品名称" prop="goods_id"> <el-form-item label="商品名称" prop="goods_id">
<el-select v-model="form.goods_id" placeholder="请选择" clearable @change="getLessonDetail"> <el-select v-model="form.goods_id" placeholder="请选择" clearable @change="onOptionChange">
<el-option <el-option
v-for="(data,index) in goodList" v-for="(data,index) in goodList"
:key="index" :key="index"
...@@ -204,16 +204,17 @@ ...@@ -204,16 +204,17 @@
} }
}); });
}, },
// getChooseGood(val){
// this.form.goods_id = val.id;
// this.getLessonDetail(val.course_id);
// this.goodDialogObj.show = false;
// },
getTeachers(){ getTeachers(){
getTeacherListApi().then((res)=>{ getTeacherListApi().then((res)=>{
this.teacherOptions = res.list; this.teacherOptions = res.list;
}) })
}, },
onOptionChange(id){
let index = this.goodList.findIndex((val)=>{ return val.id = id});
if(index >-1){
this.getLessonDetail(this.goodList[index].course_id);
}
},
getLessonDetail(id){ getLessonDetail(id){
console.log('getLessonDetail', id); console.log('getLessonDetail', id);
this.form.start_num='' this.form.start_num=''
...@@ -235,8 +236,8 @@ ...@@ -235,8 +236,8 @@
// this.initPage() // this.initPage()
this.getTeachers(); this.getTeachers();
this.getGoodsOption(); this.getGoodsOption();
if(this.dialogObj.form.goods_id){ if(this.dialogObj.form.course_id){
this.getLessonDetail(this.dialogObj.form.goods_id); this.getLessonDetail(this.dialogObj.form.course_id);
} }
this.form = this.dialogObj.form; this.form = this.dialogObj.form;
this.teacherList = this.dialogObj.form.teacher_ids; this.teacherList = this.dialogObj.form.teacher_ids;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment