StudentMinorRegistApply.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentMinorRegistApply/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. RetakeOpenTime();
  7. })
  8. //刷新
  9. function StudentMinorRegistApply_Refresh() {
  10. $("#dgStudentMinorRegistApplyList").cmsXDataTable("load", $.getDataGridParams("dgStudentMinorRegistApplyList"));
  11. }
  12. function reload() {
  13. RetakeOpenTime();
  14. $("#dgStudentMinorRegistApplyList").cmsXDataTable("load", $.getDataGridParams("dgStudentMinorRegistApplyList"));
  15. }
  16. //获取选中的数据
  17. function validChoose() {
  18. var d = [];
  19. $.each($("#dgStudentMinorRegistApplyList").cmsXDataTable("getSelections"), function (index) {
  20. d.push(this.GrademinorID);
  21. });
  22. return d;
  23. }
  24. //辅修报名时间
  25. function RetakeOpenTime() {
  26. $.post(CMS_SystemConfig.VirtualDirectoryPath + "/StudentMinorRegistApply/MinorOpenControl", $.getDataGridParams("dgStudentMinorRegistApplyList"), function (data) {
  27. if (data.IsSuccess) {
  28. $("#labText").text(data.Message);
  29. }
  30. });
  31. }
  32. function CourseList(rowindex, rowdata) {
  33. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentMinorRegistApply/CourseList" + "?grademinorID=" + rowdata.GrademinorID + "&MNU=" + mnu + '&isView=1';
  34. $.popupTopWindow('辅修课程信息详情', redirectTo, 800, 600, null, null);
  35. }
  36. //操作(可报名及取消)
  37. function Click(index, row) {
  38. $(event.srcElement).attr("disabled", "disabled");
  39. if (row.ApplyStatus) {
  40. //取消报名
  41. CancelApply(row.GrademinorID, row.StandardName, $(event.srcElement));
  42. } else {
  43. //报名
  44. Apply(row.GrademinorID, row.StandardName, $(event.srcElement));
  45. }
  46. }
  47. //报名
  48. function Apply(GrademinorID, StandardName, control) {
  49. $.messager.defaults = { ok: "立即报名", cancel: "放弃" };
  50. $.messager.confirm("系统提示", "是否要对此报名信息(" + StandardName + ")进行报名" + "?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentMinorRegistApply/Apply', { GrademinorID: GrademinorID }, function (data) {
  53. if (data.IsSuccess) {
  54. //setTimeout("location.reload(true)", 2000);
  55. }
  56. $.messager.defaults = { ok: "确定", cancel: "取消" };
  57. $.messager.alert("系统提示", data.Message);
  58. control.removeAttr("disabled");
  59. //刷新
  60. StudentMinorRegistApply_Refresh();
  61. });
  62. } else {
  63. control.removeAttr("disabled");
  64. //刷新
  65. StudentMinorRegistApply_Refresh();
  66. }
  67. });
  68. }
  69. //取消报名
  70. function CancelApply(GrademinorID, StandardName, control) {
  71. $.messager.defaults = { ok: "取消报名", cancel: "放弃" };
  72. $.messager.confirm("系统提示", "是否要对此报名信息(" + StandardName + ")取消报名" + "?", function (r) {
  73. if (r) {
  74. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentMinorRegistApply/CancelApply', { GrademinorID: GrademinorID }, function (data) {
  75. if (data.IsSuccess) {
  76. //setTimeout("location.reload(true)", 2000);
  77. }
  78. $.messager.defaults = { ok: "确定", cancel: "取消" };
  79. $.messager.alert("系统提示", data.Message);
  80. control.removeAttr("disabled");
  81. //刷新
  82. StudentMinorRegistApply_Refresh();
  83. });
  84. } else {
  85. control.removeAttr("disabled");
  86. //刷新
  87. StudentMinorRegistApply_Refresh();
  88. }
  89. });
  90. }
  91. //联动查询
  92. function queryStandard(data) {
  93. queryClass();
  94. reload();
  95. }
  96. function queryCollege(data) {
  97. var campusID = $("#CampusDropdown").combogridX("getValue");
  98. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  99. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  100. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  101. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  102. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  103. queryClass();
  104. reload();
  105. }
  106. function queryClass() {
  107. var jsonString = "";
  108. var parameterString = "";
  109. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  110. var yearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  111. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  112. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  113. if (yearID != nonSelect) parameterString += "DictionaryGrade|*|" + yearID + "|@|";
  114. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  115. if (parameterString != "") {
  116. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  117. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  118. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  119. } else {
  120. $("#StandardDictionaryDropDown").combogridX("reload");
  121. }
  122. reload();
  123. }