TrainingClass.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. $(function () {
  2. mnu = $.SystemGeneral.getUrlParam("MNU");
  3. })
  4. function reload() {
  5. $("#dgTrainingClassList").cmsXDataTable("load", $.getDataGridParams("dgTrainingClassList"));
  6. }
  7. function validChoose() {
  8. var d = [];
  9. $.each($("#dgTrainingClassList").cmsXDataTable("getSelections"), function (index) {
  10. d.push(this.TrainingClassID);
  11. });
  12. return d;
  13. }
  14. function schoolyearChange() {
  15. try {
  16. var examinationBatchUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationBatch/DropDownList?bindType=0';
  17. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  18. if (schoolyearID != nonSelect) {
  19. examinationBatchUrl += "&schoolyearID=" + schoolyearID;
  20. }
  21. $("#ddlExaminationBatch").combobox('reload', examinationBatchUrl);
  22. } catch (e) {
  23. }
  24. }
  25. function examinationBatchChange() {
  26. try {
  27. var examinationTypeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/TypeDropDownList?bindType=0';
  28. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  29. if (examinationBatchID != nonSelect) {
  30. examinationTypeUrl += "&examinationBatchID=" + examinationBatchID;
  31. }
  32. $("#ddlExaminationType").combobox('reload', examinationTypeUrl);
  33. } catch (e) {
  34. }
  35. }
  36. function examinationTypeChange() {
  37. try {
  38. var examinationProjectUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/DropDownList?bindType=0';
  39. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  40. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  41. if (examinationBatchID != nonSelect) {
  42. examinationProjectUrl += "&examinationBatchID=" + examinationBatchID;
  43. }
  44. if (examinationTypeID != nonSelect) {
  45. examinationProjectUrl += "&examinationTypeID=" + examinationTypeID;
  46. }
  47. $("#ddlExaminationProject").combobox('reload', examinationProjectUrl);
  48. } catch (e) {
  49. }
  50. }
  51. function studentList(rowindex, rowdata) {
  52. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/StudentList?MNU=" + mnu + "&trainingClassID=" + rowdata.TrainingClassID;
  53. $.popupTopWindow('学生名单', redirectTo, 1000, 480, reload);
  54. }
  55. function TrainingClass_Generate() {
  56. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/Generate?MNU=" + mnu;
  57. $.popupTopWindow('生成培训班', redirectTo, 640, 250, null, null);
  58. }
  59. function TrainingClass_Edit() {
  60. var d = validChoose();
  61. if (d == "") {
  62. $.messager.alert("系统提示", "请选择您要修改的信息。");
  63. return;
  64. }
  65. if (d.length > 1) {
  66. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  67. return;
  68. }
  69. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/Edit?MNU=" + mnu + "&trainingClassID=" + d;
  70. $.popupTopWindow('修改', redirectTo, 640, 250, null, null);
  71. }
  72. function TrainingClass_Split() {
  73. var ids = validChoose();
  74. if (ids.length == 0) {
  75. $.messager.alert("系统提示", "请选择您要分班的培训班级。");
  76. return;
  77. }
  78. if (ids.length > 1) {
  79. $.messager.alert("系统提示", "只能选择单个记录进行分班。");
  80. return;
  81. }
  82. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/Split?MNU=" + mnu + "&trainingClassID=" + ids[0];
  83. $.popupTopWindow('分班', redirectTo, 1024, 768, null, null);
  84. }
  85. function TrainingClass_Merge() {
  86. var ids = validChoose();
  87. if (ids.length == 0) {
  88. $.messager.alert("系统提示", "请选择您要合班的培训班级。");
  89. return;
  90. }
  91. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/Merge?MNU=" + mnu;
  92. $.popupTopWindow('合班', redirectTo, 640, 150, null, ids);
  93. }
  94. function TrainingClass_Send() {
  95. var traingingClassIDList = validChoose();
  96. if (traingingClassIDList.length == 0) {
  97. $.messager.alert("系统提示", "请选择您要发送信息的培训班。");
  98. return;
  99. }
  100. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/StudentUserIDList", { trainingClassIDs: traingingClassIDList.join(',') }, function (res) {
  101. if (res) {
  102. if (res.length == 0) {
  103. $.messager.alert("系统提示", "您选择的培训班中没有对应的学生,无法发送信息。");
  104. return;
  105. }
  106. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Common/UserAnnouncementSend";
  107. $.popupTopWindow('信息发送', redirectTo, 1024, 768, null, res);
  108. }
  109. });
  110. }
  111. function TrainingClassGDCX_Send() {
  112. var traingingClassIDList = validChoose();
  113. if (traingingClassIDList.length == 0) {
  114. $.messager.alert("系统提示", "请选择您要发送信息的培训班。");
  115. return;
  116. }
  117. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/TrainingClass/StudentUserIDList", { trainingClassIDs: traingingClassIDList.join(',') }, function (res) {
  118. if (res) {
  119. if (res.length == 0) {
  120. $.messager.alert("系统提示", "您选择的培训班中没有对应的学生,无法发送信息。");
  121. return;
  122. }
  123. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Common/UserAnnouncementSendGDCX";
  124. $.popupTopWindow('信息发送', redirectTo, 1024, 768, null, res);
  125. }
  126. });
  127. }
  128. function TrainingClass_Export() {
  129. $("[name='selectedIDs']").val(validChoose().join(','));
  130. $("#formQuery").submit();
  131. }