GrademajorRequirement.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/GrademajorRequirement/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgGrademajorRequirementList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorRequirementList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgGrademajorRequirementList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationRequirementID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function GrademajorRequirement_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('专业学分复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/GrademajorRequirement/CopyAdd?graduationRequirementID=' + d[0] + '&MNU=' + mnu, 650, 245, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('专业学分新增', redirectTo, 650, 245, null, null);
  27. }
  28. }
  29. //修改
  30. function GrademajorRequirement_Update() {
  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 + "?graduationRequirementID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('专业学分修改', redirectTo, 650, 245, null, null);
  42. }
  43. //删除
  44. function GrademajorRequirement_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 + '/GrademajorRequirement/Delete', { graduationRequirementIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", data);
  55. $("#dgGrademajorRequirementList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //设置列颜色为红色
  64. function SetRedColumn(index, row, value) {
  65. return " <span style=\"color: red;\">" + value + "</span>";
  66. }
  67. //Excel导出
  68. function GrademajorRequirement_Export() {
  69. $("#formQuery").submit();
  70. }
  71. //联动查询
  72. function queryStandard(data) {
  73. queryClass();
  74. }
  75. function queryCollege(data) {
  76. var campusID = $("#CampusDropdown").combogridX("getValue");
  77. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  78. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  79. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  80. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  81. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  82. queryClass();
  83. }
  84. function queryClass() {
  85. var jsonString = "";
  86. var parameterString = "";
  87. var campusID = $("#CampusDropdown").combogridX("getValue");
  88. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  89. var educationID = $("#DictionaryEducation").combogridX("getValue");
  90. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  91. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  92. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  93. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  94. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  95. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  96. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  97. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  98. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  99. if (parameterString != "") {
  100. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  101. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  102. } else {
  103. $("#StandardDictionaryDropDown").combogridX("reload");
  104. }
  105. reload();
  106. }