Studentreport.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. var url = "/Studentreport/Edit?a=1";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function reload() {
  8. $("#dgList").cmsXDataTable("load", $.getDataGridParams("dgList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.StudentReportID);
  15. });
  16. return d;
  17. }
  18. //点击列表更新
  19. function edit(rowindex, rowdata) {
  20. showDialog([rowdata.StudentReportID]);
  21. }
  22. //学籍注册
  23. function Studentreport_Update() {
  24. var d = validChoose();
  25. if (d.length == 0) {
  26. $.messager.alert("系统提示", "请选择您要注册的学生信息。");
  27. return;
  28. }
  29. //if (d.length > 1) {
  30. // $.messager.alert("系统信息", "只能选中一位学生进行学期注册。");
  31. // return;
  32. //}
  33. showDialog(d);
  34. }
  35. function Studentreport_Refresh() {
  36. var redirectTo = 'Studentreport/Refresh?a=1';
  37. redirectTo = redirectTo + '&MNU=' + mnu;
  38. $.popupTopWindow('生成学籍注册名单', redirectTo, 400, 200, null, null);
  39. }
  40. function Studentreport_Report() {
  41. var redirectTo = 'Studentreport/Report?a=1';
  42. //var schoolYearID = $("SchoolYearID").combobox("getValue");
  43. redirectTo = redirectTo + '&MNU=' + mnu;
  44. $.popupTopWindow('缴费注册刷新', redirectTo, 400, 200, null, null);
  45. }
  46. function showDialog(id) {
  47. var redirectTo = url;
  48. //if (id) {
  49. // redirectTo = redirectTo + '&id=' + id;
  50. //}
  51. redirectTo = redirectTo + '&MNU=' + mnu;
  52. $.popupTopWindow('学籍注册', redirectTo, 450, 200, null, id);
  53. }
  54. //删除
  55. function Studentreport_Delete() {
  56. var selected = $("#dgList").cmsXDataTable("getSelections");
  57. if (selected.length == 0) {
  58. $.messager.alert("系统提示", "请选择您要删除的学生注册信息!");
  59. return;
  60. }
  61. var ids = [];
  62. for (var i = 0; i < selected.length; i++) {
  63. if (selected[i].ReportStatusName != '待注册') {
  64. $.messager.alert("系统提示", "只能删除待注册状态的学生注册信息。");
  65. return;
  66. }
  67. ids.push(selected[i].StudentReportID);
  68. }
  69. $.messager.confirm("系统提示", "您确定要删除该学生注册信息?", function (r) {
  70. if (r) {
  71. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Studentreport/Delete', { ids: ids.join(',') }, function (data) {
  72. if (data == "删除成功") {
  73. $.messager.alert("系统提示", "删除成功!");
  74. $("#dgList").cmsXDataTable('load');
  75. } else {
  76. $.messager.alert("系统提示", data);
  77. }
  78. });
  79. }
  80. });
  81. }
  82. function Studentreport_Export() {
  83. $("#formQuery").submit();
  84. }
  85. function Studentreport_Import() {
  86. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Studentreport/Import?MNU=' + mnu;
  87. $.popupTopWindow('导入学生', redirectTo, 400, 300, null, null);
  88. }
  89. function queryClass() {
  90. var jsonString = "";
  91. var parameterString = "";
  92. var campusID = $("#CampusDropdown").combogridX("getValue");
  93. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  94. var standardID = $("#DictionaryStandard").combogridX("getValue");
  95. var educationID = $("#DictionaryEducation").combobox("getValue");
  96. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  97. var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  98. var schoolyearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  99. if (schoolyearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolyearID + "|@|";
  100. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  101. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  102. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  103. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  104. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  105. if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|";
  106. if (parameterString != "") {
  107. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  108. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  109. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  110. } else {
  111. $("#ClassmajorDropdown").combogridX("reload");
  112. $("#DictionaryStandard").combogridX("reload");
  113. }
  114. reload();
  115. }
  116. function QueryCampusComboGridList() {
  117. var campusID = $("#CampusDropdown").combogridX("getValue");
  118. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  119. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  120. queryClass();
  121. }
  122. function QueryCollegeComboGridList(data) {
  123. if (((data.length && data.length > 0) || data)
  124. && $("#CampusDropdown").length > 0 && $.data($("#CampusDropdown")[0], "combogridX")
  125. && $("#SchoolyearDictionaryDropDown").length > 0 && $.data($("#SchoolyearDictionaryDropDown")[0], "combobox")
  126. && $("#DictionaryStandard").length > 0 && $.data($("#DictionaryStandard")[0], "combogridX")
  127. && $("#ClassmajorDropdown").length > 0 && $.data($("#ClassmajorDropdown")[0], "combogridX")) {
  128. var campusID = $("#CampusDropdown").combogridX("getValue");
  129. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  130. var schoolYear = $("#DictionarySchoolyear").combobox("getValue");
  131. var standardID = $("#DictionaryStandard").combogridX("getValue");
  132. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + schoolYear + "|@|DictionaryStandard|*|" + standardID + "|@|'})";
  133. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  134. }
  135. queryClass();
  136. }
  137. function QuerySchoolyearDictionaryDropdownList(data) {
  138. var campusID = $("#CampusDropdown").combogridX("getValue");
  139. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  140. var schoolYear = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  141. var standardID = $("#DictionaryStandard").combogridX("getValue");
  142. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + schoolYear + "|@|DictionaryStandard|*|" + standardID + "|@|'})";
  143. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  144. queryClass();
  145. }
  146. function QueryStandardDropdownList(data) {
  147. var campusID = $("#CampusDropdown").combogridX("getValue");
  148. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  149. var schoolYear = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  150. var standardID = $("#DictionaryStandard").combogridX("getValue");
  151. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + schoolYear + "|@|DictionaryStandard|*|" + standardID + "|@|'})";
  152. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  153. queryClass();
  154. }
  155. function QueryReportStatusDropdownList(data) {
  156. if (((data.length && data.length > 0) || data)
  157. && $("#CampusDropdown").length > 0 && $.data($("#CampusDropdown")[0], "combobox")
  158. && $("#CollegeDropdown").length > 0 && $.data($("#CollegeDropdown")[0], "combobox")
  159. && $("#ClassmajorDropdown").length > 0 && $.data($("#ClassmajorDropdown")[0], "combobox")
  160. && $("#SchoolyearDictionaryDropDown").length > 0 && $.data($("#SchoolyearDictionaryDropDown")[0], "combobox")
  161. && $("#dgList").length > 0 && $.data($("#dgList")[0], "cmsXDataTable")) {
  162. reload();
  163. }
  164. queryClass();
  165. }
  166. function QuerySchoolyearDropdownList(data) {
  167. if (((data.length && data.length > 0) || data)
  168. && $("#CampusDropdown").length > 0 && $.data($("#CampusDropdown")[0], "combobox")
  169. && $("#CollegeDropdown").length > 0 && $.data($("#CollegeDropdown")[0], "combobox")
  170. && $("#ClassmajorDropdown").length > 0 && $.data($("#ClassmajorDropdown")[0], "combobox")
  171. && $("#ReportStatusDictionaryDropDown").length > 0 && $.data($("#ReportStatusDictionaryDropDown")[0], "combobox")
  172. && $("#dgList").length > 0 && $.data($("#dgList")[0], "cmsXDataTable")) {
  173. reload();
  174. }
  175. queryClass();
  176. }
  177. //联动查询
  178. function queryStandard(data) {
  179. queryClass();
  180. reload();
  181. }
  182. function queryCollege(data) {
  183. // var campusID = $("#CampusDropdown").combogridX("getValue");
  184. // var collegeID = $("#CollegeDropdown").combogridX("getValue");
  185. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  186. // jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  187. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  188. // $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  189. // // if (campusID != nonSelect) {
  190. // // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  191. // // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  192. // // }
  193. queryClass();
  194. reload();
  195. }