排课管理-添加

beetlsql3-dev
姚丹ab 2 years ago
parent 23d4f96654
commit a0056ce314

@ -94,6 +94,22 @@ layui.define([ 'form', 'laydate', 'table','courseInfoApi',"layedit"], function(e
$("select[name='courseLabelId']").empty(); $("select[name='courseLabelId']").empty();
form.render(); form.render();
} }
if(obj.value == '应用课程类'){
$("#appIsShow").css('display','block');
$("#testIsShow").css('display','none');
$("#courseIsShow").css('display','none');
}else if(obj.value == '考证课程类'){
$("#appIsShow").css('display','none');
$("#testIsShow").css('display','block');
$("#courseIsShow").css('display','none');
$("#addForm select[name='resourcesApplicationIds']").val("");
}else if(obj.value == '理论课程类'){
$("#appIsShow").css('display','none');
$("#testIsShow").css('display','none');
$("#courseIsShow").css('display','block');
$("#addForm select[name='resourcesApplicationIds']").val("");
}
}); });
exports('add',view); exports('add',view);
}); });

@ -14,20 +14,22 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
var classData = Common.getAjax('/jlw/schoolClass/getValues.json').data;//上课班级多选框data var classData = Common.getAjax('/jlw/schoolClass/getValues.json').data;//上课班级多选框data
// 是否多个教室 // 是否多个教室
var isMultipleSessionClass = function() { var isMultipleSessionClass = function () {
return $("#addForm input:radio[name='teacherOpenCourseScheduleSessionClassIsMultiple']:checked").val() 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 xmSeValue = $("#demo1").data('value');
var xmSeInitValue = []; var xmSeInitValue = [];
if(!$.isEmpty(xmSeValue)){ if (!$.isEmpty(xmSeValue)) {
if(xmSeValue.toString().indexOf(",")>=0){ if (xmSeValue.toString().indexOf(",") >= 0) {
xmSeValue.split(',').forEach(function (value) { xmSeValue.split(',').forEach(function (value) {
xmSeInitValue.push(parseInt(value)) xmSeInitValue.push(parseInt(value))
}); });
}else { } else {
xmSeInitValue.push(xmSeValue) xmSeInitValue.push(xmSeValue)
} }
} }
/*班级下拉多选*/ /*班级下拉多选*/
var demo1 = xmSelect.render({ var demo1 = xmSelect.render({
@ -43,9 +45,9 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
/*反显开课星期*/ /*反显开课星期*/
var weekDetail = $('#weekDetail').data('value'); var weekDetail = $('#weekDetail').data('value');
if(!$.isEmpty(weekDetail)){ if (!$.isEmpty(weekDetail)) {
weekDetail.split(',').forEach(function (value) { weekDetail.split(',').forEach(function (value) {
$("input:checkbox[value='"+value+"']").attr('checked','true'); $("input:checkbox[value='" + value + "']").attr('checked', 'true');
}) })
} }
kkJieciTableData = Common.getAjax('/jlw/teacherOpenCourseScheduleSessionTag/getValues.json').data;//开课节次数据表格 kkJieciTableData = Common.getAjax('/jlw/teacherOpenCourseScheduleSessionTag/getValues.json').data;//开课节次数据表格
@ -55,16 +57,16 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
}); });
var kkJieciTableValue = $('#kkJieciTable').data('value'); var kkJieciTableValue = $('#kkJieciTable').data('value');
if (!$.isEmpty(kkJieciTableValue)) { if (!$.isEmpty(kkJieciTableValue)) {
if(Object.keys(kkJieciTableValue).length >1){ if (Object.keys(kkJieciTableValue).length > 1) {
$("#moreRoom").attr('checked','true'); $("#moreRoom").attr('checked', 'true');
}else { } else {
$("#oneRoom").attr('checked','true'); $("#oneRoom").attr('checked', 'true');
} }
var data = Object.values(kkJieciTableValue); var data = Object.values(kkJieciTableValue);
kkJieciTableData.forEach(function (item,index){ kkJieciTableData.forEach(function (item, index) {
data.forEach(function (t,i) { data.forEach(function (t, i) {
t.forEach(function (e,key) { t.forEach(function (e, key) {
if(item.teacherOpenCourseScheduleSessionTagName == e.teacherOpenCourseScheduleSessionTagName){ if (item.teacherOpenCourseScheduleSessionTagName == e.teacherOpenCourseScheduleSessionTagName) {
item.teacherOpenCourseScheduleSessionTagStartTime = e.teacherOpenCourseScheduleSessionTagStartTime; item.teacherOpenCourseScheduleSessionTagStartTime = e.teacherOpenCourseScheduleSessionTagStartTime;
item.teacherOpenCourseScheduleSessionTagEndTime = e.teacherOpenCourseScheduleSessionTagEndTime; item.teacherOpenCourseScheduleSessionTagEndTime = e.teacherOpenCourseScheduleSessionTagEndTime;
item.teacherOpenCourseScheduleSessionClassId = Object.keys(kkJieciTableValue)[i] item.teacherOpenCourseScheduleSessionClassId = Object.keys(kkJieciTableValue)[i]
@ -73,11 +75,11 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
}); });
}); });
}); });
if(Object.keys(kkJieciTableValue).length === 0){ if (Object.keys(kkJieciTableValue).length === 0) {
merge(kkJieciTableData) merge(kkJieciTableData)
} }
}else{ } else {
$("#oneRoom").attr('checked','true'); $("#oneRoom").attr('checked', 'true');
} }
form.render();//刷新表单 form.render();//刷新表单
@ -88,9 +90,9 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
cellMinWidth: 100,*/ cellMinWidth: 100,*/
method: 'get', method: 'get',
data: kkJieciTableData data: kkJieciTableData
,limit: 10000, , limit: 10000,
page: false page: false
,size:"lg" , size: "lg"
, cols: [[ , cols: [[
{ {
@ -134,7 +136,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
, type: 'date' , type: 'date'
, calendar: true//显示节假日 , calendar: true//显示节假日
, trigger: 'click' , trigger: 'click'
,value: $('#teacherOpenCourseScheduleSessionStartDate').val() //必须遵循format参数设定的格式 , value: $('#teacherOpenCourseScheduleSessionStartDate').val() //必须遵循format参数设定的格式
}); });
/*合并列*/ /*合并列*/
@ -160,9 +162,9 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
}; };
form.on('select(select_teacherId)', function (obj) { form.on('select(select_teacherId)', function (obj) {
classData = Common.getAjax('/jlw/schoolClass/getValues.json',{teacherId: obj.value}).data;//上课班级多选框data classData = Common.getAjax('/jlw/schoolClass/getValues.json', {teacherId: obj.value}).data;//上课班级多选框data
demo1.update({ demo1.update({
data:classData data: classData
}) })
}); });
@ -195,17 +197,17 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
// item.teacherOpenCourseScheduleSessionClassId = obj.value; // item.teacherOpenCourseScheduleSessionClassId = obj.value;
// }); // });
// } // }
if(isMultipleSessionClass() === 'false') {//指定教室 if (isMultipleSessionClass() === 'false') {//指定教室
currentTableCache().forEach(function (item, index) { currentTableCache().forEach(function (item, index) {
item.teacherOpenCourseScheduleSessionClassId = obj.value; item.teacherOpenCourseScheduleSessionClassId = obj.value;
if($.isEmpty(obj.value)){ if ($.isEmpty(obj.value)) {
item.teacherOpenCourseScheduleSessionClassId ='' item.teacherOpenCourseScheduleSessionClassId = ''
} }
}); });
}else { } else {
currentTableCache()[$(this).parents("tr").data("index")].teacherOpenCourseScheduleSessionClassId = obj.value; currentTableCache()[$(this).parents("tr").data("index")].teacherOpenCourseScheduleSessionClassId = obj.value;
if($.isEmpty(obj.value)){ if ($.isEmpty(obj.value)) {
currentTableCache()[$(this).parents("tr").data("index")].teacherOpenCourseScheduleSessionClassId ='' currentTableCache()[$(this).parents("tr").data("index")].teacherOpenCourseScheduleSessionClassId = ''
} }
} }
}); });
@ -375,34 +377,40 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
var time = hours + ":" + minutes; var time = hours + ":" + minutes;
return time return time
} }
var view = { var view = {
init:function(){ init: function () {
Lib.initGenrealForm($("#addForm"),form); Lib.initGenrealForm($("#addForm"), form);
this.initSubmit(); this.initSubmit();
}, },
initSubmit:function(){ initSubmit: function () {
$("#addButton").click(function(){ $("#addButton").click(function () {
var teacherOpenCourseScheduleSessionId = $("#addForm input[name='teacherOpenCourseScheduleSessionId']").val(); var teacherOpenCourseScheduleSessionId = $("#addForm input[name='teacherOpenCourseScheduleSessionId']").val();
var scheduleSessionTitle = $("#addForm input[name='scheduleSessionTitle']").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 teacherOpenCourseId = $("#addForm select[name='teacherOpenCourseId']").val();
var teacherId = $("#addForm select[name='teacherId']").val(); var teacherId = $("#addForm select[name='teacherId']").val();
var schoolClassIds = demo1.getValue('value').join(","); var schoolClassIds = demo1.getValue('value').join(",");
var teacherOpenCourseScheduleSessionClassIsMultiple = $("#addForm input:radio[name='teacherOpenCourseScheduleSessionClassIsMultiple']:checked").val(); var teacherOpenCourseScheduleSessionClassIsMultiple = $("#addForm input:radio[name='teacherOpenCourseScheduleSessionClassIsMultiple']:checked").val();
// 构建后台所需要的开课节次List数据 // 构建后台所需要的开课节次List数据
var sessionTagListMap = {}; var sessionTagListMap = {};
//课程来源0教师开课课程1授权课程
var courseType = $("#addForm select[name='teacherOpenCourseId']").find("option:selected").attr("status");
currentTableCache().forEach(item => { currentTableCache().forEach(item => {
var sessionClassId = item.teacherOpenCourseScheduleSessionClassId; var sessionClassId = item.teacherOpenCourseScheduleSessionClassId;
var data = table.checkStatus('kkJieciTable').data; 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) {
if(sessionTagListMap.hasOwnProperty(sessionClassId)) { return;
}
if (sessionTagListMap.hasOwnProperty(sessionClassId)) {
sessionTagListMap[sessionClassId].push(item) sessionTagListMap[sessionClassId].push(item)
}else { } else {
(sessionTagListMap[sessionClassId] = []).push(item) (sessionTagListMap[sessionClassId] = []).push(item)
} }
}) })
var teacherOpenCourseScheduleSessionStartDate = $("#addForm input[name='teacherOpenCourseScheduleSessionStartDate']").val();
var teacherOpenCourseScheduleSessionStartDate = $("#addForm input[name='teacherOpenCourseScheduleSessionStartDate']").val(); var teacherOpenCourseScheduleSessionStartDate = $("#addForm input[name='teacherOpenCourseScheduleSessionStartDate']").val();
var teacherOpenCourseScheduleSessionWeekNum = $("#addForm input[name='teacherOpenCourseScheduleSessionWeekNum']").val(); var teacherOpenCourseScheduleSessionWeekNum = $("#addForm input[name='teacherOpenCourseScheduleSessionWeekNum']").val();
var teacherOpenCourseScheduleSessionOpenOnHolidays = $("#addForm input:radio[name='teacherOpenCourseScheduleSessionOpenOnHolidays']:checked").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}); layer.msg('排课标题未填写!!', {icon: 5});
return; return;
} }
console.log($.isEmpty(teacherOpenCourseId))
if ($.isEmpty(teacherOpenCourseId)) { if ($.isEmpty(teacherOpenCourseId)) {
layer.msg('开课未选!!', {icon: 5}); layer.msg('开课未选!!', {icon: 5});
return; return;
} }
if ($.isEmpty(courseInfoId)) {
/*if ($.isEmpty(courseInfoId)) {
layer.msg('课程未选!!', {icon: 5}); layer.msg('课程未选!!', {icon: 5});
return; return;
} }*/
if ($.isEmpty(teacherId)) { if ($.isEmpty(teacherId)) {
layer.msg('上课教师未选!!', {icon: 5}); layer.msg('上课教师未选!!', {icon: 5});
@ -456,15 +466,12 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
return; return;
} }
layer.load(0, {
shadeClose: false,
shade: [0.5]
});
var param = { var param = {
scheduleSessionTitle: scheduleSessionTitle, scheduleSessionTitle: scheduleSessionTitle,
teacherOpenCourseScheduleSessionId: teacherOpenCourseScheduleSessionId, teacherOpenCourseScheduleSessionId: teacherOpenCourseScheduleSessionId,
teacherOpenCourseId: teacherOpenCourseId, teacherOpenCourseId: teacherOpenCourseId,
courseInfoId:courseInfoId, courseType: courseType,
teacherId: teacherId, teacherId: teacherId,
schoolClassIdPlural: schoolClassIds, schoolClassIdPlural: schoolClassIds,
teacherOpenCourseScheduleSessionClassIsMultiple: teacherOpenCourseScheduleSessionClassIsMultiple, teacherOpenCourseScheduleSessionClassIsMultiple: teacherOpenCourseScheduleSessionClassIsMultiple,
@ -474,12 +481,14 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
openOnHolidays: teacherOpenCourseScheduleSessionOpenOnHolidays, openOnHolidays: teacherOpenCourseScheduleSessionOpenOnHolidays,
weekDetail: teacherOpenCourseScheduleSessionTagWeek, weekDetail: teacherOpenCourseScheduleSessionTagWeek,
}; };
var url = "/jlw/teacherOpenCourseScheduleSession/addSession.json"; var url = "/jlw/teacherOpenCourseScheduleSession/addSession.json";
if(!$.isEmpty(teacherOpenCourseScheduleSessionId)){ if (!$.isEmpty(teacherOpenCourseScheduleSessionId)) {
url = "/jlw/teacherOpenCourseScheduleSession/editSession.json"; url = "/jlw/teacherOpenCourseScheduleSession/editSession.json";
} }
setTimeout(function(){ layer.load(0, {shadeClose: false, shade: [0.5]});
var ret = Common.postJSON(url,JSON.stringify(param)); setTimeout(function () {
var ret = Common.postJSON(url, JSON.stringify(param));
layer.closeAll(); layer.closeAll();
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, { layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
offset: ['50%'], offset: ['50%'],
@ -492,14 +501,14 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
Lib.closeFrame(); Lib.closeFrame();
} }
}); });
},100); }, 100);
}); });
$("#addButton-cancel").click(function(){ $("#addButton-cancel").click(function () {
Lib.closeFrame(); Lib.closeFrame();
}); });
} }
}; };
exports('add',view); exports('add', view);
}); });

@ -134,12 +134,8 @@ layui.define([ 'form', 'laydate', 'table' ,'laytpl'], function(exports) {
var btn = $("#searchFormSearch"); var btn = $("#searchFormSearch");
btn.on('click', function () { btn.on('click', function () {
var data = $("#searchForm").serializeJson(); var data = $("#searchForm").serializeJson();
if(!$.isEmpty(data.teacherOpenCourseId)){ data.courseType = $("#searchForm select[name='teacherOpenCourseId']").find("option:selected").attr("status")||"";
data.courseType = data.teacherOpenCourseId.split('_')[1]; console.log(data.courseType)
data.teacherOpenCourseId = data.teacherOpenCourseId.split('_')[0];
}else {
data.courseType = "";
}
teacherOpenCourseScheduleSessionTable.reload({ teacherOpenCourseScheduleSessionTable.reload({
where: data, where: data,
page: { page: {

@ -14,7 +14,7 @@
// 传入的标签ID如果为空则生成规则 select_id_{标签name}_生成长度为10的字符串 // 传入的标签ID如果为空则生成规则 select_id_{标签name}_生成长度为10的字符串
var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.core.util.RandomUtil.randomString(10)); var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.core.util.RandomUtil.randomString(10));
--> -->
<select name="${name!''}" id="${newId ! ''}" lay-verify="" lay-search lay-filter="select_courseInfoIds"> <select name="${name!''}" id="${newId ! ''}" lay-verify="" lay-search lay-filter="select_courseInfoIds">
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
@ -32,7 +32,7 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c
// 考证课程类 // 考证课程类
var textualResearchCourseList = currentAuthCourseInfoDetails.textualResearchCourseList || []; var textualResearchCourseList = currentAuthCourseInfoDetails.textualResearchCourseList || [];
// 理论课程类+开课课程 // 理论课程类+开课课程
var theoryAddOpenCourseList = currentAuthCourseInfoDetails.theoryAddOpenCourseList||[]; var theoryAddOpenCourseList = currentAuthCourseInfoDetails.theoryAddOpenCourseList || [];
/** /**
* 分组模板: * 分组模板:
@ -48,25 +48,25 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c
* </select> * </select>
*/ */
// jq选择器 // jq选择器
var ele = $('#${newId}'); var ele = $('#${newId}');
// 过滤label // 过滤label
var filterNames = '${filterName!""}'; var filterNames = '${filterName!""}';
// 显示分组名称 // 显示分组名称
var isShowGroupName = '${isShowGroupName!""}'; var isShowGroupName = '${isShowGroupName!""}';
// 给定默认值 // 给定默认值
var defaultValue = '${defaultValue!""}'; var defaultValue = '${defaultValue!""}';
//显示开课课程 //显示开课课程
var isShowOpentCourse = '${isShowOpentCourse!false}'; var isShowOpentCourse = '${isShowOpentCourse!false}';
// 下拉框选中的事件 // 下拉框选中的事件
var selectedHandler = function(val) { var selectedHandler = function (val) {
return defaultValue.trim() == val.trim() ? 'selected = "selected"' : ''; return defaultValue.trim() == val.trim() ? 'selected = "selected"' : '';
} }
// 是否显示分组名称的事件 // 是否显示分组名称的事件
var isShowGroupNameHandler = function() { var isShowGroupNameHandler = function () {
return isShowGroupName == 'true'; return isShowGroupName == 'true';
} // 是否显示分组名称的事件 } // 是否显示分组名称的事件
var isShowOpentCourseHandler = function() { var isShowOpentCourseHandler = function () {
return isShowOpentCourse == 'true'; return isShowOpentCourse == 'true';
} }
@ -76,7 +76,7 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c
for (let currentAuthCourseInfoDetail of applicationCourseList) { for (let currentAuthCourseInfoDetail of applicationCourseList) {
var cid = currentAuthCourseInfoDetail.courseInfoId || '-1'; var cid = currentAuthCourseInfoDetail.courseInfoId || '-1';
var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据'; var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据';
ele.append('<option value="'+ cid +'"' + selectedHandler(cid) +' >'+ ciName +'</option>') ele.append('<option value="' + cid + '"' + selectedHandler(cid) + ' >' + ciName + '</option>')
} }
if (isShowGroupNameHandler()) ele.append('</optgroup>'); if (isShowGroupNameHandler()) ele.append('</optgroup>');
} }
@ -84,17 +84,19 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c
if (filterNames.indexOf('理论课程类') >= 0 || filterNames === "") { if (filterNames.indexOf('理论课程类') >= 0 || filterNames === "") {
if (isShowGroupNameHandler()) ele.append('<optgroup label="理论课程类">'); if (isShowGroupNameHandler()) ele.append('<optgroup label="理论课程类">');
if(isShowOpentCourseHandler()){ if (isShowOpentCourseHandler()) {
for (let currentAuthCourseInfoDetail of theoryAddOpenCourseList) { for (let currentAuthCourseInfoDetail of theoryAddOpenCourseList) {
var cid = currentAuthCourseInfoDetail.courseId+'_'+currentAuthCourseInfoDetail.courseType || '-1';
var ciName = currentAuthCourseInfoDetail.courseName || '未查询到数据'; var cid = currentAuthCourseInfoDetail.courseId || '-1';
ele.append('<option value="'+ cid +'"' + selectedHandler(cid) +' >'+ ciName +'</option>') var cName = currentAuthCourseInfoDetail.courseName || '未查询到数据';
var cStatus = currentAuthCourseInfoDetail.courseType;
ele.append('<option value="' + cid + '"' + selectedHandler(cid) + ' status="'+cStatus+'">' + cName + '</option>')
} }
}else { } else {
for (let currentAuthCourseInfoDetail of theoryCourseList) { for (let currentAuthCourseInfoDetail of theoryCourseList) {
var cid = currentAuthCourseInfoDetail.courseInfoId || '-1'; var cid = currentAuthCourseInfoDetail.courseInfoId || '-1';
var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据'; var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据';
ele.append('<option value="'+ cid +'"' + selectedHandler(cid) +' >'+ ciName +'</option>') ele.append('<option value="' + cid + '"' + selectedHandler(cid) + ' >' + ciName + '</option>')
} }
} }
@ -106,7 +108,7 @@ var newId = !isEmpty(id) ? id : ('select_id_' + (name!'0') + '_' + @cn.hutool.c
for (let currentAuthCourseInfoDetail of textualResearchCourseList) { for (let currentAuthCourseInfoDetail of textualResearchCourseList) {
var cid = currentAuthCourseInfoDetail.courseInfoId || '-1'; var cid = currentAuthCourseInfoDetail.courseInfoId || '-1';
var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据'; var ciName = currentAuthCourseInfoDetail.courseInfoName || '未查询到数据';
ele.append('<option value="'+ cid +'"' + selectedHandler(cid) +' >'+ ciName +'</option>') ele.append('<option value="' + cid + '"' + selectedHandler(cid) + ' >' + ciName + '</option>')
} }
if (isShowGroupNameHandler()) ele.append('</optgroup>'); if (isShowGroupNameHandler()) ele.append('</optgroup>');
} }

@ -7,7 +7,7 @@
<div class="layui-row" style="margin-left: 80px;"> <div class="layui-row" style="margin-left: 80px;">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
课程管理/新增课程 课程绑定/编辑
</div> </div>
</div> </div>
</div> </div>
@ -23,17 +23,15 @@
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <label class="layui-form-label"><span class="req">*</span>课程类别:</label>
<label class="layui-form-label"><span class="req">*</span>课程类别:</label> <div class="layui-input-inline">
<div class="layui-input-inline"> <!-- '应用课程类','考证课程类','理论课程类';-->
<!-- '应用课程类','考证课程类','理论课程类';--> <select lay-filter="select_courseLabelType">
<select lay-filter="select_courseLabelType"> <option value="">请选择</option>
<option value="">请选择</option> <option value="应用课程类" ${courseInfo.courseLabelType =='应用课程类'?'selected':''}>应用课程类</option>
<option value="应用课程类" ${courseInfo.courseLabelType =='应用课程类'?'selected':''}>应用课程类</option> <option value="考证课程类" ${courseInfo.courseLabelType =='考证课程类'?'selected':''}>考证课程类</option>
<option value="考证课程类" ${courseInfo.courseLabelType =='考证课程类'?'selected':''}>考证课程类</option> <option value="理论课程类" ${courseInfo.courseLabelType =='理论课程类'?'selected':''}>理论课程类</option>
<option value="理论课程类" ${courseInfo.courseLabelType =='理论课程类'?'selected':''}>理论课程类</option> </select>
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -53,31 +51,47 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-item"> <div class="layui-form-item">
<!--<input name="resourcesApplicationIds" type="hidden" value="${courseInfo.resourcesApplicationIds}" />--> <!--<input name="resourcesApplicationIds" type="hidden" value="${courseInfo.resourcesApplicationIds}" />-->
<label class="layui-form-label"><span class="req">*</span>绑定应用:</label> <label class="layui-form-label"><span class="req">*</span>绑定应用:</label>
<!-- <div class="layui-input-block" style="margin-left: 180px;">-->
<!-- <div id="transfer" class="demo-transfer"></div>--> <div ${courseInfo.courseLabelType=='应用课程类'?'':'style="display:none"'} id="appIsShow">
<!-- </div>--> <layui:simpleDictSelect style='layui-input-inline'
<layui:simpleDictSelect style='layui-input-inline' value="${courseInfo.resourcesApplicationIds}"
value="${courseInfo.resourcesApplicationIds}" layFilter="select_resourcesApplicationIds"
layFilter="select_resourcesApplicationIds" type="resources_application.application_name.1=1"
type="resources_application.application_name.1=1" id="resourcesApplicationIds" name="resourcesApplicationIds"/>
id="resourcesApplicationIds" name="resourcesApplicationIds"/> </div>
<div class="layui-input-inline" id="testIsShow" ${courseInfo.courseLabelType=='考证课程类'?'':'style="display:none"'}>
<div class="layui-input-inline"><select lay-verify="">
<option value="">请选择</option>
<option value="考证辅导" selected>考证辅导</otion>
</select></div>
</div>
<div class="layui-input-inline" id="courseIsShow" ${courseInfo.courseLabelType=='理论课程类'?'':'style="display:none"'}>
<select lay-verify="" class="layui-input-inline">
<option value="">请选择</option>
<option value="课程中心" selected>课程中心</option>
</select>
</div>
</div> </div>
</div> </div>
<input type="hidden" name="courseInfoId" value='${courseInfo.courseInfoId}' /> <input type="hidden" name="courseInfoId" value='${courseInfo.courseInfoId}' />
<!--类型(1课程 2章 3节)--> <!--类型(1课程 2章 3节)-->
<input type="hidden" name="courseInfoType" value='1' /> <input type="hidden" name="courseInfoType" value='1' />
</form> </form>
<!--#} --> <!--#} -->
<script> <script>
layui.use(['add','upload'], function(){ layui.use(['add','upload','form'], function(){
var courseInfoAdd = layui.add; var courseInfoAdd = layui.add;
var upload = layui.upload; var upload = layui.upload;
var form = layui.form;
courseInfoAdd.init(); courseInfoAdd.init();
//上传LOGO //上传LOGO
upload.render({ upload.render({
@ -89,5 +103,23 @@ layui.use(['add','upload'], function(){
$("input[name='courseInfoThumbnail']").val(res.data.src); $("input[name='courseInfoThumbnail']").val(res.data.src);
} }
}); });
/*form.on('select(select_courseLabelType)', function(data){
if(data.value == '应用课程类'){
$("#appIsShow").css('display','block')
$("#testIsShow").css('display','none')
$("#courseIsShow").css('display','none')
}else if(data.value == '考证课程类'){
$("#appIsShow").css('display','none')
$("#testIsShow").css('display','block')
$("#courseIsShow").css('display','none')
}else if(data.value == '理论课程类'){
$("#appIsShow").css('display','none')
$("#testIsShow").css('display','none')
$("#courseIsShow").css('display','block')
}
console.log(data.elem); //得到select原始DOM对象
console.log(data.value); //得到被选中的值
console.log(data.othis); //得到美化后的DOM对象
});*/
}); });
</script> </script>

@ -49,29 +49,15 @@
<!--#if(user.get().isAdmin){ --> <!--#if(user.get().isAdmin){ -->
<!--#// 查询授权的课程列表。自动根据身份判断 isSignRole.get()!'' :1admin+管理员 2:uniAdmin学院管理员 3:teacher 4student--> <!--#// 查询授权的课程列表。自动根据身份判断 isSignRole.get()!'' :1admin+管理员 2:uniAdmin学院管理员 3:teacher 4student-->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId_1", "id": "courseInfoId", "isShowGroupName": "true", "defaultValue":teacherOpenCourseScheduleSession.courseInfoId, isShowOpentCourse:"true"}) {} --> <!--#layout("/common/courseInfoSelect.html",{"name":"teacherOpenCourseId", "id": "teacherOpenCourseId", "isShowGroupName": "true", "defaultValue":teacherOpenCourseScheduleSession.teacherOpenCourseId+"", isShowOpentCourse:"true"}) {} -->
<!--#}else{ --> <!--#}else{ -->
<!--#layout("/common/courseInfoSelect.html",{"name":"courseInfoId_1", "id": "courseInfoId", "isShowGroupName": "false","filterName": "理论课程类", "defaultValue":teacherOpenCourseScheduleSession.courseInfoId, isShowOpentCourse:"true"}) {} --> <!--#layout("/common/courseInfoSelect.html",{"name":"teacherOpenCourseId", "id": "teacherOpenCourseId", "isShowGroupName": "false","filterName": "理论课程类", "defaultValue":teacherOpenCourseScheduleSession.teacherOpenCourseId, isShowOpentCourse:"true"}) {} -->
<!--#} --> <!--#} -->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!--<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">课程名称</label>
<div class="layui-input-block" style="width: 400px;">
<layui:simpleDictSelect style='layui-input-inline'
type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1,${user.get().isAdmin ? '1=1' : 'find_in_set(org_id, ' + user.get().orgId + ')'}"
id="teacherOpenCourseId" name="teacherOpenCourseId"
value="${teacherOpenCourseScheduleSession.teacherOpenCourseId}" layVerify=""
layFilter="select_teacherOpenCourseId"/>
</div>
</div>
</div>
</div>-->
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">

Loading…
Cancel
Save