var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgMinorGraduationApplyList").cmsXDataTable("load", $.getDataGridParams("dgMinorGraduationApplyList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgMinorGraduationApplyList").cmsXDataTable("getSelections"), function (index) { d.push(this.MinorGraduationApplyID); }); return d; } //名单生成 function MinorGraduationApply_Create() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Generate?MNU=" + mnu; $.popupTopWindow('辅修毕业申请生成', redirectTo, 340, 300, null, null); } //新增 function MinorGraduationApply_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('毕业申请复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/MinorGraduationApply/CopyAdd?minorGraduationApplyID=' + d[0] + '&MNU=' + mnu, 680, 320, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('毕业申请新增', redirectTo, 680, 320, null, null); } } //修改 function MinorGraduationApply_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?graduationApplyID=" + d + "&MNU=" + mnu; $.popupTopWindow('毕业申请修改', redirectTo, 680, 320, null, null); } //删除 function MinorGraduationApply_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorGraduationApply/Delete', { minorGraduationApplyIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgMinorGraduationApplyList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //提交(毕业申请提交) function MinorGraduationApply_Submit() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要提交的信息。"); return; } var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Submit" + "?MNU=" + mnu; $.popupTopWindow('毕业申请提交', redirectTo, 500, 280, null, d); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //Excel导出 function MinorGraduationApply_Export() { var d = validChoose().join(','); $("[name='SelectedID']").val(d); $("#formQuery").submit(); } //联动查询 function queryStandard(data) { queryClass(); reload(); } 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(); reload(); } 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(); }