StudentExaminationSuspension.js 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSuspension/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgExaminationSuspensionList").cmsXDataTable("load", $.getDataGridParams("dgExaminationSuspensionList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgExaminationSuspensionList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this);
  15. });
  16. return d;
  17. }
  18. //新增
  19. function ExaminationSuspension_Add() {
  20. var redirectTo = url + "?MNU=" + mnu;
  21. $.popupTopWindow('缓考申请', redirectTo, 600, 200, null, null);
  22. }
  23. //修改
  24. function ExaminationSuspension_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 + "?examinationSuspensionID=" + d[0].ExaminationSuspensionID + "&MNU=" + mnu;
  40. $.popupTopWindow('缓考申请', redirectTo, 600, 200, null, null);
  41. }
  42. //删除
  43. function ExaminationSuspension_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 examinationSuspensionIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(',');
  55. $.messager.confirm("系统提示", "您确定要删除该缓考申请信息?", function (r) {
  56. if (r) {
  57. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Delete', { examinationSuspensionIDs: examinationSuspensionIDs },
  58. function (data) {
  59. if (data.IsSuccess) {
  60. $.messager.alert("系统提示", "删除成功。");
  61. $("#dgExaminationSuspensionList").cmsXDataTable('load');
  62. } else {
  63. $.messager.alert("系统提示", data.Message);
  64. }
  65. });
  66. }
  67. });
  68. }
  69. //提交
  70. function ExaminationSuspension_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 examinationSuspensionIDs = $.map(d, function (x) { return x.ExaminationSuspensionID; }).join(',');
  81. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSuspension/Submit', { examinationSuspensionIDs: examinationSuspensionIDs }, function (data) {
  82. if (data.IsSuccess) {
  83. $.messager.alert("系统提示", "提交成功!");
  84. $("#dgExaminationSuspensionList").cmsXDataTable('load');
  85. } else {
  86. $.messager.alert("系统提示", data.Message);
  87. }
  88. });
  89. }