RetakePlanStudentApply.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //刷新
  2. function reload() {
  3. RetakeOpenTime();
  4. $("#dgRetakePlanStudentApplyList").cmsXDataTable("load", $.getDataGridParams("dgRetakePlanStudentApplyList"));
  5. }
  6. //刷新
  7. function RetakePlanStudentApply_Refresh() {
  8. RetakeOpenTime();
  9. $("#dgRetakePlanStudentApplyList").cmsXDataTable("load", $.getDataGridParams("dgRetakePlanStudentApplyList"));
  10. }
  11. //重修报名时间
  12. function RetakeOpenTime() {
  13. $.post(CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanStudentApply/RetakeOpenControl", $.getDataGridParams("dgRetakePlanStudentApplyList"), function (data) {
  14. if (data.IsSuccess) {
  15. $("#labText").text(data.Message);
  16. }
  17. });
  18. }
  19. //操作(可报名及取消)
  20. function Click(index, row) {
  21. $(event.srcElement).attr("disabled", "disabled");
  22. if (row.ApplyStatus) {
  23. //取消报名
  24. CancelApply(row.RetakePlanStudentID, row.CourseName, $(event.srcElement));
  25. } else {
  26. //报名
  27. Apply(row.RetakePlanStudentID, row.CourseName, $(event.srcElement));
  28. }
  29. }
  30. //报名
  31. function Apply(RetakePlanStudentID, CourseName, control) {
  32. $.messager.defaults = { ok: "立即报名", cancel: "放弃" };
  33. $.messager.confirm("系统提示", "是否要对此报名信息(" + CourseName + ")进行报名" + "?", function (r) {
  34. if (r) {
  35. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanStudentApply/Apply', { RetakePlanStudentID: RetakePlanStudentID }, function (data) {
  36. if (data.IsSuccess) {
  37. //setTimeout("location.reload(true)", 2000);
  38. }
  39. $.messager.defaults = { ok: "确定", cancel: "取消" };
  40. $.messager.alert("系统提示", data.Message);
  41. control.removeAttr("disabled");
  42. //刷新
  43. RetakePlanStudentApply_Refresh();
  44. });
  45. } else {
  46. control.removeAttr("disabled");
  47. //刷新
  48. RetakePlanStudentApply_Refresh();
  49. }
  50. });
  51. }
  52. //取消报名
  53. function CancelApply(RetakePlanStudentID, CourseName, control) {
  54. $.messager.defaults = { ok: "取消报名", cancel: "放弃" };
  55. $.messager.confirm("系统提示", "是否要对此报名信息(" + CourseName + ")取消报名" + "?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanStudentApply/CancelApply', { RetakePlanStudentID: RetakePlanStudentID }, function (data) {
  58. if (data.IsSuccess) {
  59. //setTimeout("location.reload(true)", 2000);
  60. }
  61. $.messager.defaults = { ok: "确定", cancel: "取消" };
  62. $.messager.alert("系统提示", data.Message);
  63. control.removeAttr("disabled");
  64. //刷新
  65. RetakePlanStudentApply_Refresh();
  66. });
  67. } else {
  68. control.removeAttr("disabled");
  69. //刷新
  70. RetakePlanStudentApply_Refresh();
  71. }
  72. });
  73. }
  74. //列颜色设置为红色
  75. function SetRedtColumn(index, row, value) {
  76. return " <span style=\"color: red;\">" + value + "</span>";
  77. }