Grademajor.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGrademajorList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGrademajorList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GrademajorID);
  16. });
  17. return d;
  18. }
  19. //(年级专业复制)批量新增
  20. function Grademajor_BatchAdd() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/BatchAdd?MNU=" + mnu;
  22. $.popupTopWindow('年级专业复制', redirectTo, 700, 320, null, null);
  23. }
  24. //新增
  25. function Grademajor_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('年级专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/CopyAdd?grademajorID=' + d[0] + '&MNU=' + mnu, 700, 420, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('年级专业新增', redirectTo, 700, 420, null, null);
  32. }
  33. }
  34. //修改按钮
  35. function Grademajor_Update() {
  36. var d = validChoose();
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?grademajorID=" + d + "&MNU=" + mnu;
  46. $.popupTopWindow('年级专业修改', redirectTo, 700, 420, null, null);
  47. }
  48. //批量修改(重写)
  49. SystemBatchModifyControl.OnSubmit = function () {
  50. try {
  51. //年级
  52. if (document.getElementById("SchoolyearIDDictionaryDropDownList_div").style.display != "none") {
  53. var r = false;
  54. var d = validChoose().join(',');
  55. var schoolyearID = $("#SchoolyearID_DictionaryDropDownList").combobox("getValue");
  56. var schoolcodeID = null;
  57. if (d == "") {
  58. return;
  59. }
  60. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, schoolyearID: schoolyearID, schoolcodeID: schoolcodeID }, function (data) {
  61. if (data != "保存成功。") {
  62. $.messager.alert("系统提示", data.Message);
  63. $("#dgGrademajorList").cmsXDataTable('load');
  64. }
  65. else {
  66. return true;
  67. }
  68. });
  69. return r;
  70. }
  71. //学期
  72. else if (document.getElementById("SchoolcodeIDDictionaryDropDownList_div").style.display != "none") {
  73. var r = false;
  74. var d = validChoose().join(',');
  75. var schoolyearID = null;
  76. var schoolcodeID = $("#SchoolcodeID_DictionaryDropDownList").combobox("getValue");
  77. if (d == "") {
  78. return;
  79. }
  80. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/BatchModifyControl', { grademajorIDs: d, schoolyearID: schoolyearID, schoolcodeID: schoolcodeID }, function (data) {
  81. if (data != "保存成功。") {
  82. $.messager.alert("系统提示", data.Message);
  83. $("#dgGrademajorList").cmsXDataTable('load');
  84. }
  85. else {
  86. return true;
  87. }
  88. });
  89. return r;
  90. }
  91. } catch (e) { }
  92. }
  93. //删除
  94. function Grademajor_Delete() {
  95. var d = validChoose().join(',');
  96. if (d == "") {
  97. $.messager.alert("系统提示", "请选择您要删除的信息。");
  98. return;
  99. }
  100. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  101. if (r) {
  102. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Delete', { grademajorIDs: d }, function (data) {
  103. if (data == "删除成功。") {
  104. $.messager.alert("系统提示", data);
  105. $("#dgGrademajorList").cmsXDataTable('load');
  106. } else {
  107. $.messager.alert("系统提示", data);
  108. }
  109. });
  110. }
  111. });
  112. }
  113. //查看
  114. function edit(rowindex, rowdata) {
  115. var redirectTo = url + "?grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu + "&Type=1";
  116. $.popupTopWindow('年级专业信息', redirectTo, 700, 420, null, null);
  117. }
  118. //Excel导出
  119. function Grademajor_Export() {
  120. $("#formQuery").submit();
  121. }
  122. //Excel导入
  123. function Grademajor_Import() {
  124. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Grademajor/Import?MNU=' + mnu;
  125. $.popupTopWindow('年级专业信息导入', redirectTo, 420, 300, reload);
  126. }
  127. //年级专业对应的班级明细
  128. function editClassmajorCount(rowindex, rowdata) {
  129. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  130. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassmajorList?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu;
  131. $.popupTopWindow('年级专业班级明细', redirectTo, 750, 450, null, null);
  132. }
  133. //年级专业学生明细
  134. function editStudentCount(rowindex, rowdata) {
  135. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  136. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&grademajorID=" + rowdata.GrademajorID + "&MNU=" + mnu;
  137. $.popupTopWindow('年级专业学生明细', redirectTo, 800, 500, null, null);
  138. }
  139. function queryCollege(data) {
  140. var campusID = $("#CampusDropdown").combogridX("getValue");
  141. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  142. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  143. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  144. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  145. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  146. queryClass();
  147. reload();
  148. }
  149. function querySchoolyear(data) {
  150. queryClass();
  151. reload();
  152. }
  153. function queryStandard(data) {
  154. queryClass();
  155. reload();
  156. }
  157. function queryClass() {
  158. var jsonString = "";
  159. var parameterString = "";
  160. var campusID = $("#CampusDropdown").combogridX("getValue");
  161. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  162. var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue");
  163. var standardID = $("#DictionaryStandard").combogridX("getValue");
  164. var educationID = $("#DictionaryEducation").combogridX("getValue");
  165. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  166. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  167. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  168. if (schoolYearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + schoolYearID + "|@|";
  169. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  170. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  171. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  172. if (parameterString != "") {
  173. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  174. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  175. }
  176. else {
  177. $("#DictionaryStandard").combogridX("reload");
  178. }
  179. reload();
  180. }