添加开班时没有讲师和课程的提示
This commit is contained in:
parent
6ef0b9bbe2
commit
7f7e184061
@ -254,6 +254,10 @@
|
|||||||
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId,orgId : orgId}, null, function(code,data){
|
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId,orgId : orgId}, null, function(code,data){
|
||||||
dataObj['lesson'] = data;
|
dataObj['lesson'] = data;
|
||||||
dataObj['teacher'] = teacherList;
|
dataObj['teacher'] = teacherList;
|
||||||
|
if(typeof (data) === 'undefined' || dataObj['lesson'].length == 0){
|
||||||
|
layer.msg('未查询到课程,请先添加课程');
|
||||||
|
return;
|
||||||
|
}
|
||||||
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
|
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
|
||||||
document.getElementById('lessonTbodyBox').innerHTML = html;
|
document.getElementById('lessonTbodyBox').innerHTML = html;
|
||||||
});
|
});
|
||||||
@ -278,6 +282,9 @@
|
|||||||
function initTeacherList(){
|
function initTeacherList(){
|
||||||
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
|
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
|
||||||
teacherList = data;
|
teacherList = data;
|
||||||
|
if(typeof (data) === 'undefined' || teacherList.length == 0){
|
||||||
|
layer.msg('当前机构没有讲师,请先在讲师管理中添加讲师');
|
||||||
|
}
|
||||||
},function(code,data){
|
},function(code,data){
|
||||||
top.dialog.msg(data.msg);
|
top.dialog.msg(data.msg);
|
||||||
});
|
});
|
||||||
|
@ -245,6 +245,9 @@
|
|||||||
function initTeacherList(orgId){
|
function initTeacherList(orgId){
|
||||||
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
|
top.restAjax.get(top.restAjax.path('api/teacher/list',[]), {orgId : orgId}, null, function(code,data){
|
||||||
teacherList = data;
|
teacherList = data;
|
||||||
|
if(typeof (data) === 'undefined' || teacherList.length == 0){
|
||||||
|
layer.msg('当前机构没有讲师,请先在讲师管理中添加讲师');
|
||||||
|
}
|
||||||
initLessonsList();
|
initLessonsList();
|
||||||
},function(code,data){
|
},function(code,data){
|
||||||
top.dialog.msg(data.msg);
|
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){
|
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId,orgId : orgId}, null, function(code,data){
|
||||||
dataObj['lesson'] = data;
|
dataObj['lesson'] = data;
|
||||||
dataObj['teacher'] = teacherList;
|
dataObj['teacher'] = teacherList;
|
||||||
|
if(typeof (data) === 'undefined' || dataObj['lesson'].length == 0){
|
||||||
|
layer.msg('未查询到课程,请先添加课程');
|
||||||
|
return;
|
||||||
|
}
|
||||||
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
|
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
|
||||||
document.getElementById('lessonTbodyBox').innerHTML = html;
|
document.getElementById('lessonTbodyBox').innerHTML = html;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user