LevelSetting.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. var mnu;
  2. $(function () {
  3. mnu = $.SystemGeneral.getUrlParam("MNU");
  4. })
  5. function reload() {
  6. $("#dgLevelSettingList").cmsXDataTable("load", $.getDataGridParams("dgLevelSettingList"));
  7. }
  8. // 获取选中的数据
  9. function validChoose() {
  10. var d = [];
  11. $.each($("#dgLevelSettingList").cmsXDataTable("getSelections"), function (index) {
  12. d.push(this.LevelSettingID);
  13. });
  14. return d;
  15. }
  16. function LevelSetting_Add() {
  17. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/LevelSetting/Edit?MNU=" + mnu;
  18. $.popupTopWindow('增加等级设置', redirectTo, 650, 385, null, null);
  19. }
  20. function LevelSetting_Edit() {
  21. var d = validChoose();
  22. if (d == "") {
  23. $.messager.alert("系统提示", "请选择您要修改的设置信息。");
  24. return;
  25. }
  26. if (d.length > 1) {
  27. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  28. return;
  29. }
  30. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/LevelSetting/Edit?LevelSettingID=" + d + "&MNU=" + mnu + "&type=edit";
  31. $.popupTopWindow('等级设置信息', redirectTo, 650, 430, null, null);
  32. }
  33. function detail(rowindex, rowdata) {
  34. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/LevelSetting/Edit?LevelSettingID=" + rowdata.LevelSettingID + "&MNU=" + mnu + "&type=detail";
  35. $.popupTopWindow('等级设置信息', redirectTo, 650, 430, null, null);
  36. }
  37. function LevelSetting_Delete() {
  38. var records = $("#dgLevelSettingList").cmsXDataTable("getSelections");
  39. var msg = "";
  40. var d = validChoose().join(',');
  41. if (d == "") {
  42. $.messager.alert("系统提示", "请选择您要删除的信息!!");
  43. return;
  44. }
  45. $.messager.confirm("系统提示", msg + "您确定要删除所勾选的信息?", function (r) {
  46. if (r) {
  47. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/LevelSetting/Delete', { levelSettingIDs: d }, function (data) {
  48. if (data == "删除成功") {
  49. $.messager.alert("系统提示", "删除成功!");
  50. $("#dgLevelSettingList").cmsXDataTable('load');
  51. } else {
  52. $.messager.alert("系统提示", data);
  53. }
  54. });
  55. }
  56. });
  57. // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Verification', { newStudentIDs: d }, function (data) {
  58. // if (data == "1") {
  59. // msg = "所选信息存在已分配的新生,";
  60. // }
  61. // $.messager.confirm("系统提示", msg + "您确定要删除所选择的新生信息?", function (r) {
  62. // if (r) {
  63. // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Delete', { newStudentIDs: d }, function (data) {
  64. // if (data == "删除成功") {
  65. // $.messager.alert("系统提示", "删除成功!");
  66. // $("#dgLevelSettingList").cmsXDataTable('load');
  67. // } else {
  68. // $.messager.alert("系统提示", data);
  69. // }
  70. // });
  71. // }
  72. // });
  73. // });
  74. }