StudentFeeList.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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 querySchoolYear() {
  50. var jsonString = "";
  51. var parameterString = "";
  52. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  53. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  54. if (parameterString != "") {
  55. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  56. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  57. }
  58. reload();
  59. }
  60. function queryBatch() {
  61. var jsonString = "";
  62. var parameterString = "";
  63. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  64. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  65. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  66. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  67. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  68. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  69. if (parameterString != "") {
  70. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  71. $("#cgExaminationType").combogridX("reload", eval(jsonString));
  72. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  73. }
  74. reload();
  75. }
  76. function queryType() {
  77. var jsonString = "";
  78. var parameterString = "";
  79. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  80. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  81. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  82. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  83. if (parameterString != "") {
  84. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  85. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  86. }
  87. reload();
  88. }
  89. function examinationProjectLoaded() {
  90. try {
  91. var collegeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/College/CollegeDropdownListOnlyCollege?bindType=1';
  92. $("#ddlCollege").combobox('reload', collegeUrl);
  93. } catch (e) {
  94. }
  95. reload();
  96. }
  97. function collegeChange() {
  98. try {
  99. var jsonString = "";
  100. var parameterString = "";
  101. var campusID = $("#ddlCampus").combobox('getValue');
  102. var collegeID = $("#ddlCollege").combobox('getValue');
  103. var yearID = $("#ddlYear").combobox("getValue");
  104. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  105. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  106. if (yearID != nonSelect) parameterString += "DictionarySchoolyear|*|" + yearID + "|@|";
  107. if (parameterString != "") {
  108. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  109. $("#cgbClassmajor").combogridX("reload", eval(jsonString));
  110. } else {
  111. $("#cgbClassmajor").combogridX("reload");
  112. }
  113. } catch (e) {
  114. }
  115. }
  116. function collegeSelect() {
  117. collegeChange();
  118. reload();
  119. }
  120. function reload() {
  121. $("#dgStudentFeeList").cmsXDataTable("load", $.getDataGridParams("dgStudentFeeList"));
  122. }
  123. // 获取选中的数据
  124. function validChoose() {
  125. var d = [];
  126. $.each($("#dgStudentFeeList").cmsXDataTable("getSelections"), function (index) {
  127. if (this.ExaminationRegistrationID) {
  128. d.push(this.ExaminationRegistrationID);
  129. }
  130. });
  131. return d;
  132. }
  133. // 获取选中的数据
  134. function validChooseAll() {
  135. var d = [];
  136. $.each($("#dgStudentFeeList").cmsXDataTable("getSelections"), function (index) {
  137. if (this.ExaminationRegistrationID) {
  138. d.push(this);
  139. }
  140. });
  141. return d;
  142. }
  143. function StudentFee_Excel() {
  144. $("[name='selectedIDs']").val(validChoose().join(','));
  145. $("#formQuery").submit();
  146. }
  147. function StudentFee_Receipt() {
  148. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/ReceiptSetting?MNU=" + mnu;
  149. $.popupTopWindow('设置收据号', redirectTo, 500, 160, null, null);
  150. }
  151. function StudentFee_InvalidReceipt() {
  152. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/InvalidReceipt?MNU=" + mnu;
  153. $.popupTopWindow('作废收据号', redirectTo, 500, 160, null, null);
  154. }
  155. function StudentFee_Print() {
  156. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/Print?MNU=" + mnu;
  157. $.popupTopWindow('缴费打印', redirectTo, 1024, 600, null, reload);
  158. }
  159. function StudentFee_PrintGDCX() {
  160. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/PrintGDCX?MNU=" + mnu;
  161. $.popupTopWindow('缴费打印', redirectTo, 1024, 600, null, reload);
  162. }
  163. function StudentFee_Refund() {
  164. var ids = validChooseAll();
  165. if (ids.length == 0) {
  166. $.messager.alert("系统提示", "请选择您要退费的缴费记录。");
  167. return;
  168. }
  169. if (ids.length > 1) {
  170. $.messager.alert("系统提示", "只能选择单个记录进行退费。");
  171. return;
  172. }
  173. if (ids[0].ExaminationRegistrationConfirmID == null) {
  174. $.messager.alert("系统提示", "退费申请只针对线下缴费,在线缴费请在学生端或微信端进行退费。");
  175. return;
  176. }
  177. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/Refund?MNU=" + mnu + "&examinationRegistrationID=" + ids[0].ExaminationRegistrationID;
  178. $.popupTopWindow('退费申请', redirectTo, 1024, 600, null, reload);
  179. }
  180. function StudentFee_RefundConfirm() {
  181. var ids = validChooseAll();
  182. if (ids.length == 0) {
  183. $.messager.alert("系统提示", "请选择您要确认的退费记录。");
  184. return;
  185. }
  186. if (ids.length > 1) {
  187. $.messager.alert("系统提示", "只能选择单个记录进行确认。");
  188. return;
  189. }
  190. var errStatusList = $.grep(ids, function (x) { return x.RecordStatus != refundingStatusID });
  191. if (errStatusList.length > 0) {
  192. $.messager.alert("系统提示", "只能选择待退费的记录进行确认。");
  193. return;
  194. }
  195. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/RefundConfirm?MNU=" + mnu + "&examinationRegistrationID=" + ids[0].ExaminationRegistrationID;
  196. $.popupTopWindow('退费确认', redirectTo, 1024, 600, null, reload);
  197. }
  198. function gridLoaded(data) {
  199. if (data && data.total) {
  200. var rows = $("#dgStudentFeeList").cmsXDataTable("getRows");
  201. if ($.grep(rows, function (x) { return x.ExaminationRegistrationID == null; }).length == 0) {
  202. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentFee/ListSum', $.getDataGridParams("dgStudentFeeList"),
  203. function (res) {
  204. if (res) {
  205. rows.push({
  206. ExaminationRegistrationID: null,
  207. ExaminationBatchProjectID: null,
  208. ExaminationProjectID: null,
  209. ExaminationRegistrationConfirmID: null,
  210. No: null,
  211. ReceiptNo: null,
  212. ExaminationProjectName: null,
  213. ExaminationBatchName: null,
  214. SchoolyearID: null,
  215. SchoolyearCode: null,
  216. ExaminationProjectFeeTypeID: null,
  217. FeeTypeID: null,
  218. FeeTypeName: null,
  219. UserID: null,
  220. CollegeID: null,
  221. ClassmajorID: null,
  222. ClassmajorName: null,
  223. LoginID: null,
  224. StudentNo: null,
  225. UserName: null,
  226. Sex: null,
  227. SexName: null,
  228. CertificatesType: null,
  229. CertificatesTypeName: null,
  230. IDNumber: null,
  231. Fee: res,
  232. Remark: null,
  233. RecordStatus: null,
  234. RecordStatusName: null,
  235. PayTime: null
  236. });
  237. $("#dgStudentFeeList").cmsXDataTable("loadCurPageData", { rows: rows, total: data.total });
  238. }
  239. });
  240. }
  241. }
  242. }
  243. //function payTimeChanged() {
  244. // var payTimeStart = $("#StartDate").val();
  245. // var payTimeEnd = $("#EndDate").val();
  246. // //if (payTimeStart != "" && payTimeEnd != "") {
  247. // // if (payTimeEnd.ymdToDate() < payTimeStart.ymdToDate()) {
  248. // // $.messager.alert("系统提示", "缴费时间起必须小于或等于缴费时间止。");
  249. // // return;
  250. // // }
  251. // //}
  252. // reload();
  253. //}
  254. function StudentFee_RefundAprrove() {
  255. var ids = validChoose();
  256. var list = validChooseAll();
  257. if (ids.length == 0) {
  258. $.messager.alert("系统提示", "请选择您要退费审核的缴费记录。");
  259. return;
  260. }
  261. var errStatusList = $.grep(list, function (x) { return x.RecordStatus != refundApplyID });
  262. if (errStatusList.length > 0) {
  263. $.messager.alert("系统提示", "只能选择退费申请状态的记录进行审核。");
  264. return;
  265. }
  266. var examinationRegistrationIDs = ids.join(',');
  267. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentFee/RefundApprove?MNU=" + mnu + "&examinationRegistrationIDs=" + examinationRegistrationIDs;
  268. $.popupTopWindow('退费审核', redirectTo, 400, 200, null, reload);
  269. }
  270. function startDateChanged(dp) {
  271. $("#StartDate").val($dp.cal.getNewDateStr());
  272. reload();
  273. }
  274. function endDateChanged(dp) {
  275. $("#EndDate").val($dp.cal.getNewDateStr());
  276. reload();
  277. }
  278. function refundStartDateChanged(dp) {
  279. $("#RefundStartDate").val($dp.cal.getNewDateStr());
  280. reload();
  281. }
  282. function refundEndDateChanged(dp) {
  283. $("#RefundEndDate").val($dp.cal.getNewDateStr());
  284. reload();
  285. }