var url = CMS_SystemConfig.VirtualDirectoryPath + "/GrademajorRequirement/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgGrademajorRequirementList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorRequirementList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgGrademajorRequirementList").cmsXDataTable("getSelections"), function (index) { d.push(this.GraduationRequirementID); }); return d; } //新增 function GrademajorRequirement_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('专业学分复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GrademajorRequirement/CopyAdd?graduationRequirementID=' + d[0] + '&MNU=' + mnu, 650, 245, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('专业学分新增', redirectTo, 650, 245, null, null); } } //修改 function GrademajorRequirement_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?graduationRequirementID=" + d + "&MNU=" + mnu; $.popupTopWindow('专业学分修改', redirectTo, 650, 245, null, null); } //删除 function GrademajorRequirement_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GrademajorRequirement/Delete', { graduationRequirementIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgGrademajorRequirementList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function GrademajorRequirement_Export() { $("#formQuery").submit(); } //联动查询 function queryStandard(data) { 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)); $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var educationID = $("#DictionaryEducation").combogridX("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); var learningFormID = $("#DictionaryLearningform").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); } else { $("#StandardDictionaryDropDown").combogridX("reload"); } reload(); }