StudentExaminationExemption.js 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationExemption/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgExaminationExemptionList").cmsXDataTable("load", $.getDataGridParams("dgExaminationExemptionList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgExaminationExemptionList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this);
  15. });
  16. return d;
  17. }
  18. //新增
  19. function ExaminationExemption_Add() {
  20. var redirectTo = url + "?MNU=" + mnu;
  21. $.popupTopWindow('免考申请', redirectTo, 600, 200, null, null);
  22. }
  23. //修改
  24. function ExaminationExemption_Edit() {
  25. var d = validChoose();
  26. if (d.length == 0) {
  27. $.messager.alert("系统提示", "请选择您要修改的免考申请。");
  28. return;
  29. }
  30. if (d.length > 1) {
  31. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  32. return;
  33. }
  34. var recordstatus = d[0].RecordStatus;
  35. if (recordstatus != startStatusID) {
  36. $.messager.alert("系统提示", "该免考申请已经提交,无法修改。");
  37. return;
  38. }
  39. var redirectTo = url + "?examinationExemptionID=" + d[0].ExaminationExemptionID + "&MNU=" + mnu;
  40. $.popupTopWindow('免考申请', redirectTo, 600, 200, null, null);
  41. }
  42. //删除
  43. function ExaminationExemption_Delete() {
  44. var d = validChoose();
  45. if (d.length == 0) {
  46. $.messager.alert("系统提示", "请选择您要删除的免考申请。");
  47. return;
  48. }
  49. var recordstatus = d[0].RecordStatus;
  50. if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  51. $.messager.alert("系统提示", "所选的免考申请有部分已经提交,无法删除。");
  52. return;
  53. }
  54. var examinationExemptionIDs = $.map(d, function (x) { return x.ExaminationExemptionID; }).join(',');
  55. $.messager.confirm("系统提示", "您确定要删除该免考申请信息?", function (r) {
  56. if (r) {
  57. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationExemption/Delete', { examinationExemptionIDs: examinationExemptionIDs },
  58. function (data) {
  59. if (data.IsSuccess) {
  60. $.messager.alert("系统提示", "删除成功。");
  61. $("#dgExaminationExemptionList").cmsXDataTable('load');
  62. } else {
  63. $.messager.alert("系统提示", data.Message);
  64. }
  65. });
  66. }
  67. });
  68. }
  69. //提交
  70. function ExaminationExemption_Submit() {
  71. var d = validChoose();
  72. if (d.length == 0) {
  73. $.messager.alert("系统提示", "请选择您要提交的免考申请。");
  74. return;
  75. }
  76. if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  77. $.messager.alert("系统提示", "所选的免考申请有部分已经提交,无法再次提交。");
  78. return;
  79. }
  80. var examinationExemptionIDs = $.map(d, function (x) { return x.ExaminationExemptionID; }).join(',');
  81. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationExemption/Submit', { examinationExemptionIDs: examinationExemptionIDs }, function (data) {
  82. if (data.IsSuccess) {
  83. $.messager.alert("系统提示", "提交成功!");
  84. $("#dgExaminationExemptionList").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data.Message);
  87. }
  88. });
  89. }