StudentChargePaymen.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentChargePaymen/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgStudentChargePaymenList").cmsXDataTable("load", $.getDataGridParams("dgStudentChargePaymenList"));
  10. //统计缴费总金额
  11. $.post(CMS_SystemConfig.VirtualDirectoryPath + "/StudentChargePaymen/AmountCountList", $.getDataGridParams("dgStudentChargePaymenList"), function (data) {
  12. $("#amountSum").html(data.AmountSum.toString());
  13. })
  14. }
  15. //获取选中的数据
  16. function validChoose() {
  17. var d = [];
  18. $.each($("#dgStudentChargePaymenList").cmsXDataTable("getSelections"), function (index) {
  19. d.push(this.StudentChargePaymentID);
  20. });
  21. return d;
  22. }
  23. //新增
  24. function StudentChargePaymen_Add() {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('学生缴费新增', redirectTo, 600, 320, null, null);
  27. }
  28. //修改
  29. function StudentChargePaymen_Update() {
  30. var d = validChoose();
  31. if (d == "") {
  32. $.messager.alert("系统提示", "请选择您要修改的信息。");
  33. return;
  34. }
  35. if (d.length > 1) {
  36. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  37. return;
  38. }
  39. var redirectTo = url + "?studentChargePaymentID=" + d + "&MNU=" + mnu;
  40. $.popupTopWindow('学生缴费修改', redirectTo, 600, 320, null, null);
  41. }
  42. //批量修改(重写)
  43. SystemBatchModifyControl.OnSubmit = function () {
  44. if (document.getElementById("AmountNumberBox_div").style.display != "none") {
  45. //缴费金额
  46. var amount = $("#Amount_NumberBox").val();
  47. if (amount == null || amount == "") {
  48. $.messager.alert("系统提示", "请输入缴费金额。");
  49. return false;
  50. }
  51. //正浮点数 ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$
  52. var reg = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;
  53. if (!reg.test(amount)) {
  54. $.messager.alert("系统提示", "缴费金额输入有误,请重新输入。");
  55. return false;
  56. }
  57. var d = validChoose().join(',');
  58. if (d == "") {
  59. return;
  60. }
  61. if (parseFloat(amount) > 0) {
  62. $.messager.confirm("系统提示", "您确定要批量修改选择的信息吗?", function (r) {
  63. if (r) {
  64. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/BatchModifyControl', { studentChargePaymentIDs: d, amount: amount }, function (data) {
  65. if (data.IsSuccess) {
  66. $.messager.alert("系统提示", data.Message);
  67. reload();
  68. }
  69. });
  70. }
  71. });
  72. return true;
  73. }
  74. else {
  75. $.messager.alert("系统提示", "缴费金额输入有误。");
  76. //reload();
  77. return false;
  78. }
  79. }
  80. }
  81. //删除
  82. function StudentChargePaymen_Delete() {
  83. var d = validChoose().join(',');
  84. if (d == "") {
  85. $.messager.alert("系统提示", "请选择您要删除的信息。");
  86. return;
  87. }
  88. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  89. if (r) {
  90. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/Delete', { studentChargePaymenIDs: d }, function (data) {
  91. if (data == "删除成功。") {
  92. $.messager.alert("系统提示", data);
  93. $("#dgStudentChargePaymenList").cmsXDataTable('load');
  94. } else {
  95. $.messager.alert("系统提示", data);
  96. }
  97. });
  98. }
  99. });
  100. }
  101. //Excel导入
  102. function StudentChargePaymen_Import() {
  103. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentChargePaymen/Import?MNU=' + mnu;
  104. $.popupTopWindow('学生缴费导入', redirectTo, 420, 300, reload);
  105. }
  106. //Excel导出
  107. function StudentChargePaymen_Excel() {
  108. $("#formQuery").submit();
  109. }
  110. //已缴金额列设置颜色为红色
  111. function SetAmountColumn(index, row, value) {
  112. return " <span style=\"color: red;\">" + value + "</span>";
  113. }
  114. //联动查询
  115. function queryStandard(data) {
  116. queryClass();
  117. reload();
  118. }
  119. function queryCollege(data) {
  120. var campusID = $("#CampusDropdown").combogridX("getValue");
  121. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  122. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  123. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  124. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  125. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  126. queryClass();
  127. reload();
  128. }
  129. function queryClass() {
  130. var jsonString = "";
  131. var parameterString = "";
  132. var campusID = $("#CampusDropdown").combogridX("getValue");
  133. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  134. var educationID = $("#DictionaryEducation").combobox("getValue");
  135. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  136. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  137. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  138. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  139. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  140. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  141. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  142. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  143. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  144. if (parameterString != "") {
  145. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  146. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  147. } else {
  148. $("#StandardDictionaryDropDown").combogridX("reload");
  149. }
  150. reload();
  151. }