diff --git a/src/main/resources/static/route/classplan/select-lesson-teacher.html b/src/main/resources/static/route/classplan/select-lesson-teacher.html index 3000c02..e2dce1d 100644 --- a/src/main/resources/static/route/classplan/select-lesson-teacher.html +++ b/src/main/resources/static/route/classplan/select-lesson-teacher.html @@ -62,9 +62,13 @@
@@ -133,10 +137,7 @@ max: '23:00:00' }); initLessons(); - laytpl(document.getElementById('teacherTemplate').innerHTML).render([], function(html) { - document.getElementById('teacherBox').innerHTML = html; - }); - form.render(null, 'dataForm'); + initTeacherList(); $('.layui-card').height($(window).height()); } initData(); @@ -160,25 +161,9 @@ }); } - form.on('select(changeLesson)',function(data){ - if(data.value == ''){ - laytpl(document.getElementById('teacherTemplate').innerHTML).render([], function(html) { - document.getElementById('teacherBox').innerHTML = html; - }); - form.render(null, 'dataForm'); - return; - } - var lessonWorkType = $(data.elem).find('option:selected').data().lessonWorkType; - initTeacherList(lessonWorkType); - }); - //查询讲师列表 - function initTeacherList(lessonWorkType){ - top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {workerCategoryId : lessonWorkType}, null, function(code,data){ - if(typeof (data) === 'undefined' || data.length == 0){ - layer.msg('当前专业还没有讲师,请联系应急管理局进行添加'); - return; - } + function initTeacherList(){ + top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {}, null, function(code,data){ laytpl(document.getElementById('teacherTemplate').innerHTML).render(data, function(html) { document.getElementById('teacherBox').innerHTML = html; });