//刷新 function reload() { $("#dgSpecialtyCourseNoApplyList").cmsXDataTable("load", $.getDataGridParams("dgSpecialtyCourseNoApplyList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgSpecialtyCourseNoApplyList").cmsXDataTable("getSelections"), function (index) { d.push(this.SpecialtyCourseID); }); return d; } //获取选中的数据All function validChooseAll() { var d = []; $.each($("#dgSpecialtyCourseNoApplyList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //确定生成成功后不关闭弹出页面 function formSuccessReloadNoClose(data) { if (data.IsSuccess == true) { reload(); } $.messager.alert("系统提示", data.Message); } //计算规则(暂时不可用,需对以下计算进行优化) function SetTheoryWeeklyNum(rowindex, rowdata) { //总周时=理论学时+实践学时 //总周次=理论周次+实践周次 //周学时=总学时/总周次 //每周次数=周学时/2 var totalhours = (Number(rowdata.TheoryCourse) + Number(rowdata.Practicehours)); //总周时 var schoolweeksNum = (Number(rowdata.TheoryWeeklyNum) + Number(rowdata.PracticeWeeklyNum));//总周次 var weeklyHours = (Number(rowdata.Totalhours) / Number(rowdata.SchoolweeksNum)).toFixed(0);//周学时 var weeklyNum = (Number(rowdata.WeeklyHours / 2)).toFixed(0); //每周次数 var tableRow = $('#dgSpecialtyCourseNoApplyList').find("tr.row[xRowIndex=" + rowindex + "]"); $(tableRow.find("td")[9]).children().val(totalhours); $(tableRow.find("td")[13]).children().val(schoolweeksNum); $(tableRow.find("td")[14]).children().val(weeklyHours); $(tableRow.find("td")[15]).children().val(weeklyNum); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //联动查询 function queryCollege() { var collegeID = $("#CollegeDropdown").combogridX("getValue"); if (collegeID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})"; $("#DepartmentDropdown").combogridX("reload", eval(jsonString)); } else { $("#DepartmentDropdown").combogridX("reload"); } reload(); } function querySchoolyear(data) { $("#GrademajorID").combogridX("setValue", "-1"); queryClass(); } function queryStandard(data) { $("#GrademajorID").combogridX("setValue", "-1"); queryClass(); } function queryEducation(data) { $("#GrademajorID").combogridX("setValue", "-1"); queryClass(); } function queryLearningform(data) { $("#GrademajorID").combogridX("setValue", "-1"); queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue"); //combobox var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningFormID = $("#DictionaryLearningform").combogridX("getValue"); if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#DictionaryStandard").combogridX("reload", eval(jsonString)); $("#GrademajorID").combogridX("reload", eval(jsonString)); } else { $("#DictionaryStandard").combogridX("reload"); $("#GrademajorID").combogridX("reload"); } reload(); } //确定 function PlanApplicationBatchAdd_Confirm() { var grademajorID = $("#GrademajorID").combogridX("getValue"); if (grademajorID == "" || grademajorID == "-1" || grademajorID == null) { $.messager.alert("系统提示", "请选择要申请的年级专业信息。"); return; } var d = validChooseAll(); if (d == "") { $.messager.alert("系统提示", "请选择您要申请的信息。"); return; } //对选择申请的信息进行验证 var regA = /^\d+(\.{0,1}\d+){0,1}$/; //非负数 var regB = /^\d+$/; //非负整数 for (var i = 0; i < d.length; i++) { var credit = d[i].Credit; var theoryCourse = d[i].TheoryCourse; var practicehours = d[i].Practicehours; var trialhours = d[i].Trialhours; var theoryWeeklyNum = d[i].TheoryWeeklyNum; var practiceWeeklyNum = d[i].PracticeWeeklyNum; var trialWeeklyNum = d[i].TrialWeeklyNum; var weeklyHours = d[i].WeeklyHours; var weeklyNum = d[i].WeeklyNum; var startWeeklyNum = d[i].StartWeeklyNum; var endWeeklyNum = d[i].EndWeeklyNum; var teachingModeIDListName = d[i].TeachingModeIDListName; var handleModeID = d[i].HandleModeID; if (isNaN(credit) || credit == null || credit.toString() == "") { $.messager.alert("系统信息", "课程学分不能为空或格式不正确(非负数字),请检查。"); return; } if (!regA.test(credit)) { $.messager.alert("系统信息", "课程学分格式不正确(非负数字),请检查。"); return; } if (isNaN(theoryCourse) || theoryCourse == null || theoryCourse.toString() == "") { $.messager.alert("系统信息", "理论学时不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(theoryCourse)) { $.messager.alert("系统信息", "理论学时格式不正确(非负整数),请检查。"); return; } if (isNaN(practicehours) || practicehours == null || practicehours.toString() == "") { $.messager.alert("系统信息", "实践学时不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(practicehours)) { $.messager.alert("系统信息", "实践学时格式不正确(非负整数),请检查。"); return; } if (isNaN(trialhours) || trialhours == null || trialhours.toString() == "") { $.messager.alert("系统信息", "实验学时不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(trialhours)) { $.messager.alert("系统信息", "实验学时格式不正确(非负整数),请检查。"); return; } if (isNaN(theoryWeeklyNum) || theoryWeeklyNum == null || theoryWeeklyNum.toString() == "") { $.messager.alert("系统信息", "理论周次不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(theoryWeeklyNum)) { $.messager.alert("系统信息", "理论周次格式不正确(非负整数),请检查。"); return; } if (isNaN(practiceWeeklyNum) || practiceWeeklyNum == null || practiceWeeklyNum.toString() == "") { $.messager.alert("系统信息", "实践周次不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(practiceWeeklyNum)) { $.messager.alert("系统信息", "实践周次格式不正确(非负整数),请检查。"); return; } if (isNaN(trialWeeklyNum) || trialWeeklyNum == null || trialWeeklyNum.toString() == "") { $.messager.alert("系统信息", "实验周次不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(trialWeeklyNum)) { $.messager.alert("系统信息", "实验周次格式不正确(非负整数),请检查。"); return; } if (isNaN(weeklyHours) || weeklyHours == null || weeklyHours.toString() == "") { $.messager.alert("系统信息", "周学时不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(weeklyHours)) { $.messager.alert("系统信息", "周学时格式不正确(非负整数),请检查。"); return; } if (isNaN(weeklyNum) || weeklyNum == null || weeklyNum.toString() == "") { $.messager.alert("系统信息", "每周次数不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(weeklyNum)) { $.messager.alert("系统信息", "每周次数格式不正确(非负整数),请检查。"); return; } if (isNaN(startWeeklyNum) || startWeeklyNum == null || startWeeklyNum.toString() == "") { $.messager.alert("系统信息", "开始周次不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(startWeeklyNum)) { $.messager.alert("系统信息", "开始周次格式不正确(非负整数),请检查。"); return; } if (isNaN(endWeeklyNum) || endWeeklyNum == null || endWeeklyNum.toString() == "") { $.messager.alert("系统信息", "结束周次不能为空或格式不正确(非负整数),请检查。"); return; } if (!regB.test(endWeeklyNum)) { $.messager.alert("系统信息", "结束周次格式不正确(非负整数),请检查。"); return; } //if (parseFloat(trialhours) > parseFloat(practicehours)) { // $.messager.alert("系统提示", "实验学时不能大于实践学时。"); // return; //} //if (parseFloat(trialWeeklyNum) > parseFloat(practiceWeeklyNum)) { // $.messager.alert("系统提示", "实验周次不能大于实践周次。"); // return; //} if (teachingModeIDListName == "" || teachingModeIDListName == null) { $.messager.alert("系统信息", "授课方式为空无法申请。"); return; } if (handleModeID == "" || handleModeID == "-1" || handleModeID == null) { $.messager.alert("系统信息", "处理方式不能为空。"); return; } } $("#specialtyCourseViewList").val(JSON.stringify(d)); $(document.forms[0]).submit(); }