var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgGraduationStandardList").cmsXDataTable("load", $.getDataGridParams("dgGraduationStandardList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgGraduationStandardList").cmsXDataTable("getSelections"), function (index) { d.push(this.GraduationStandardID); }); return d; } //标准生成 function GraduationStandard_Generate() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Generate?MNU=" + mnu; $.popupTopWindow('毕业标准生成', redirectTo, 540, 254, null, null); } //新增 function GraduationStandard_Add() { //var d = validChoose(); //if (d.length > 0) { // $.popupTopWindow('毕业标准复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationStandard/CopyAdd?graduationStandardID=' + d[0] + '&MNU=' + mnu, 680, 300, null, null); //} else { // var redirectTo = url + "?MNU=" + mnu; // $.popupTopWindow('毕业标准新增', redirectTo, 680, 300, null, null); //} //采用以下方式进行新增 var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/GraduationStandardBatchAdd" + "?MNU=" + mnu; $.popupTopWindow('毕业标准新增', redirectTo, 860, 540, reload, null); } //修改 function GraduationStandard_Update() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?GraduationStandardID=" + d + "&MNU=" + mnu; $.popupTopWindow('毕业标准修改', redirectTo, 680, 300, null, null); } //删除 function GraduationStandard_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduationStandard/Delete', { graduationStandardIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgGraduationStandardList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //专业计划信息明细 function editSpecialtyPlan(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/SpecialtyPlanList?graduationStandardID=" + rowdata.GraduationStandardID + "&MNU=" + mnu; $.popupTopWindow('专业计划明细', redirectTo, 985, 540, null, null); } //执行计划信息明细 function editExecutablePlan(rowindex, rowdata) { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/ExecutablePlanList?graduationStandardID=" + rowdata.GraduationStandardID + "&MNU=" + mnu; $.popupTopWindow('执行计划明细', redirectTo, 985, 540, null, null); } //学生信息明细 function editStudentCount(rowindex, rowdata) { var inschoolStatus = $("#DictionaryInschoolStatus").combobox("getValue"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationStandard/Detail?inschoolStatus=" + inschoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu; $.popupTopWindow('年级专业学生明细', redirectTo, 800, 500, null, null); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //设置相应的行颜色为红色 function SetRedGrid(rowIndex, rowData) { if (rowData.StudentCount <= 0) { return "color: red;"; } else { return ""; } } //Excel导出 function GraduationStandard_Export() { $("#formQuery").submit(); } //联动查询 function queryCampus(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); if (campusID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); } queryClass(); } function queryCollege(data) { var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|"; jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); $("#DictionaryStandard").combogridX("reload", eval(jsonString)); queryClass(); } function querySchoolyear(data) { queryClass(); } function queryStandard(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var schoolYearID = $("#DictionarySchoolyear").combobox("getValue"); var standardID = $("#DictionaryStandard").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var learningFormID = $("#DictionaryLearningform").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; 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)); } else { $("#DictionaryStandard").combogridX("reload"); } reload(); }