GraduationSchoolYear.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationSchoolYear/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGraduationSchoolYearList").cmsXDataTable("load", $.getDataGridParams("dgGraduationSchoolYearList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGraduationSchoolYearList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationSchoolYearSettingID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function GraduationSchoolYear_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('毕业学期复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationSchoolYear/CopyAdd?graduationSchoolYearSettingID=' + d[0] + '&MNU=' + mnu, 620, 254, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('毕业学期新增', redirectTo, 620, 254, null, null);
  27. }
  28. }
  29. //修改
  30. function GraduationSchoolYear_Update() {
  31. var d = validChoose();
  32. if (d.length == 0) {
  33. $.messager.alert("系统信息", "请选择您要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?graduationSchoolYearSettingID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('毕业学期修改', redirectTo, 620, 254, null, null);
  42. }
  43. //删除
  44. function GraduationSchoolYear_Delete() {
  45. var d = validChoose().join(',');
  46. if (d == "") {
  47. $.messager.alert("系统提示", "请选择您要删除的信息。");
  48. return;
  49. }
  50. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduationSchoolYear/Delete', { graduationSchoolYearSettingIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", data);
  55. $("#dgGraduationSchoolYearList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //设置列颜色为红色
  64. function SetRedColumn(index, row, value) {
  65. return " <span style=\"color: red;\">" + value + "</span>";
  66. }
  67. //设置相应的行颜色为红色
  68. function SetRedGrid(rowIndex, rowData) {
  69. if (rowData.IsEnable) {
  70. return "color: red;";
  71. } else {
  72. return "";
  73. }
  74. }
  75. //Excel导出
  76. function GraduationSchoolYear_Export() {
  77. $("#formQuery").submit();
  78. }