diff --git a/admin-core/src/main/resources/static/js/common.js b/admin-core/src/main/resources/static/js/common.js index 141302ea..6c5e20d7 100644 --- a/admin-core/src/main/resources/static/js/common.js +++ b/admin-core/src/main/resources/static/js/common.js @@ -138,60 +138,6 @@ var Common = { error: function (info) { Common.openConfirm(info) }, - post: function (url, paras, next) { - $.ajax({ - url: Common.ctxPath + url, - type: "POST", - data: paras, - success: function (rsp) { - if (rsp.code != 0) { - Common.error(rsp.msg); - } else { - //成功 - if (next != null) { - next(rsp.data); - } else { - Common.success(rsp.responseJSON.msg); - } - } - }, - error: function (rsp) { - if(rsp.responseJSON && rsp.responseJSON.msg) - Common.error(rsp.responseJSON.msg); - else - Common.error('服务器错误,请联系管理员'); - } - }) - - }, - postJSON: function (url, paras, next) { - $.ajax({ - url: Common.ctxPath + url, - type: "POST", - contentType:'application/json;charset=utf-8', - dataType:'json', - data: paras, - success: function (rsp) { - if (rsp.code != 0) { - Common.error(rsp.msg); - } else { - //成功 - if (next != null) { - next(rsp.data); - } else { - Common.success(rsp.msg || rsp.responseJSON.msg); - } - } - }, - error: function (rsp) { - if(rsp.responseJSON && rsp.responseJSON.msg) - Common.error(rsp.responseJSON.msg); - else - Common.error('服务器错误,请联系管理员'); - } - }) - - }, downLoad: function (url, data, method) { if(!method) { method = 'POST'; @@ -344,7 +290,66 @@ var Common = { } } - }, postAjax: function (url, paras) { + }, + post: function (url, paras, next) { + $.ajax({ + url: Common.ctxPath + url, + type: "POST", + data: paras, + success: function (rsp) { + if (rsp.code != 0) { + Common.error(rsp.msg); + } else { + //成功 + if (next != null) { + next(rsp.data); + } else { + Common.success(rsp.responseJSON.msg); + } + } + }, + error: function (rsp) { + if(rsp.responseJSON && rsp.responseJSON.msg) + Common.error(rsp.responseJSON.msg); + else + Common.error('服务器错误,请联系管理员'); + } + }) + + }, + postJSON: function (url, paras, next) { + var r = ""; + $.ajax({ + url: Common.ctxPath + url, + type: "POST", + contentType:'application/json;charset=utf-8', + dataType:'json', + data: paras, + async: false, + success: function (rsp) { + r = rsp; + if (rsp.code != 0) { + Common.error(rsp.msg); + } else { + //成功 + if (next != null) { + next(rsp.data); + } else { + Common.success(rsp.msg || rsp.responseJSON.msg); + } + } + }, + error: function (rsp) { + r = rsp.responseJSON; + if(rsp.responseJSON && rsp.responseJSON.msg) + Common.error(rsp.responseJSON.msg); + else + Common.error('服务器错误,请联系管理员'); + } + }) + return r; + }, + postAjax: function (url, paras) { var r = ""; $.ajax({ url: Common.ctxPath + url, @@ -362,7 +367,8 @@ var Common = { } }); return r; - },getAjax: function (url, paras) { + }, + getAjax: function (url, paras) { var r = ""; $.ajax({ url: Common.ctxPath + url, @@ -380,7 +386,8 @@ var Common = { } }); return r; - },stateMatching:function (state,sign){ //state状态(-1:作废 0:计划换线 1:待换/护线 2:换/护线中 3:待检验 4:检验中 5:样件通过 6:检验不通过 7:待填单) sign类型(1换线 2护线) + }, + stateMatching:function (state,sign){ //state状态(-1:作废 0:计划换线 1:待换/护线 2:换/护线中 3:待检验 4:检验中 5:样件通过 6:检验不通过 7:待填单) sign类型(1换线 2护线) var text = sign == 1?"换线":"护线"; return state == -1 ? text + "作废" : state == 0 ? "计划" + text : diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js index da263a67..8bfb59c4 100644 --- a/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js +++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseScheduleSession/add.js @@ -36,6 +36,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule color: '#1e9fff', },*/ }); + /*反显开课星期*/ var weekDetail = $('#weekDetail').data('value'); if(!$.isEmpty(weekDetail)){ @@ -43,8 +44,12 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule $("input:checkbox[value='"+value+"']").attr('checked','true'); }) } - if(!$.isEmpty(teacherOpenCourseScheduleSessionId)){ - $('#kkJieciTable').data('value') + var kkJieciTableValue = $('#kkJieciTable').data('value'); + if (!$.isEmpty(kkJieciTableValue)) { + //kkJieciTableData + console.log(kkJieciTableValue) + console.log(Object.values(kkJieciTableValue)) + } form.render();//刷新表单 @@ -431,20 +436,12 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule url = "/jlw/teacherOpenCourseScheduleSession/editSession.json"; } var ret = Common.postJSON(url,JSON.stringify(param)); - layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, { - offset: ['50%'], - icon: ret.code == 0 ? 1 : 2, - time: 1500 //2秒关闭(如果不配置,默认是3秒) - }, function () { - layer.closeAll("loading"); - if (ret.code == 0) { - parent.Lib.tableRefresh(); - Lib.closeFrame(); - } - }); + if (ret.code == 0) { + parent.Lib.tableRefresh(); + Lib.closeFrame(); + } }); - $("#addButton-cancel").click(function(){ Lib.closeFrame(); }); diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html index 67e023f8..cd3c93ee 100644 --- a/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html +++ b/web/src/main/resources/templates/jlw/teacherOpenCourseScheduleSession/add.html @@ -34,9 +34,9 @@