MinorSpecialty.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorSpecialty/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgMinorSpecialty").cmsXDataTable("load", $.getDataGridParams("dgMinorSpecialty"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgMinorSpecialty").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.GrademinorID);
  15. });
  16. return d;
  17. }
  18. function validChooseStatusName() {
  19. var d = [];
  20. $.each($("#dgMinorSpecialty").cmsXDataTable("getSelections"), function (index) {
  21. d.push(this.ApprovalStatusName);
  22. });
  23. return d;
  24. }
  25. //点击列表更新
  26. function edit(rowindex, rowdata) {
  27. var redirectTo = url + "?GrademinorID=" + rowdata.GrademinorID + "&MNU=" + mnu + '&isView=1';
  28. $.popupTopWindow('辅修专业详情', redirectTo, 1000, 600, null, null);
  29. }
  30. //开放
  31. function MinorSpecialty_Open() {
  32. var d = validChoose().join(',');
  33. if (d.length == 0) {
  34. $.messager.alert("系统信息", "请选择您要开放的辅修专业信息。");
  35. return;
  36. }
  37. $.messager.confirm("系统提示", "您确定要开放该辅修专业信息?", function (r) {
  38. if (r) {
  39. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenMinorSpecialty', { GrademinorIDs: d }, function (data) {
  40. if (data == "开放成功") {
  41. $.messager.alert("系统提示", "开放成功。");
  42. $("#dgMinorSpecialty").cmsXDataTable('load');
  43. } else {
  44. $.messager.alert("系统提示", data);
  45. }
  46. });
  47. }
  48. });
  49. }
  50. //取消开放
  51. function MinorSpecialty_Cancel() {
  52. var d = validChoose().join(',');
  53. if (d.length == 0) {
  54. $.messager.alert("系统信息", "请选择您要取消开放的辅修专业信息。");
  55. return;
  56. }
  57. $.messager.confirm("系统提示", "您确定要取消开放该辅修专业信息?", function (r) {
  58. if (r) {
  59. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/CancelMinorSpecialty', { GrademinorIDs: d }, function (data) {
  60. if (data == "取消开放成功") {
  61. $.messager.alert("系统提示", "取消开放成功。");
  62. $("#dgMinorSpecialty").cmsXDataTable('load');
  63. } else {
  64. $.messager.alert("系统提示", data);
  65. }
  66. });
  67. }
  68. });
  69. }
  70. function StudentList(rowindex, rowdata) {
  71. $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/StudentList?grademinorID=' + rowdata.GrademinorID + '&MNU=' + mnu, 800, 600);
  72. }
  73. function MinorSpecialty_OpenClass() {
  74. var d = validChoose().join(',');
  75. if (d.length == 0) {
  76. $.messager.alert("系统信息", "请选择您要开班的辅修专业信息。");
  77. return;
  78. }
  79. $.messager.confirm("系统提示", "您确定要对所选辅修专业进行开班?", function (r) {
  80. if (r) {
  81. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenClass', { grademinorIDs: d }, function (data) {
  82. if (data == "开班成功") {
  83. $.messager.alert("系统提示", "开班成功。");
  84. $("#dgMinorSpecialty").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data);
  87. }
  88. });
  89. }
  90. });
  91. }
  92. function MinorSpecialty_CancelClass() {
  93. var d = validChoose().join(',');
  94. if (d.length == 0) {
  95. $.messager.alert("系统信息", "请选择您要取消开班的辅修专业信息。");
  96. return;
  97. }
  98. $.messager.confirm("系统提示", "您确定要对所选辅修专业取消开班?", function (r) {
  99. if (r) {
  100. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorSpecialty/OpenCancel', { grademinorIDs: d }, function (data) {
  101. if (data == "取消开班成功") {
  102. $.messager.alert("系统提示", "取消开班成功。");
  103. $("#dgMinorSpecialty").cmsXDataTable('load');
  104. } else {
  105. $.messager.alert("系统提示", data);
  106. }
  107. });
  108. }
  109. });
  110. }
  111. //导出Excel
  112. function MinorSpecialty_Export() {
  113. var d = validChoose().join(',')
  114. if (d != "") {
  115. document.getElementById("GrademinorID").value = d;
  116. }
  117. else {
  118. document.getElementById("GrademinorID").value = "";
  119. }
  120. $("#formQuery").submit();
  121. }