RetakePlanResult.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. //获取选中的数据
  7. function validChoose() {
  8. var d = [];
  9. $.each($("#dgRetakePlanResultList").cmsXDataTable("getSelections"), function (index) {
  10. d.push(this.RetakePlanStudentID);
  11. });
  12. return d;
  13. }
  14. //获取选中的数据
  15. function validChooseUserID() {
  16. var d = [];
  17. $.each($("#dgRetakePlanResultList").cmsXDataTable("getSelections"), function (index) {
  18. d.push(this.UserID);
  19. });
  20. return d;
  21. }
  22. //获取选中的重修任务状态
  23. function validChooseStatus() {
  24. var d = [];
  25. $.each($("#dgRetakePlanResultList").cmsXDataTable("getSelections"), function (index) {
  26. d.push(this.RecordStatus);
  27. });
  28. return d;
  29. }
  30. function reload() {
  31. $("#dgRetakePlanResultList").cmsXDataTable("load", $.getDataGridParams("dgRetakePlanResultList"));
  32. }
  33. //取消报名(删除)
  34. function RetakePlanResultList_Delete() {
  35. var retakePlanStudentIDs = validChoose();
  36. var r = validChooseStatus();
  37. if (retakePlanStudentIDs.length == 0) {
  38. $.messager.alert("系统提示", "请选择您要取消报名的信息。");
  39. return;
  40. }
  41. for (var i = 0; i < r.length; i++) {
  42. if (r[i] == CreatedStatus) {
  43. $.messager.alert("系统提示", "无法对已开班状态的信息取消报名。");
  44. return;
  45. }
  46. }
  47. $.messager.confirm("系统提示", "您确定要对选择的信息取消报名?", function (r) {
  48. if (r) {
  49. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanResult/Delete', { RetakePlanStudentIDs: retakePlanStudentIDs.join(',') }, function (data) {
  50. $.messager.alert("系统提示", data.Message);
  51. if (data.IsSuccess) {
  52. $("#dgRetakePlanResultList").cmsXDataTable('load');
  53. }
  54. });
  55. }
  56. });
  57. }
  58. //列颜色设置为红色
  59. function SetRedtColumn(index, row, value) {
  60. return " <span style=\"color: red;\">" + value + "</span>";
  61. }
  62. //Excel导出
  63. function RetakePlanResultList_Excel() {
  64. $("#formQuery").submit();
  65. }
  66. //联动查询
  67. function queryStandard(data) {
  68. queryClass();
  69. reload();
  70. }
  71. function queryCollege(data) {
  72. var campusID = $("#CampusDropdown").combogridX("getValue");
  73. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  74. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  75. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  76. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  77. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  78. queryClass();
  79. reload();
  80. }
  81. function queryClass() {
  82. var jsonString = "";
  83. var parameterString = "";
  84. var campusID = $("#CampusDropdown").combogridX("getValue");
  85. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  86. var educationID = $("#DictionaryEducation").combobox("getValue");
  87. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  88. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  89. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  90. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  91. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  92. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  93. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  94. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  95. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  96. if (parameterString != "") {
  97. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  98. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  99. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  100. } else {
  101. $("#ClassmajorDropdown").combogridX("reload");
  102. $("#StandardDictionaryDropDown").combogridX("reload");
  103. }
  104. reload();
  105. }