ChargeDelay.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ChargeDelay/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgChargeDelayList").cmsXDataTable("load", $.getDataGridParams("dgChargeDelayList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgChargeDelayList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据ID
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgChargeDelayList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.ChargeDelayID);
  24. });
  25. return d;
  26. }
  27. //查看明细
  28. function edit(rowindex, rowdata) {
  29. var redirectTo = url + "?chargeDelayID=" + rowdata.ChargeDelayID + "&MNU=" + mnu + "&Type=1";
  30. $.popupTopWindow('缓交名单信息', redirectTo, 680, 400, null, null);
  31. }
  32. //申请
  33. function ChargeDelay_Apply() {
  34. var redirectTo = url + "?MNU=" + mnu;
  35. $.popupTopWindow('缓交名单申请', redirectTo, 680, 400, null, null);
  36. }
  37. //修改
  38. function ChargeDelay_Update() {
  39. var id = validChoose();
  40. if (id == "") {
  41. $.messager.alert("系统提示", "请选择您要修改的信息。");
  42. return;
  43. }
  44. if (id.length > 1) {
  45. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  46. return;
  47. }
  48. var d = validChooseAll();
  49. if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  50. $.messager.alert("系统提示", "只能对未提交状态的信息进行修改。");
  51. return;
  52. }
  53. var redirectTo = url + "?chargeDelayID=" + id + "&MNU=" + mnu;
  54. $.popupTopWindow('缓交名单修改', redirectTo, 680, 400, null, null);
  55. }
  56. //删除
  57. function ChargeDelay_Delete() {
  58. var id = validChoose().join(',');
  59. if (id == "") {
  60. $.messager.alert("系统提示", "请选择您要删除的信息。");
  61. return;
  62. }
  63. var d = validChooseAll();
  64. if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  65. $.messager.alert("系统提示", "只能对未提交状态的信息进行删除。");
  66. return;
  67. }
  68. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  69. if (r) {
  70. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ChargeDelay/Delete', { chargeDelayIDs: id }, function (data) {
  71. if (data == "删除成功。") {
  72. $.messager.alert("系统提示", data);
  73. $("#dgChargeDelayList").cmsXDataTable('load');
  74. } else {
  75. $.messager.alert("系统提示", data);
  76. }
  77. });
  78. }
  79. });
  80. }
  81. //提交
  82. function ChargeDelay_Submit() {
  83. var chargeDelayIDs = validChoose().join(',');
  84. if (chargeDelayIDs.length == 0) {
  85. $.messager.alert("系统提示", "请选择您要提交的信息。");
  86. return;
  87. }
  88. var d = validChooseAll();
  89. if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  90. $.messager.alert("系统提示", "只能对未提交状态的信息进行提交。");
  91. return;
  92. }
  93. $.messager.confirm("系统提示", "您确定要提交选择的信息?", function (r) {
  94. if (r) {
  95. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ChargeDelay/Submit', { chargeDelayIDs: chargeDelayIDs }, function (data) {
  96. if (data.IsSuccess == true) {
  97. $.messager.alert("系统提示", data.Message);
  98. $("#dgChargeDelayList").cmsXDataTable('load');
  99. } else {
  100. $.messager.alert("系统提示", data.Message);
  101. }
  102. });
  103. }
  104. });
  105. }
  106. //审核
  107. function ChargeDelay_Approve() {
  108. var d = validChooseAll();
  109. if (d.length == 0) {
  110. $.messager.alert("系统提示", "请选择您要审核的信息。");
  111. return;
  112. }
  113. if ($.grep(d, function (v, i) { return v.RecordStatus == startStatusID; }).length > 0) {
  114. $.messager.alert("系统提示", "不能对未提交状态的信息进行审核。");
  115. return;
  116. }
  117. var recordstatus = d[0].RecordStatus;
  118. if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) {
  119. $.messager.alert("系统提示", "不能对不同状态的信息同时进行审核。");
  120. return;
  121. }
  122. if ($.grep(d, function (v, i) { return v.RecordStatus == endStatusID; }).length > 0) {
  123. $.messager.alert("系统提示", "无法对已结束的流程进行审核。");
  124. return;
  125. }
  126. var chargeDelayIDs = validChoose();
  127. if (chargeDelayIDs.length > 1) {
  128. //批量审核
  129. var approveID = chargeDelayIDs[0];
  130. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EC_ChargeDelay&FormID=' + approveID,
  131. 400, 300, ChargeDelay_ApproveConfirm);
  132. }
  133. else {
  134. var chargeDelayID = chargeDelayIDs;
  135. //单个审核
  136. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ChargeDelay/Approve?MNU=" + mnu + "&chargeDelayID=" + chargeDelayID;
  137. $.popupTopWindow('缓交名单审核', redirectTo, 680, 450, null, null);
  138. }
  139. }
  140. //确定(审核)
  141. function ChargeDelay_ApproveConfirm(action) {
  142. if (!action) {
  143. return;
  144. }
  145. if (action.ActionID == "") {
  146. return;
  147. }
  148. var approveIDs = validChoose().join(',');
  149. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/ChargeDelay/BatchApprove", { chargeDelayIDs: approveIDs, actionID: action.Action, comment: action.Comment },
  150. function (data) {
  151. if (data.IsSuccess) {
  152. reload();
  153. }
  154. $.messager.alert("系统提示", data.Message);
  155. }, 'json');
  156. }
  157. //Excel导出
  158. function ChargeDelay_Excel() {
  159. $("#formQuery").submit();
  160. }
  161. //已缴金额列设置颜色为红色
  162. function SetAmountColumn(index, row, value) {
  163. return " <span style=\"color: red;\">" + value + "</span>";
  164. }
  165. //联动查询
  166. function queryStandard(data) {
  167. queryClass();
  168. reload();
  169. }
  170. function queryCollege(data) {
  171. var campusID = $("#CampusDropdown").combogridX("getValue");
  172. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  173. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  174. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  175. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  176. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  177. queryClass();
  178. reload();
  179. }
  180. function queryClass() {
  181. var jsonString = "";
  182. var parameterString = "";
  183. var campusID = $("#CampusDropdown").combogridX("getValue");
  184. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  185. var educationID = $("#DictionaryEducation").combobox("getValue");
  186. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  187. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  188. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  189. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  190. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  191. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  192. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  193. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  194. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  195. if (parameterString != "") {
  196. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  197. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  198. } else {
  199. $("#StandardDictionaryDropDown").combogridX("reload");
  200. }
  201. reload();
  202. }