StudentChargeDelay.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentChargeDelay/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgStudentChargeDelayList").cmsXDataTable("load", $.getDataGridParams("dgStudentChargeDelayList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgStudentChargeDelayList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据ID
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgStudentChargeDelayList").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, 380, null, null);
  31. }
  32. //申请
  33. function StudentChargeDelay_Apply() {
  34. var redirectTo = url + "?MNU=" + mnu;
  35. $.popupTopWindow('缓交申请', redirectTo, 680, 380, null, null);
  36. }
  37. //修改
  38. function StudentChargeDelay_Edit() {
  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, 380, null, null);
  55. }
  56. //删除
  57. function StudentChargeDelay_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. $("#dgStudentChargeDelayList").cmsXDataTable('load');
  74. } else {
  75. $.messager.alert("系统提示", data);
  76. }
  77. });
  78. }
  79. });
  80. }
  81. //提交
  82. function StudentChargeDelay_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. $("#dgStudentChargeDelayList").cmsXDataTable('load');
  99. } else {
  100. $.messager.alert("系统提示", data.Message);
  101. }
  102. });
  103. }
  104. });
  105. }
  106. //Excel导出
  107. function StudentChargeDelay_Excel() {
  108. $("#formQuery").submit();
  109. }
  110. //已缴金额列设置颜色为红色
  111. function SetAmountColumn(index, row, value) {
  112. return " <span style=\"color: red;\">" + value + "</span>";
  113. }