function OptionalCoursePlan_Save() { if ($("input[name='TeachingModeID']:checked").length == 0) { $.messager.alert("系统提示", "请选择至少一种授课方式。"); return; } if (parseInt($("#PeopleNumlower").val()) > parseInt($("#PeopleNumlimit").val())) { $.messager.alert("系统信息", "人数上限不能小于下限。"); return; } if (!isNaN($("#Trialhours").val()) && $("#Trialhours").val() != "" && !isNaN($("#Practicehours").val()) && $("#Practicehours").val() != "" && parseFloat($("#Trialhours").val()) > parseFloat($("#Practicehours").val())) { $.messager.alert("系统提示", "实验学时不能大于实践学时。"); return; } if (!isNaN($("#TrialWeeklyNum").val()) && $("#TrialWeeklyNum").val() != "" && !isNaN($("#PracticeWeeklyNum").val()) && $("#PracticeWeeklyNum").val() != "" && parseFloat($("#TrialWeeklyNum").val()) > parseFloat($("#PracticeWeeklyNum").val())) { $.messager.alert("系统提示", "实验周次不能大于实践周次。"); return; } $(document.forms[0]).submit(); } $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); $("#Credit").val(parseFloat($("#Credit").val()).toFixed(1)); $("#TheoryCourse").keyup(function () { recalculate(); }); $("#Practicehours").keyup(function () { recalculate(); }); $("#TheoryWeeklyNum").keyup(function () { recalculate(); }); $("#PracticeWeeklyNum").keyup(function () { recalculate(); }); // if (document.getElementById("RecordStatusName") != "未提交") // document.getElementById("IsOpened").disabled = true; // else // document.getElementById("IsOpened").disabled = false; }); function swapWeekSettings() { if ($("#weekExpander").attr("expanded") == "0") { $("#weekExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0"); $("#weekExpander").closest("tr") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", ""); $("#weekExpander").attr("expanded", "1"); } else { $("#weekExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0"); $("#weekExpander").closest("tr") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none"); $("#weekExpander").attr("expanded", "0"); } } function recalculate() { var theoryCourse = parseInt($("#TheoryCourse").val() == "" ? "0" : $("#TheoryCourse").val()); var practicehours = parseInt($("#Practicehours").val() == "" ? "0" : $("#Practicehours").val()); var theoryWeeklyNum = parseInt($("#TheoryWeeklyNum").val() == "" ? "0" : $("#TheoryWeeklyNum").val()); var practiceWeeklyNum = parseInt($("#PracticeWeeklyNum").val() == "" ? "0" : $("#PracticeWeeklyNum").val()); var totalHours = theoryCourse + practicehours; var totalWeeklyNum = theoryWeeklyNum + practiceWeeklyNum; var weeklyHours = totalHours / totalWeeklyNum; var weeklyNum = weeklyHours / 2; $("#Totalhours").val(totalHours); if (totalWeeklyNum != 0) { $("#SchoolweeksNum").val(totalWeeklyNum); $("#WeeklyHours").val(weeklyHours); $("#WeeklyNum").val(weeklyNum); } } //function reload() { // $("#dgGrademajorAndSpecialtyCourseList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorAndSpecialtyCourseList")); //} //function QueryGrademajorGridOptions() { // reload(); //} ////获取选中的数据 //function validChoose() { // var d = []; // $.each($("#dgGrademajorAndSpecialtyCourseList").cmsXDataTable("getSelections"), function (index) { // d.push(this.SpecialtyCourseID); // }); // return d; //}