GraduateCardList.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduateCardList/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGraduateCardList").cmsXDataTable("load", $.getDataGridParams("dgGraduateCardList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGraduateCardList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduateCardApplyID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function GraduateCardList_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('去向名单复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduateCardList/CopyAdd?graduateCardApplyID=' + d[0] + '&MNU=' + mnu, 680, 385, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('去向名单新增', redirectTo, 680, 385, null, null);
  27. }
  28. }
  29. //修改
  30. function GraduateCardList_Edit() {
  31. var d = validChoose();
  32. if (d.length == 0) {
  33. $.messager.alert("系统信息", "请选择您要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?graduateCardApplyID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('去向名单修改', redirectTo, 680, 385, null, null);
  42. }
  43. //删除
  44. function GraduateCardList_Delete() {
  45. var d = validChoose().join(',');
  46. if (d == "") {
  47. $.messager.alert("系统提示", "请选择您要删除的信息。");
  48. return;
  49. }
  50. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduateCardList/Delete', { graduateCardApplyIDs: d }, function (data) {
  53. if (data.IsSuccess) {
  54. $.messager.alert("系统提示", data.Message);
  55. $("#dgGraduateCardList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data.Message);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //学生最终成绩明细
  64. function editFinallyScore(rowindex, rowdata) {
  65. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduateCardList/FinallyScoreList?graduateCardApplyID=" + rowdata.GraduateCardApplyID + "&MNU=" + mnu;
  66. $.popupTopWindow('学生最终成绩明细', redirectTo, 1200, 540, null, null);
  67. }
  68. //设置列颜色为红色
  69. function SetRedColumn(index, row, value) {
  70. return " <span style=\"color: red;\">" + value + "</span>";
  71. }
  72. //Excel导出
  73. function GraduateCardList_Export() {
  74. $("#formQuery").submit();
  75. }
  76. //联动查询
  77. function queryCampus(data) {
  78. var campusID = $("#CampusDropdown").combogridX("getValue");
  79. if (campusID != nonSelect) {
  80. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  81. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  82. }
  83. queryClass();
  84. }
  85. function queryCollege(data) {
  86. var campusID = $("#CampusDropdown").combogridX("getValue");
  87. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  88. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  89. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  90. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  91. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  92. queryClass();
  93. }
  94. function querySchoolyear(data) {
  95. queryClass();
  96. }
  97. function queryStandard(data) {
  98. queryClass();
  99. }
  100. function queryClass() {
  101. var jsonString = "";
  102. var parameterString = "";
  103. var campusID = $("#CampusDropdown").combogridX("getValue");
  104. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  105. var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue");
  106. var standardID = $("#DictionaryStandard").combogridX("getValue");
  107. var educationID = $("#DictionaryEducation").combogridX("getValue");
  108. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  109. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  110. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  111. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  112. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  113. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  114. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  115. if (parameterString != "") {
  116. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  117. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  118. }
  119. else {
  120. $("#DictionaryStandard").combogridX("reload");
  121. }
  122. reload();
  123. }