修改选择授课讲师时不再关联所选工种
This commit is contained in:
parent
cbe93c4f53
commit
8a7c42b4d8
@ -62,9 +62,13 @@
|
||||
<div class="layui-input-block" id="teacherBox"></div>
|
||||
<script type="text/html" id="teacherTemplate">
|
||||
<select id="teacherId" name="teacherId" lay-verify="required" lay-search>
|
||||
<option value="">选择讲师</option>
|
||||
<option value="">选择讲师(支持姓名或手机号搜索)</option>
|
||||
{{# for(var i = 0, item; item = d[i++];){ }}
|
||||
{{# if(item.telephone == '' || item.telephone == null ){ }}
|
||||
<option value="{{item.teacherId}}">{{item.teacherName}}</option>
|
||||
{{# } else { }}
|
||||
<option value="{{item.teacherId}}">{{item.teacherName}} ({{item.telephone}})</option>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
@ -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;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user