MinorClass.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorClass/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgMinorClassList").cmsXDataTable("load", $.getDataGridParams("dgMinorClassList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgMinorClassList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ClassminorID);
  16. });
  17. return d;
  18. }
  19. function MinorClass_Generate() {
  20. $.messager.confirm("系统提示", "您是否要生成辅修班级?", function (r) {
  21. if (r) {
  22. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorClass/Generate',{ }, function (data) {
  23. if (data == "生成成功。") {
  24. $.messager.alert("系统提示", data);
  25. $("#dgMinorClassList").cmsXDataTable('load');
  26. } else {
  27. $.messager.alert("系统提示", data);
  28. }
  29. });
  30. }
  31. });
  32. }
  33. function StudentList(rowindex, rowdata) {
  34. $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/MinorClass/StudentList?minorClassID=' + rowdata.ClassminorID + '&MNU=' + mnu , 800, 600);
  35. }
  36. //Excel导出
  37. function MinorClass_Export() {
  38. var d = validChoose().join(',');
  39. $("[name='SelectedID']").val(d);
  40. $("#formQuery").submit();
  41. }
  42. function MinorClass_OpenClass() {
  43. var d = validChoose();
  44. if (d.length == 0) {
  45. $.messager.alert("系统提示", "请选择您要开班的信息。");
  46. return;
  47. }
  48. $.messager.confirm("系统提示", "您确定对选择的信息进行开班?", function (r) {
  49. if (r) {
  50. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorClass/OpenClass', { minorClassIDs: d.join(',') }, function (data) {
  51. if (data == "开班成功。") {
  52. $.messager.alert("系统提示", data);
  53. $("#dgMinorClassList").cmsXDataTable('load');
  54. } else {
  55. $.messager.alert("系统提示", data);
  56. }
  57. });
  58. }
  59. });
  60. }
  61. function MinorClass_Delete() {
  62. var d = validChoose();
  63. if (d.length == 0) {
  64. $.messager.alert("系统提示", "请选择您要删除的信息。");
  65. return;
  66. }
  67. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  68. if (r) {
  69. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorClass/Delete', { minorClassIDs: d.join(',') }, function (data) {
  70. if (data == "删除成功。") {
  71. $.messager.alert("系统提示", data);
  72. $("#dgMinorClassList").cmsXDataTable('load');
  73. } else {
  74. $.messager.alert("系统提示", data);
  75. }
  76. });
  77. }
  78. });
  79. }
  80. function MinorClass_CancelClass() {
  81. var d = validChoose();
  82. if (d.length == 0) {
  83. $.messager.alert("系统提示", "请选择您要取消开班的信息。");
  84. return;
  85. }
  86. $.messager.confirm("系统提示", "您确定要对选择的信息取消开班?", function (r) {
  87. if (r) {
  88. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorClass/CancelOpenClass', { minorClassIDs: d.join(',') }, function (data) {
  89. if (data == "取消开班成功。") {
  90. $.messager.alert("系统提示", data);
  91. $("#dgMinorClassList").cmsXDataTable('load');
  92. } else {
  93. $.messager.alert("系统提示", data);
  94. }
  95. });
  96. }
  97. });
  98. }
  99. //联动查询
  100. function queryStandard(data) {
  101. queryClass();
  102. reload();
  103. }
  104. function queryCollege(data) {
  105. var campusID = $("#CampusDropdown").combogridX("getValue");
  106. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  107. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  108. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  109. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  110. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  111. queryClass();
  112. reload();
  113. }
  114. function queryClass() {
  115. var jsonString = "";
  116. var parameterString = "";
  117. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  118. var yearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  119. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  120. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  121. if (yearID != nonSelect) parameterString += "DictionaryGrade|*|" + yearID + "|@|";
  122. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  123. if (parameterString != "") {
  124. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  125. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  126. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  127. } else {
  128. $("#StandardDictionaryDropDown").combogridX("reload");
  129. }
  130. reload();
  131. }