添加开班时没有讲师和课程的提示

This commit is contained in:
wans 2021-05-25 17:29:24 +08:00
parent 6ef0b9bbe2
commit 7f7e184061
2 changed files with 14 additions and 0 deletions

View File

@ -254,6 +254,10 @@
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId,orgId : orgId}, null, function(code,data){
dataObj['lesson'] = data;
dataObj['teacher'] = teacherList;
if(typeof (data) === 'undefined' || dataObj['lesson'].length == 0){
layer.msg('未查询到课程,请先添加课程');
return;
}
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
document.getElementById('lessonTbodyBox').innerHTML = html;
});
@ -278,6 +282,9 @@
function initTeacherList(){
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
teacherList = data;
if(typeof (data) === 'undefined' || teacherList.length == 0){
layer.msg('当前机构没有讲师,请先在讲师管理中添加讲师');
}
},function(code,data){
top.dialog.msg(data.msg);
});

View File

@ -245,6 +245,9 @@
function initTeacherList(orgId){
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
teacherList = data;
if(typeof (data) === 'undefined' || teacherList.length == 0){
layer.msg('当前机构没有讲师,请先在讲师管理中添加讲师');
}
initLessonsList();
},function(code,data){
top.dialog.msg(data.msg);
@ -267,6 +270,10 @@
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId,orgId : orgId}, null, function(code,data){
dataObj['lesson'] = data;
dataObj['teacher'] = teacherList;
if(typeof (data) === 'undefined' || dataObj['lesson'].length == 0){
layer.msg('未查询到课程,请先添加课程');
return;
}
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
document.getElementById('lessonTbodyBox').innerHTML = html;
});