ClassStatistic.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. $(function () {
  2. mnu = $.SystemGeneral.getUrlParam("MNU");
  3. var jsonString = "";
  4. var parameterString = "";
  5. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  6. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  7. if (parameterString != "") {
  8. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  9. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  10. }
  11. })
  12. function schoolyearChange() {
  13. try {
  14. var examinationBatchUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationBatch/DropDownList?bindType=0';
  15. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  16. if (schoolyearID != nonSelect) {
  17. examinationBatchUrl += "&schoolyearID=" + schoolyearID;
  18. }
  19. $("#ddlExaminationBatch").combobox('reload', examinationBatchUrl);
  20. } catch (e) {
  21. }
  22. }
  23. function examinationBatchChange() {
  24. try {
  25. var examinationTypeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/TypeDropDownList?bindType=0';
  26. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  27. if (examinationBatchID != nonSelect) {
  28. examinationTypeUrl += "&examinationBatchID=" + examinationBatchID;
  29. }
  30. $("#ddlExaminationType").combobox('reload', examinationTypeUrl);
  31. } catch (e) {
  32. }
  33. }
  34. function examinationTypeChange() {
  35. try {
  36. var examinationProjectUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/DropDownList?bindType=0';
  37. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  38. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  39. if (examinationBatchID != nonSelect) {
  40. examinationProjectUrl += "&examinationBatchID=" + examinationBatchID;
  41. }
  42. if (examinationTypeID != nonSelect) {
  43. examinationProjectUrl += "&examinationTypeID=" + examinationTypeID;
  44. }
  45. $("#ddlExaminationProject").combobox('reload', examinationProjectUrl);
  46. } catch (e) {
  47. }
  48. }
  49. function examinationProjectLoaded() {
  50. try {
  51. var collegeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/College/CollegeDropdownListOnlyCollege?bindType=1';
  52. $("#ddlCollege").combobox('reload', collegeUrl);
  53. } catch (e) {
  54. }
  55. reload();
  56. }
  57. function querySchoolYear() {
  58. var jsonString = "";
  59. var parameterString = "";
  60. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  61. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  62. if (parameterString != "") {
  63. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  64. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  65. }
  66. //reload();
  67. }
  68. function queryBatch() {
  69. var jsonString = "";
  70. var parameterString = "";
  71. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  72. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  73. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  74. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  75. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  76. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  77. if (parameterString != "") {
  78. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  79. $("#cgExaminationType").combogridX("reload", eval(jsonString));
  80. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  81. }
  82. //reload();
  83. }
  84. function queryType() {
  85. var jsonString = "";
  86. var parameterString = "";
  87. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  88. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  89. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  90. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  91. if (parameterString != "") {
  92. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  93. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  94. }
  95. //reload();
  96. }
  97. function collegeChange() {
  98. try {
  99. var jsonString = "";
  100. var parameterString = "";
  101. var collegeID = $("#ddlCollege").combobox('getValue');
  102. var yearID = $("#ddlYear").combobox("getValue");
  103. var schoolAreaID = $("#ddlSchoolArea").combobox("getValue");
  104. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  105. if (yearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + yearID + "|@|";
  106. if (schoolAreaID != nonSelect) parameterString += "ddlSchoolArea|*|" + schoolAreaID + "|@|";
  107. if (parameterString != "") {
  108. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  109. $("#cgbStandard").combogridX("reload", eval(jsonString));
  110. } else {
  111. $("#cgbStandard").combogridX("reload");
  112. }
  113. } catch (e) {
  114. }
  115. }
  116. function standardChange() {
  117. try {
  118. var jsonString = "";
  119. var parameterString = "";
  120. var collegeID = $("#ddlCollege").combobox('getValue');
  121. var yearID = $("#ddlYear").combobox("getValue");
  122. var standardID = $("#cgbStandard").combogridX("getValue");
  123. //var schoolAreaID = $("#ddlSchoolArea").combobox("getValue");
  124. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  125. if (yearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + yearID + "|@|";
  126. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  127. //if (schoolAreaID != nonSelect) parameterString += "ddlSchoolArea|*|" + schoolAreaID + "|@|";
  128. //if (parameterString != "") {
  129. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  130. $("#cgbClassmajor").combogridX("reload", eval(jsonString));
  131. //} else {
  132. // $("#cgbClassmajor").combogridX("reload", eval(jsonString));
  133. //}
  134. } catch (e) {
  135. }
  136. }
  137. function collegeSelect() {
  138. collegeChange();
  139. reload();
  140. }
  141. function standardSelect() {
  142. standardChange();
  143. reload();
  144. }
  145. function reload() {
  146. $("#dgStudentFeeClassStatisticList").cmsXDataTable("load", $.getDataGridParams("dgStudentFeeClassStatisticList"));
  147. //$.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentFee/ClassStatisticTotal', $.getDataGridParams("dgStudentFeeClassStatisticList"),
  148. // function (res) {
  149. // if (res) {
  150. // $("#spnRegistCount").html(res.TotalRegistCount);
  151. // $("#spnRegistAmount").html(res.TotalRegistAmount);
  152. // $("#spnPaidCount").html(res.TotalPaidCount);
  153. // $("#spnPaidAmount").html(res.TotalPaidAmount);
  154. // }
  155. // });
  156. }
  157. function gridLoaded(data) {
  158. if (data && data.total) {
  159. var rows = $("#dgStudentFeeClassStatisticList").cmsXDataTable("getRows");
  160. if ($.grep(rows, function (x) { return x.Year == null; }).length == 0) {
  161. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentFee/ClassStatisticTotal', $.getDataGridParams("dgStudentFeeClassStatisticList"),
  162. function (res) {
  163. if (res) {
  164. rows.push({
  165. Year: null,
  166. CollegeID: null,
  167. CollegeName: null,
  168. ClassmajorID: null,
  169. ClassmajorName: null,
  170. ExaminationTypeID: null,
  171. ExaminationTypeName: null,
  172. ExaminationProjectID: null,
  173. ExaminationProjectName: null,
  174. FeeTypeID: null,
  175. FeeTypeName: null,
  176. TotalRegistCount: res.TotalRegistCount,
  177. TotalRegistAmount: res.TotalRegistAmount,
  178. TotalPaidCount: res.TotalPaidCount,
  179. TotalPaidAmount: res.TotalPaidAmount,
  180. TotalRefundCount: res.TotalRefundCount,
  181. TotalRefundAmount: res.TotalRefundAmount,
  182. TotalRefundApplyCount: res.TotalRefundApplyCount,
  183. TotalRefundApplyAmount: res.TotalRefundApplyAmount,
  184. TotalRefundingCount: res.TotalRefundingCount,
  185. TotalRefundingAmount: res.TotalRefundingAmount,
  186. });
  187. $("#dgStudentFeeClassStatisticList").cmsXDataTable("loadCurPageData", { rows: rows, total: data.total });
  188. }
  189. });
  190. }
  191. }
  192. }
  193. function ClassStatistic_Excel() {
  194. $("#formQuery").submit();
  195. }