ClassmajorEdit.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //加载
  2. $(function () {
  3. //非负浮点数(/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/)
  4. var reg = /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/;
  5. var learnSystem = $("#LearnSystem").val();
  6. if (learnSystem == "" || learnSystem == null) {
  7. $("#LearnSystem").val("");
  8. }
  9. else {
  10. if (!reg.test(learnSystem)) {
  11. $("#LearnSystem").val("");
  12. }
  13. else {
  14. $("#LearnSystem").val(parseFloat(learnSystem).toFixed(1));
  15. }
  16. }
  17. });
  18. //保存
  19. function Classmajor_Save() {
  20. $(document.forms[0]).submit();
  21. }
  22. //点击收缩(年级专业信息)
  23. function swapGrademajor() {
  24. if ($("#grademajorExpander").attr("expanded") == "1") {
  25. $("#grademajorExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  26. $("#grademajorExpander").closest("tr")
  27. .next().css("display", "")
  28. .next().css("display", "")
  29. .next().css("display", "");
  30. $("#grademajorExpander").attr("expanded", "0");
  31. } else {
  32. $("#grademajorExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  33. $("#grademajorExpander").closest("tr")
  34. .next().css("display", "none")
  35. .next().css("display", "none")
  36. .next().css("display", "none");
  37. $("#grademajorExpander").attr("expanded", "1");
  38. }
  39. }
  40. //联动查询
  41. function queryCollege(data) {
  42. var campusID = $("#CampusID").combogridX("getValue");
  43. var collegeID = $("#CollegeID").combogridX("getValue");
  44. if (collegeID == "" || collegeID == "-1" || collegeID == null) {
  45. //$("#GradeID").combogridX("setValue", "-1"); //combobox
  46. //$("#StandardID").combogridX("setValue", "-1");
  47. $("#EducationID").combogridX("setValue", "-1");
  48. $("#LearningformID").combogridX("setValue", "-1");
  49. $("#LearnSystem").val("");
  50. $("#GrademajorID").combogridX("setValue", "-1");
  51. }
  52. else {
  53. //$("#GradeID").combogridX("setValue", "-1");
  54. //$("#StandardID").combogridX("setValue", "-1");
  55. $("#EducationID").combogridX("setValue", "-1");
  56. $("#LearningformID").combogridX("setValue", "-1");
  57. $("#LearnSystem").val("");
  58. $("#GrademajorID").combogridX("setValue", "-1");
  59. }
  60. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  61. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  62. $("#CollegeID").combogridX("reload", eval(jsonString));
  63. $("#StandardID").combogridX("reload", eval(jsonString));
  64. queryClass();
  65. }
  66. function queryGrade(data) {
  67. var gradeID = $("#GradeID").combogridX("getValue");
  68. if (gradeID == "" || gradeID == "-1" || gradeID == null) {
  69. //$("#StandardID").combogridX("setValue", "-1");
  70. $("#EducationID").combogridX("setValue", "-1");
  71. $("#LearningformID").combogridX("setValue", "-1");
  72. $("#LearnSystem").val("");
  73. $("#GrademajorID").combogridX("setValue", "-1");
  74. }
  75. else {
  76. //$("#StandardID").combogridX("setValue", "-1");
  77. $("#EducationID").combogridX("setValue", "-1");
  78. $("#LearningformID").combogridX("setValue", "-1");
  79. $("#LearnSystem").val("");
  80. $("#GrademajorID").combogridX("setValue", "-1");
  81. }
  82. queryClass();
  83. }
  84. function queryStandard(data) {
  85. var standardID = $("#StandardID").combogridX("getValue");
  86. if (standardID == "" || standardID == "-1" || standardID == null) {
  87. $("#EducationID").combogridX("setValue", "-1");
  88. $("#LearningformID").combogridX("setValue", "-1");
  89. $("#LearnSystem").val("");
  90. $("#GrademajorID").combogridX("setValue", "-1");
  91. }
  92. else {
  93. $("#EducationID").combogridX("setValue", "-1");
  94. $("#LearningformID").combogridX("setValue", "-1");
  95. $("#LearnSystem").val("");
  96. $("#GrademajorID").combogridX("setValue", "-1");
  97. }
  98. queryClass();
  99. }
  100. function queryGrademajor(data) {
  101. var grademajorID = $("#GrademajorID").combogridX("getValue");
  102. if (grademajorID == "" || grademajorID == "-1" || grademajorID == null) {
  103. $("#CollegeID").combogridX("setValue", "-1");
  104. $("#GradeID").combogridX("setValue", "-1");
  105. $("#StandardID").combogridX("setValue", "-1");
  106. $("#EducationID").combogridX("setValue", "-1");
  107. $("#LearningformID").combogridX("setValue", "-1");
  108. $("#LearnSystem").val("");
  109. }
  110. else {
  111. $("#CollegeID").combogridX("setValue", data.CollegeID);
  112. $("#GradeID").combogridX("setValue", data.GradeID);
  113. $("#StandardID").combogridX("setValue", data.StandardID);
  114. $("#EducationID").combogridX("setValue", data.EducationID);
  115. $("#LearningformID").combogridX("setValue", data.LearningformID);
  116. $("#LearnSystem").val(data.LearnSystem);
  117. }
  118. queryClass();
  119. }
  120. function queryClass() {
  121. var jsonString = "";
  122. var parameterString = "";
  123. var collegeID = $("#CollegeID").combogridX("getValue");
  124. var gradeID = $("#GradeID").combogridX("getValue");
  125. var standardID = $("#StandardID").combogridX("getValue");
  126. var educationID = $("#EducationID").combogridX("getValue");
  127. var learningformID = $("#LearningformID").combogridX("getValue");
  128. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  129. if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
  130. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  131. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  132. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  133. if (parameterString != "") {
  134. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  135. $("#StandardID").combogridX("reload", eval(jsonString));
  136. $("#GrademajorID").combogridX("reload", eval(jsonString));
  137. }
  138. else {
  139. $("#StandardID").combogridX("reload");
  140. $("#GrademajorID").combogridX("reload");
  141. }
  142. }