//加载 $(function () { //非负浮点数(/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/) var reg = /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/; var learnSystem = $("#LearnSystem").val(); if (learnSystem == "" || learnSystem == null) { $("#LearnSystem").val(""); } else { if (!reg.test(learnSystem)) { $("#LearnSystem").val(""); } else { $("#LearnSystem").val(parseFloat(learnSystem).toFixed(1)); } } $("#Credit").val(parseFloat($("#Credit").val())); $("#TheoryCourse").keyup(function () { recalculate(); }); $("#Practicehours").keyup(function () { recalculate(); }); $("#TheoryWeeklyNum").keyup(function () { recalculate(); }); $("#PracticeWeeklyNum").keyup(function () { recalculate(); }); $("#teachingSettingExpander").closest("tr") .next().css("display", "") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none"); $("#teachingSettingExpander").attr("expanded", "1"); $("#otherExpander").closest("tr") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "") .next().css("display", "") .next().css("display", "none") .next().css("display", "none"); $("#otherExpander").attr("expanded", "1"); }); //相关计算 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 swapTeachingSetting() { if ($("#teachingSettingExpander").attr("expanded") == "1") { $("#teachingSettingExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0"); $("#teachingSettingExpander").closest("tr") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", ""); $("#teachingSettingExpander").attr("expanded", "0"); } else { $("#teachingSettingExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0"); $("#teachingSettingExpander").closest("tr") .next().css("display", "") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none"); $("#teachingSettingExpander").attr("expanded", "1"); } } //点击收缩(其它信息) function swapother() { if ($("#otherExpander").attr("expanded") == "1") { $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0"); $("#otherExpander").closest("tr") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", "") .next().css("display", ""); $("#otherExpander").attr("expanded", "0"); } else { $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0"); $("#otherExpander").closest("tr") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "none") .next().css("display", "") .next().css("display", "") .next().css("display", "none") .next().css("display", "none"); $("#otherExpander").attr("expanded", "1"); } } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //联动 function queryGrademajor(data) { var grademajorID = $("#GrademajorID").combogridX("getValue"); if (grademajorID == "" || grademajorID == "-1" || grademajorID == null) { $("#GradeID").combobox("setValue", "-1"); $("#StandardCode").val(""); $("#StandardID").combobox("setValue", "-1"); $("#EducationID").combobox("setValue", "-1"); $("#LearningformID").combobox("setValue", "-1"); $("#LearnSystem").val(""); } else { $("#GradeID").combobox("setValue", data.SchoolyearID); $("#StandardCode").val(data.StandardCode); $("#StandardID").combobox("setValue", data.StandardID); $("#EducationID").combobox("setValue", data.EducationID); $("#LearningformID").combobox("setValue", data.LearningformID); $("#LearnSystem").val(data.LearnSystem); } } //提交(审核) function PlanApplicationApprove_Submit() { if ($("input[name='TeachingModeIDList']:checked").length == 0) { $.messager.alert("系统提示", "授课方式不能为空。"); return; } var actionValue = $("#ddlAction").combobox("getValue"); if (actionValue == "-1" || actionValue == "") { $.messager.alert("系统提示", "必须选择一个动作才能提交。"); return; } $(document.forms[0]).submit(); }