RetakePlanList.js 5.0 KB

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