var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) function validChoose() { var d = []; $.each($("#dgEducationSchedulingAdjustmentList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } function startTimeChanged(dp) { $("#txtStartTime").val($dp.cal.getNewDateStr()); reload(); } function endTimeChanged(dp) { $("#txtEndTime").val($dp.cal.getNewDateStr()); reload(); } function reload() { $("#dgEducationSchedulingAdjustmentList").cmsXDataTable("load", $.getDataGridParams("dgEducationSchedulingAdjustmentList")); } function queryTeacher(data) { try { var jsonString = "({'QueryParamsDatas':'"; var collegeID = $("#ddlCollege").combobox("getValue"); if (collegeID != nonSelect) { jsonString += "CollegeDropdown|*|" + collegeID + "|@|"; } jsonString += "'})"; $("#cgbTeacher").combogridX("reload", eval(jsonString)); reload(); } catch (e) { } } function EducationSchedulingAdjustment_Add() { $.popupTopWindow('新增调课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/Adjustment?MNU=' + mnu, 1024, 768, reload, null); } function EducationSchedulingAdjustment_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择要修改的记录。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } if (d[0].RecordStatus != startStatusID && $.grep(backpointIDList, function (x) { return x == d[0].RecordStatus }).length == 0) { $.messager.alert("系统提示", "该记录已经提交,无法修改。"); return; } $.popupTopWindow('修改调课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/AdjustmentEdit?EducationSchedulingAdjustmentID=' + d[0].EducationSchedulingAdjustmentID + "&MNU=" + mnu, 800, 420, reload, null); } function EducationSchedulingAdjustment_Delete() { var d = $.map(validChoose(), function (x) { return x.EducationSchedulingAdjustmentID; }).join(','); if (d.length == 0) { $.messager.alert("系统提示", "请选择要删除的记录。"); return; } $.postWithLoading('/EducationSchedule/AdjustmentDelete', { educationSchedulingAdjustmentIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "删除成功!"); reload(); } else { $.messager.alert("系统提示", data.Message); } }); } function EducationSchedulingAdjustment_Submit() { var d = $.map(validChoose(), function (x) { return x.EducationSchedulingAdjustmentID; }).join(','); if (d.length == 0) { $.messager.alert("系统提示", "请选择要提交的记录。"); return; } $.postWithLoading('/EducationSchedule/AdjustmentSubmit', { educationSchedulingAdjustmentIDs: d }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "提交成功!"); reload(); } else { $.messager.alert("系统提示", data.Message.replace(/;/g, '
')); } }); } function EducationSchedulingAdjustment_Excel() { var d = validChoose(); if (d.length == 0) { $("[name='hidEducationSchedulingAdjustmentID']").val(""); } else { $("[name='hidEducationSchedulingAdjustmentID']").val($.map(d, function (x) { return x.EducationSchedulingAdjustmentID; }).join(',')) } $("#formQuery").submit(); }