StudentCharge.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentCharge/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //查询
  8. function reload() {
  9. $("#dgStudentChargeList").cmsXDataTable("load", $.getDataGridParams("dgStudentChargeList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgStudentChargeList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.StudentChargeID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function StudentCharge_Add() {
  21. var redirectTo = url + "?MNU=" + mnu;
  22. $.popupTopWindow('应收名单新增', redirectTo, 600, 280, null, null);
  23. }
  24. //修改
  25. function StudentCharge_Update() {
  26. var d = validChoose();
  27. if (d == "") {
  28. $.messager.alert("系统提示", "请选择您要修改的信息。");
  29. return;
  30. }
  31. if (d.length > 1) {
  32. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  33. return;
  34. }
  35. var redirectTo = url + "?studentChargeID=" + d + "&MNU=" + mnu;
  36. $.popupTopWindow('应收名单修改', redirectTo, 600, 280, null, null);
  37. }
  38. //删除
  39. function StudentCharge_Delete() {
  40. var d = validChoose().join(',');
  41. if (d == "") {
  42. $.messager.alert("系统提示", "请选择您要删除的信息。");
  43. return;
  44. }
  45. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  46. if (r) {
  47. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentCharge/Delete', { studentChargeIDs: d }, function (data) {
  48. if (data == "删除成功。") {
  49. $.messager.alert("系统提示", data);
  50. $("#dgStudentChargeList").cmsXDataTable('load');
  51. } else {
  52. $.messager.alert("系统提示", data);
  53. }
  54. });
  55. }
  56. });
  57. }
  58. //获取选中的数据
  59. function validChooseTmp() {
  60. var d = [];
  61. $.each($("#dgStudentChargeList").cmsXDataTable("getSelections"), function (index) {
  62. d.push(this.StudentChargeID);
  63. });
  64. return d;
  65. }
  66. //获取选中的数据(this)
  67. function validChooseobj() {
  68. var d = [];
  69. $.each($("#dgStudentChargeList").cmsXDataTable("getSelections"), function (index) {
  70. d.push(this);
  71. });
  72. return d;
  73. }
  74. //费用调整(可批量调整)
  75. function StudentCharge_ChangeActualAmount() {
  76. var d = validChoose().join(',');
  77. if (d.length == "") {
  78. $.messager.alert("系统提示", "请选择要进行费用调整的信息。");
  79. return;
  80. }
  81. var tmps = validChooseTmp().join(',');
  82. var c = validChooseobj();
  83. var orderJsonStr = JSON.stringify(c);
  84. $.popupTopWindow('费用调整', CMS_SystemConfig.VirtualDirectoryPath + '/StudentCharge/ChangeActualAmount?MNU='
  85. + mnu, 420, 280, null, orderJsonStr);
  86. }
  87. //应收名单缓交申请
  88. function StudentCharge_ChargeDelay() {
  89. var d = validChoose().join(',');
  90. var studentChargeID = d;
  91. if (d.length == "") {
  92. $.messager.alert("系统提示", "请选择要申请的信息。");
  93. return;
  94. }
  95. var len = validChoose();
  96. if (len.length > 1) {
  97. $.messager.alert("系统提示", "只能选择单个记录进行申请。");
  98. return;
  99. }
  100. //var c = validChooseobj();
  101. //var orderJsonStr = JSON.stringify(c);
  102. var redirectTo = "/StudentCharge/ChargeDelay" + "?studentChargeID=" + d + "&MNU=" + mnu;
  103. $.popupTopWindow('缓交申请', CMS_SystemConfig.VirtualDirectoryPath + redirectTo, 680, 400, null, null);
  104. }
  105. //已缴金额列设置颜色为红色
  106. function SetPaidAmountColumn(index, row, value) {
  107. return " <span style=\"color: red;\">" + value + "</span>";
  108. }
  109. //导出
  110. function StudentCharge_Excel() {
  111. $("#formQuery").submit();
  112. }
  113. //联动查询
  114. function queryStandard(data) {
  115. queryClass();
  116. reload();
  117. }
  118. function queryCollege(data) {
  119. var campusID = $("#CampusDropdown").combogridX("getValue");
  120. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  121. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  122. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  123. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  124. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  125. queryClass();
  126. reload();
  127. }
  128. function queryClass() {
  129. var jsonString = "";
  130. var parameterString = "";
  131. var campusID = $("#CampusDropdown").combogridX("getValue");
  132. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  133. var educationID = $("#DictionaryEducation").combobox("getValue");
  134. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  135. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  136. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  137. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  138. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  139. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  140. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  141. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  142. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  143. if (parameterString != "") {
  144. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  145. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  146. } else {
  147. $("#StandardDictionaryDropDown").combogridX("reload");
  148. }
  149. reload();
  150. }