var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationSchoolYear/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //刷新 function reload() { $("#dgGraduationSchoolYearList").cmsXDataTable("load", $.getDataGridParams("dgGraduationSchoolYearList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgGraduationSchoolYearList").cmsXDataTable("getSelections"), function (index) { d.push(this.GraduationSchoolYearSettingID); }); return d; } //新增 function GraduationSchoolYear_Add() { var d = validChoose(); if (d.length > 0) { $.popupTopWindow('毕业学期复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationSchoolYear/CopyAdd?graduationSchoolYearSettingID=' + d[0] + '&MNU=' + mnu, 620, 254, null, null); } else { var redirectTo = url + "?MNU=" + mnu; $.popupTopWindow('毕业学期新增', redirectTo, 620, 254, null, null); } } //修改 function GraduationSchoolYear_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } var redirectTo = url + "?graduationSchoolYearSettingID=" + d + "&MNU=" + mnu; $.popupTopWindow('毕业学期修改', redirectTo, 620, 254, null, null); } //删除 function GraduationSchoolYear_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduationSchoolYear/Delete', { graduationSchoolYearSettingIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgGraduationSchoolYearList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //设置列颜色为红色 function SetRedColumn(index, row, value) { return " " + value + ""; } //设置相应的行颜色为红色 function SetRedGrid(rowIndex, rowData) { if (rowData.IsEnable) { return "color: red;"; } else { return ""; } } //Excel导出 function GraduationSchoolYear_Export() { $("#formQuery").submit(); }