Commit b3284510 authored by 王's avatar

期数添加班级bug

parent 679acb14
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/> <page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<new-dialog v-if="newDialog.show" :dialogObj="newDialog" @reflash="onSave"></new-dialog> <new-dialog v-if="newDialog.show" :dialogObj="newDialog" @reflash="onSave" @changeShow="changeShow"></new-dialog>
</div> </div>
</template> </template>
...@@ -207,6 +207,9 @@ ...@@ -207,6 +207,9 @@
this.total = res.total this.total = res.total
}); });
}, },
changeShow(data){
this.newDialog.show=data
},
onAdd(){ onAdd(){
this.newDialog.form.id = ''; this.newDialog.form.id = '';
this.newDialog.form.startNum = ''; this.newDialog.form.startNum = '';
...@@ -216,6 +219,7 @@ ...@@ -216,6 +219,7 @@
this.newDialog.form.rest_week_day = []; this.newDialog.form.rest_week_day = [];
this.newDialog.form.teacher_ids = []; this.newDialog.form.teacher_ids = [];
this.newDialog.form.teacherList = []; this.newDialog.form.teacherList = [];
this.newDialog.form.viewTeacher = '';
this.newDialog.title = '添加期数'; this.newDialog.title = '添加期数';
this.newDialog.show = true; this.newDialog.show = true;
}, },
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
:title="dialogObj.title" :title="dialogObj.title"
center center
append-to-body append-to-body
:visible.sync="dialogObj.show" :visible.sync="show"
width="800px"> width="800px">
<div v-loading="loading"> <div v-loading="loading">
<el-form ref="form" :model="form" label-width="120px" :rules="rules"> <el-form ref="form" :model="form" label-width="120px" :rules="rules">
<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="onOptionChange" :disabled="form.id ? true : false"> <el-select v-model="form.goods_id" placeholder="请选择" @change="onOptionChange" :disabled="form.id ? true : false">
<el-option <el-option
v-for="(data,index) in goodList" v-for="(data,index) in goodList"
:key="index" :key="index"
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button> <el-button @click="show = false">取 消</el-button>
<el-button type="primary" @click="sub">确 定</el-button> <el-button type="primary" @click="sub">确 定</el-button>
</span> </span>
</div> </div>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
return{ return{
loading: false, loading: false,
form: {}, form: {},
teacherList: [], show: false,
viewTeacher: '', viewTeacher: '',
pickerOptions1: { pickerOptions1: {
disabledDate(time) { disabledDate(time) {
...@@ -170,6 +170,11 @@ ...@@ -170,6 +170,11 @@
components:{ components:{
goodDialog goodDialog
}, },
watch:{
show(value){
this.$emit("changeShow",value);
}
},
filters: { filters: {
isOrNot(value){ isOrNot(value){
return ISORNOT[value] return ISORNOT[value]
...@@ -254,15 +259,13 @@ ...@@ -254,15 +259,13 @@
} }
}, },
onOptionChange(id){ onOptionChange(id){
console.log('onOptionChange', id) let index = this.goodList.findIndex((val)=>{ return val.id === id});
this.form.goods_id = id;
let index = this.goodList.findIndex((val)=>{ return val.id = id});
if(index >-1){ if(index >-1){
this.getLessonDetail(this.goodList[index].course_id); this.getLessonDetail(this.goodList[index].course_id);
} }
delete this.form.startNum
}, },
getLessonDetail(id){ getLessonDetail(id){
this.form.start_num=''
getLessonDetailApi(id,{}).then((res) => { getLessonDetailApi(id,{}).then((res) => {
this.itemOptions = res.detail[res.type] this.itemOptions = res.detail[res.type]
}) })
...@@ -274,18 +277,22 @@ ...@@ -274,18 +277,22 @@
}; };
getGoodsListApi(json).then(res=>{ getGoodsListApi(json).then(res=>{
this.goodList = res.list; this.goodList = res.list;
if (this.dialogObj.form.id){
this.form = this.dialogObj.form;
} else {
this.form = {};
}
if(this.dialogObj.form.course_id){
this.getLessonDetail(this.dialogObj.form.course_id);
}
this.show = this.dialogObj.show
}) })
} }
}, },
mounted(){ mounted(){
// this.initPage() // this.initPage()
this.form = this.dialogObj.form;
this.getTeachers();
this.getGoodsOption(); this.getGoodsOption();
if(this.dialogObj.form.course_id){ this.getTeachers();
this.getLessonDetail(this.dialogObj.form.course_id);
}
this.teacherList = this.dialogObj.form.teacher_ids;
} }
} }
</script> </script>
......
...@@ -1022,7 +1022,6 @@ ...@@ -1022,7 +1022,6 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
deleteSubMedia(){ deleteSubMedia(){
console.log('deleteSubMedia')
let selectedIndex = this.selectedIndex; let selectedIndex = this.selectedIndex;
let selectedChildIndex = this.selectedChildIndex; let selectedChildIndex = this.selectedChildIndex;
let _type = this.buttonList[selectedIndex].sub_button[selectedChildIndex].media_info.type; let _type = this.buttonList[selectedIndex].sub_button[selectedChildIndex].media_info.type;
......
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