Commit b3284510 authored by 王's avatar

期数添加班级bug

parent 679acb14
......@@ -121,7 +121,7 @@
</el-table-column>
</el-table>
<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>
</template>
......@@ -207,6 +207,9 @@
this.total = res.total
});
},
changeShow(data){
this.newDialog.show=data
},
onAdd(){
this.newDialog.form.id = '';
this.newDialog.form.startNum = '';
......@@ -216,6 +219,7 @@
this.newDialog.form.rest_week_day = [];
this.newDialog.form.teacher_ids = [];
this.newDialog.form.teacherList = [];
this.newDialog.form.viewTeacher = '';
this.newDialog.title = '添加期数';
this.newDialog.show = true;
},
......
......@@ -4,14 +4,14 @@
:title="dialogObj.title"
center
append-to-body
:visible.sync="dialogObj.show"
:visible.sync="show"
width="800px">
<div v-loading="loading">
<el-form ref="form" :model="form" label-width="120px" :rules="rules">
<el-row>
<el-col :span="10">
<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
v-for="(data,index) in goodList"
:key="index"
......@@ -77,7 +77,7 @@
</el-form-item>
</el-form>
<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>
</span>
</div>
......@@ -97,7 +97,7 @@
return{
loading: false,
form: {},
teacherList: [],
show: false,
viewTeacher: '',
pickerOptions1: {
disabledDate(time) {
......@@ -170,6 +170,11 @@
components:{
goodDialog
},
watch:{
show(value){
this.$emit("changeShow",value);
}
},
filters: {
isOrNot(value){
return ISORNOT[value]
......@@ -254,15 +259,13 @@
}
},
onOptionChange(id){
console.log('onOptionChange', id)
this.form.goods_id = id;
let index = this.goodList.findIndex((val)=>{ return val.id = id});
let index = this.goodList.findIndex((val)=>{ return val.id === id});
if(index >-1){
this.getLessonDetail(this.goodList[index].course_id);
}
delete this.form.startNum
},
getLessonDetail(id){
this.form.start_num=''
getLessonDetailApi(id,{}).then((res) => {
this.itemOptions = res.detail[res.type]
})
......@@ -274,18 +277,22 @@
};
getGoodsListApi(json).then(res=>{
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(){
// this.initPage()
this.form = this.dialogObj.form;
this.getTeachers();
this.getGoodsOption();
if(this.dialogObj.form.course_id){
this.getLessonDetail(this.dialogObj.form.course_id);
}
this.teacherList = this.dialogObj.form.teacher_ids;
this.getTeachers();
}
}
</script>
......
......@@ -1022,7 +1022,6 @@
this.$forceUpdate();
},
deleteSubMedia(){
console.log('deleteSubMedia')
let selectedIndex = this.selectedIndex;
let selectedChildIndex = this.selectedChildIndex;
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