GraduationCourse.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationCourse/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGraduationCourseList").cmsXDataTable("load", $.getDataGridParams("dgGraduationCourseList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGraduationCourseList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationCourseID);
  16. });
  17. return d;
  18. }
  19. //计划生成
  20. function GraduationCourse_Create() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationCourse/PlanCreate" + "?MNU=" + mnu;
  22. $.popupTopWindow('计划生成', redirectTo, 850, 550, reload, null);
  23. }
  24. //新增
  25. function GraduationCourse_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('毕业课程复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GraduationCourse/CopyAdd?GraduationCourseID=' + d[0] + '&MNU=' + mnu, 650, 245, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('毕业课程新增', redirectTo, 650, 245, null, null);
  32. }
  33. }
  34. //修改
  35. function GraduationCourse_Update() {
  36. var d = validChoose();
  37. if (d.length == 0) {
  38. $.messager.alert("系统信息", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?GraduationCourseID=" + d + "&MNU=" + mnu;
  46. $.popupTopWindow('毕业课程修改', redirectTo, 650, 245, null, null);
  47. }
  48. //删除
  49. function GraduationCourse_Delete() {
  50. var d = validChoose().join(',');
  51. if (d == "") {
  52. $.messager.alert("系统提示", "请选择您要删除的信息。");
  53. return;
  54. }
  55. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/GraduationCourse/Delete', { graduationCourseIDs: d }, function (data) {
  58. if (data == "删除成功。") {
  59. $.messager.alert("系统提示", data);
  60. $("#dgGraduationCourseList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //设置列颜色为红色
  69. function SetRedColumn(index, row, value) {
  70. return " <span style=\"color: red;\">" + value + "</span>";
  71. }
  72. //Excel导出
  73. function GraduationCourse_Export() {
  74. $("#formQuery").submit();
  75. }
  76. //联动查询
  77. function queryStandard(data) {
  78. queryClass();
  79. }
  80. function queryCollege(data) {
  81. var campusID = $("#CampusDropdown").combogridX("getValue");
  82. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  83. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  84. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  85. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  86. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  87. queryClass();
  88. }
  89. function queryClass() {
  90. var jsonString = "";
  91. var parameterString = "";
  92. var campusID = $("#CampusDropdown").combogridX("getValue");
  93. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  94. var educationID = $("#DictionaryEducation").combogridX("getValue");
  95. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  96. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  97. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  98. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  99. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  100. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  101. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  102. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  103. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  104. if (parameterString != "") {
  105. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  106. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  107. } else {
  108. $("#StandardDictionaryDropDown").combogridX("reload");
  109. }
  110. reload();
  111. }