GraduationConditionPackage.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationConditionPackage/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGraduationConditionPackageList").cmsXDataTable("load", $.getDataGridParams("dgGraduationConditionPackageList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGraduationConditionPackageList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationConditionPackageID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function GraduationConditionPackage_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('毕业公式复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationConditionPackage/CopyAdd?GraduationConditionPackageID=' + d[0] + '&MNU=' + mnu, 750, 480, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('毕业公式新增', redirectTo, 750, 480, null, null);
  27. }
  28. }
  29. //修改
  30. function GraduationConditionPackage_Update() {
  31. var d = validChoose();
  32. if (d == "") {
  33. $.messager.alert("系统提示", "请选择您要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?GraduationConditionPackageID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('毕业公式修改', redirectTo, 750, 480, null, null);
  42. }
  43. //删除
  44. function GraduationConditionPackage_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 + '/GraduationConditionPackage/Delete', { graduationConditionPackageIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", data);
  55. $("#dgGraduationConditionPackageList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //查看明细
  64. function detail (rowindex, rowdata) {
  65. var redirectTo = url + "?GraduationConditionPackageID=" + rowdata.GraduationConditionPackageID + "&Type=1";
  66. $.popupTopWindow('毕业公式信息', redirectTo, 750, 480, null, null);
  67. }
  68. //设置相应的行颜色为红色
  69. function SetRedGrid(rowIndex, rowData) {
  70. if (rowData.IsDefault) {
  71. return "color: red;";
  72. } else {
  73. return "";
  74. }
  75. }
  76. //Excel导出
  77. function GraduationConditionPackage_Export() {
  78. $("#formQuery").submit();
  79. }