|
|
|
@ -17,7 +17,9 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
var isMultipleSessionClass = function () {
|
|
|
|
|
return $("#addForm input:radio[name='teacherOpenCourseScheduleSessionClassIsMultiple']:checked").val()
|
|
|
|
|
};
|
|
|
|
|
var currentTableCache = function() {return table.cache['kkJieciTable']};
|
|
|
|
|
var currentTableCache = function () {
|
|
|
|
|
return table.cache['kkJieciTable']
|
|
|
|
|
};
|
|
|
|
|
var xmSeValue = $("#demo1").data('value');
|
|
|
|
|
var xmSeInitValue = [];
|
|
|
|
|
if (!$.isEmpty(xmSeValue)) {
|
|
|
|
@ -375,6 +377,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
var time = hours + ":" + minutes;
|
|
|
|
|
return time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var view = {
|
|
|
|
|
init: function () {
|
|
|
|
|
Lib.initGenrealForm($("#addForm"), form);
|
|
|
|
@ -384,25 +387,30 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
$("#addButton").click(function () {
|
|
|
|
|
var teacherOpenCourseScheduleSessionId = $("#addForm input[name='teacherOpenCourseScheduleSessionId']").val();
|
|
|
|
|
var scheduleSessionTitle = $("#addForm input[name='scheduleSessionTitle']").val();
|
|
|
|
|
var courseInfoId =$("#addForm select[name='courseInfoId_1']").val();
|
|
|
|
|
/*var courseInfoId =$("#addForm select[name='courseInfoId_1']").val();*/
|
|
|
|
|
var teacherOpenCourseId = $("#addForm select[name='teacherOpenCourseId']").val();
|
|
|
|
|
var teacherId = $("#addForm select[name='teacherId']").val();
|
|
|
|
|
var schoolClassIds = demo1.getValue('value').join(",");
|
|
|
|
|
var teacherOpenCourseScheduleSessionClassIsMultiple = $("#addForm input:radio[name='teacherOpenCourseScheduleSessionClassIsMultiple']:checked").val();
|
|
|
|
|
// 构建后台所需要的开课节次List数据
|
|
|
|
|
var sessionTagListMap = {};
|
|
|
|
|
//课程来源:0:教师开课课程,1:授权课程
|
|
|
|
|
var courseType = $("#addForm select[name='teacherOpenCourseId']").find("option:selected").attr("status");
|
|
|
|
|
|
|
|
|
|
currentTableCache().forEach(item => {
|
|
|
|
|
var sessionClassId = item.teacherOpenCourseScheduleSessionClassId;
|
|
|
|
|
var data = table.checkStatus('kkJieciTable').data;
|
|
|
|
|
if((item.LAY_CHECKED != true&&data.length > 0)||!sessionClassId) { return;}
|
|
|
|
|
if ((item.LAY_CHECKED != true && data.length > 0) || !sessionClassId) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (sessionTagListMap.hasOwnProperty(sessionClassId)) {
|
|
|
|
|
sessionTagListMap[sessionClassId].push(item)
|
|
|
|
|
} else {
|
|
|
|
|
(sessionTagListMap[sessionClassId] = []).push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
var teacherOpenCourseScheduleSessionStartDate = $("#addForm input[name='teacherOpenCourseScheduleSessionStartDate']").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var teacherOpenCourseScheduleSessionStartDate = $("#addForm input[name='teacherOpenCourseScheduleSessionStartDate']").val();
|
|
|
|
|
var teacherOpenCourseScheduleSessionWeekNum = $("#addForm input[name='teacherOpenCourseScheduleSessionWeekNum']").val();
|
|
|
|
|
var teacherOpenCourseScheduleSessionOpenOnHolidays = $("#addForm input:radio[name='teacherOpenCourseScheduleSessionOpenOnHolidays']:checked").val();
|
|
|
|
@ -414,14 +422,16 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
layer.msg('排课标题未填写!!', {icon: 5});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
console.log($.isEmpty(teacherOpenCourseId))
|
|
|
|
|
if ($.isEmpty(teacherOpenCourseId)) {
|
|
|
|
|
layer.msg('开课未选!!', {icon: 5});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($.isEmpty(courseInfoId)) {
|
|
|
|
|
|
|
|
|
|
/*if ($.isEmpty(courseInfoId)) {
|
|
|
|
|
layer.msg('课程未选!!', {icon: 5});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
if ($.isEmpty(teacherId)) {
|
|
|
|
|
layer.msg('上课教师未选!!', {icon: 5});
|
|
|
|
@ -456,15 +466,12 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
layer.load(0, {
|
|
|
|
|
shadeClose: false,
|
|
|
|
|
shade: [0.5]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var param = {
|
|
|
|
|
scheduleSessionTitle: scheduleSessionTitle,
|
|
|
|
|
teacherOpenCourseScheduleSessionId: teacherOpenCourseScheduleSessionId,
|
|
|
|
|
teacherOpenCourseId: teacherOpenCourseId,
|
|
|
|
|
courseInfoId:courseInfoId,
|
|
|
|
|
courseType: courseType,
|
|
|
|
|
teacherId: teacherId,
|
|
|
|
|
schoolClassIdPlural: schoolClassIds,
|
|
|
|
|
teacherOpenCourseScheduleSessionClassIsMultiple: teacherOpenCourseScheduleSessionClassIsMultiple,
|
|
|
|
@ -474,10 +481,12 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
|
|
|
|
|
openOnHolidays: teacherOpenCourseScheduleSessionOpenOnHolidays,
|
|
|
|
|
weekDetail: teacherOpenCourseScheduleSessionTagWeek,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var url = "/jlw/teacherOpenCourseScheduleSession/addSession.json";
|
|
|
|
|
if (!$.isEmpty(teacherOpenCourseScheduleSessionId)) {
|
|
|
|
|
url = "/jlw/teacherOpenCourseScheduleSession/editSession.json";
|
|
|
|
|
}
|
|
|
|
|
layer.load(0, {shadeClose: false, shade: [0.5]});
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
var ret = Common.postJSON(url, JSON.stringify(param));
|
|
|
|
|
layer.closeAll();
|
|
|
|
|