ExecutableMinorPlan.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExecutableMinorPlan/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function reload() {
  8. $("#dgExecutableMinorPlanList").cmsXDataTable("load", $.getDataGridParams("dgExecutableMinorPlanList"));
  9. }
  10. function ExecutableMinorPlan_Create() {
  11. $.popupTopWindow('生成执行计划(辅修)', CMS_SystemConfig.VirtualDirectoryPath + "/ExecutableMinorPlan/GenerateExecutablePlan?MNU=" + mnu, 600, 300, null, null);
  12. }
  13. function ExecutableMinorPlan_Update() {
  14. var d = validChoose();
  15. var state = teachingvalidChoose().join(',');
  16. if (d == "") {
  17. $.messager.alert("系统信息", "请选择您要修改的执行计划(辅修)信息。");
  18. return;
  19. }
  20. if (d.length > 1) {
  21. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  22. return;
  23. }
  24. for (var i = 0; i < state.split(',').length; i++) {
  25. if (state.split(',')[i] != notSubmitStatus) {
  26. $.messager.alert("系统提示", "只能对未提交的数据进行修改,请检查您选择的记录。");
  27. return;
  28. }
  29. }
  30. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExecutableMinorPlan/Edit?ExecutableMinorPlanID=" + d + "&MNU=" + mnu;
  31. $.popupTopWindow('修改执行计划(辅修)', redirectTo, 800, 600, null, null);
  32. }
  33. //点击列表更新
  34. function edit(rowindex, rowdata) {
  35. var redirectTo = url + "?ExecutableMinorPlanID=" + rowdata.ExecutableMinorPlanID + "&MNU=" + mnu + '&isView=1';
  36. $.popupTopWindow('执行计划(辅修)详情', redirectTo, 800, 600, null, null);
  37. }
  38. function TeachingPlan_Export() {
  39. $("[name='ExecutablePlanIDs']").val(validChoose().join(","));
  40. $("#formQuery").submit();
  41. }
  42. function ExecutableMinorPlan_Delete() {
  43. var d = validChoose().join(',');
  44. var state = teachingvalidChoose().join(',');
  45. if (d.length == 0) {
  46. $.messager.alert("系统提示", "请选择您要删除的执行计划(辅修)。");
  47. return;
  48. }
  49. for (var i = 0; i < state.split(',').length; i++) {
  50. if (state.split(',')[i] != notSubmitStatus) {
  51. $.messager.alert("系统提示", "只能对未提交的数据进行删除,请检查您选择的记录。");
  52. return;
  53. }
  54. }
  55. $.messager.confirm("系统提示", "您确定要删除执行计划(辅修)信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExecutableMinorPlan/Delete', { ExecutableMinorPlanIDs: d }, function (data) {
  58. if (data.IsSuccess) {
  59. $.messager.alert("系统提示", "删除成功。");
  60. $("#dgExecutableMinorPlanList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data.Message);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. function ExecutableMinorPlan_Submit() {
  69. var d = validChoose().join(',');
  70. var state = teachingvalidChoose().join(',');
  71. if (d.length == 0) {
  72. $.messager.alert("系统提示", "请选择您要生成的教学任务班数据!");
  73. return;
  74. }
  75. for (var i = 0; i < state.split(',').length; i++) {
  76. if (state.split(',')[i] != notSubmitStatus) {
  77. $.messager.alert("系统提示", "您选择教学计划存在已提交的数据!");
  78. return;
  79. }
  80. }
  81. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExecutableMinorPlan/GenerateEducationMissionClassSubminit', { ExecutableMinorPlanIDs: d }, function (data) {
  82. if (data == "成功") {
  83. $.messager.alert("系统提示", "生成教学任务班成功!");
  84. $("#dgExecutableMinorPlanList").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data);
  87. }
  88. });
  89. }
  90. //获取选中的数据
  91. function validChoose() {
  92. var d = [];
  93. $.each($("#dgExecutableMinorPlanList").cmsXDataTable("getSelections"), function (index) {
  94. d.push(this.ExecutableMinorPlanID);
  95. });
  96. return d;
  97. }
  98. //获取选中的数据
  99. function teachingvalidChoose() {
  100. var d = [];
  101. $.each($("#dgExecutableMinorPlanList").cmsXDataTable("getSelections"), function (index) {
  102. d.push(this.RecordStatus);
  103. });
  104. return d;
  105. }
  106. function QueryCampusComboGridList() {
  107. var campusID = $("#ComboGridCampus").combogridX("getValue");
  108. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  109. $("#ComboGridCollege").combogridX("reload", eval(jsonString));
  110. reload();
  111. }
  112. //联动查询
  113. function queryStandard(data) {
  114. queryClass();
  115. reload();
  116. }
  117. function queryCollege(data) {
  118. var campusID = $("#CampusDropdown").combogridX("getValue");
  119. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  120. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  121. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  122. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  123. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  124. // if (campusID != nonSelect) {
  125. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  126. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  127. // }
  128. queryClass();
  129. reload();
  130. }
  131. function queryClass() {
  132. var jsonString = "";
  133. var parameterString = "";
  134. var campusID = $("#CampusDropdown").combogridX("getValue");
  135. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  136. //var educationID = $("#Education").combobox("getValue");
  137. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  138. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  139. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  140. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  141. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  142. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  143. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  144. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  145. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  146. if (parameterString != "") {
  147. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  148. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  149. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  150. } else {
  151. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  152. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  153. }
  154. reload();
  155. }