EvaluationGradeControl.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationGradeControl/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationGradeControlList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationGradeControlList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgEvaluationGradeControlList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgEvaluationGradeControlList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.EvaluationGradeControlID);
  24. });
  25. return d;
  26. }
  27. //查看
  28. function edit(rowindex, rowdata) {
  29. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationGradeControl/Edit?evaluationGradeControlID=" + rowdata.EvaluationGradeControlID + "&MNU=" + mnu + "&type=detail";
  30. $.popupTopWindow('年级控制信息', redirectTo, 700, 345, null, null);
  31. }
  32. //新增
  33. function EvaluationGradeControl_Add() {
  34. var d = validChoose();
  35. if (d.length > 0) {
  36. $.popupTopWindow('年级控制复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationGradeControl/CopyAdd?evaluationGradeControlID=' + d[0] + '&MNU=' + mnu, 700, 345, null, null);
  37. } else {
  38. //var redirectTo = url + "?MNU=" + mnu;
  39. //$.popupTopWindow('年级控制新增', redirectTo, 700, 345, null, null);
  40. //采用以下方式申请
  41. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationGradeControl/EvaluationGradeControlBatchAdd" + "?MNU=" + mnu;
  42. $.popupTopWindow('年级控制新增', redirectTo, 1280, 550, reload, null);
  43. }
  44. }
  45. //修改
  46. function EvaluationGradeControl_Edit() {
  47. var d = validChoose();
  48. if (d == "") {
  49. $.messager.alert("系统提示", "请选择您要修改的信息。");
  50. return;
  51. }
  52. if (d.length > 1) {
  53. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  54. return;
  55. }
  56. var redirectTo = url + "?evaluationGradeControlID=" + d + "&MNU=" + mnu + "&type=edit";
  57. $.popupTopWindow('年级控制修改', redirectTo, 700, 345, null, null);
  58. }
  59. //删除
  60. function EvaluationGradeControl_Delete() {
  61. var d = validChoose().join(',');
  62. if (d == "") {
  63. $.messager.alert("系统提示", "请选择您要删除的信息。");
  64. return;
  65. }
  66. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  67. if (r) {
  68. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationGradeControl/Delete', { evaluationGradeControlIDs: d }, function (data) {
  69. if (data.IsSuccess) {
  70. $.messager.alert("系统提示", data.Message);
  71. $("#dgEvaluationGradeControlList").cmsXDataTable('load');
  72. } else {
  73. $.messager.alert("系统提示", data.Message);
  74. }
  75. });
  76. }
  77. });
  78. }
  79. //设置列颜色为红色
  80. function SetRedColumn(index, row, value) {
  81. return " <span style=\"color: red;\">" + value + "</span>";
  82. }
  83. //Excel导出
  84. function EvaluationGradeControl_Export() {
  85. $("#formQuery").submit();
  86. }
  87. //联动查询
  88. function queryCampus(data) {
  89. var campusID = $("#CampusDropdown").combogridX("getValue");
  90. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  91. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  92. queryClass();
  93. }
  94. function queryCollege(data) {
  95. var campusID = $("#CampusDropdown").combogridX("getValue");
  96. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  97. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  98. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  99. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  100. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  101. queryClass();
  102. }
  103. function queryGrade(data) {
  104. queryClass();
  105. }
  106. function queryStandard(data) {
  107. queryClass();
  108. }
  109. function queryLearnSystem(data) {
  110. queryClass();
  111. }
  112. function queryClass() {
  113. var jsonString = "";
  114. var parameterString = "";
  115. var campusID = $("#CampusDropdown").combogridX("getValue");
  116. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  117. var gradeID = $("#DictionaryGrade").combogridX("getValue");
  118. var standardID = $("#DictionaryStandard").combogridX("getValue");
  119. var educationID = $("#DictionaryEducation").combogridX("getValue");
  120. var learningformID = $("#DictionaryLearningform").combogridX("getValue");
  121. var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  122. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  123. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  124. if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
  125. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  126. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  127. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  128. if (learnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + learnSystem + "|@|";
  129. if (parameterString != "") {
  130. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  131. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  132. }
  133. else {
  134. $("#DictionaryStandard").combogridX("reload");
  135. }
  136. reload();
  137. }