ChangeApplyEdit.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 beforeLearnSystem = $("#BeforeLearnSystem").val();
  6. if (beforeLearnSystem == "" || beforeLearnSystem == null) {
  7. $("#BeforeLearnSystem").val("");
  8. }
  9. else {
  10. if (!reg.test(beforeLearnSystem)) {
  11. $("#BeforeLearnSystem").val("");
  12. }
  13. else {
  14. $("#BeforeLearnSystem").val(parseFloat(beforeLearnSystem).toFixed(1));
  15. }
  16. }
  17. var afterLearnSystem = $("#AfterLearnSystem").val();
  18. if (afterLearnSystem == "" || afterLearnSystem == null) {
  19. $("#AfterLearnSystem").val("");
  20. }
  21. else {
  22. if (!reg.test(afterLearnSystem)) {
  23. $("#AfterLearnSystem").val("");
  24. }
  25. else {
  26. $("#AfterLearnSystem").val(parseFloat(afterLearnSystem).toFixed(1));
  27. }
  28. }
  29. $("#beforeExpander").closest("tr")
  30. .next().css("display", "none")
  31. .next().css("display", "")
  32. .next().css("display", "none")
  33. .next().css("display", "")
  34. .next().css("display", "");
  35. $("#beforeExpander").attr("expanded", "0");
  36. $("#afterExpander").closest("tr")
  37. .next().css("display", "")
  38. .next().css("display", "")
  39. .next().css("display", "")
  40. .next().css("display", "")
  41. .next().css("display", "");
  42. $("#afterExpander").attr("expanded", "0");
  43. });
  44. //点击收缩(异动前信息)
  45. function swapBefore() {
  46. if ($("#beforeExpander").attr("expanded") == "1") {
  47. $("#beforeExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  48. $("#beforeExpander").closest("tr")
  49. .next().css("display", "none")
  50. .next().css("display", "")
  51. .next().css("display", "none")
  52. .next().css("display", "")
  53. .next().css("display", "");
  54. $("#beforeExpander").attr("expanded", "0");
  55. } else {
  56. $("#beforeExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  57. $("#beforeExpander").closest("tr")
  58. .next().css("display", "")
  59. .next().css("display", "")
  60. .next().css("display", "")
  61. .next().css("display", "")
  62. .next().css("display", "");
  63. $("#beforeExpander").attr("expanded", "1");
  64. }
  65. }
  66. //点击收缩(异动后信息)
  67. function swapAfter() {
  68. if ($("#afterExpander").attr("expanded") == "1") {
  69. $("#afterExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  70. $("#afterExpander").closest("tr")
  71. .next().css("display", "")
  72. .next().css("display", "")
  73. .next().css("display", "")
  74. .next().css("display", "")
  75. .next().css("display", "");
  76. $("#afterExpander").attr("expanded", "0");
  77. } else {
  78. $("#afterExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  79. $("#afterExpander").closest("tr")
  80. .next().css("display", "none")
  81. .next().css("display", "")
  82. .next().css("display", "none")
  83. .next().css("display", "")
  84. .next().css("display", "");
  85. $("#afterExpander").attr("expanded", "1");
  86. }
  87. }
  88. //学生信息
  89. function queryStudent(data) {
  90. var userID = $("#UserID").combogridX("getValue");
  91. if (userID == "" || userID == "-1" || userID == null) {
  92. $("#Name").val("");
  93. $("#SexID").combogridX("setValue", "-1");
  94. $("#BeforeCollegeID").combogridX("setValue", "-1");
  95. $("#BeforeGradeID").combogridX("setValue", "-1");
  96. $("#BeforeStandardID").combogridX("setValue", "-1");
  97. $("#BeforeStandardCode").val("");
  98. $("#BeforeEducationID").combogridX("setValue", "-1");
  99. $("#BeforeLearningformID").combogridX("setValue", "-1");
  100. $("#BeforeLearnSystem").val("");
  101. $("#BeforeClassmajorID").combogridX("setValue", "-1");
  102. $("#BeforeInSchoolStatusID").combogridX("setValue", "-1");
  103. $("#BeforeStudentStatus").combogridX("setValue", "-1");
  104. $("#AfterCollegeID").combogridX("setValue", "-1");
  105. $("#AfterGradeID").combogridX("setValue", "-1");
  106. $("#AfterStandardID").combogridX("setValue", "-1");
  107. $("#AfterStandardCode").val("");
  108. $("#AfterEducationID").combogridX("setValue", "-1");
  109. $("#AfterLearningformID").combogridX("setValue", "-1");
  110. $("#AfterLearnSystem").val("");
  111. $("#AfterClassmajorID").combogridX("setValue", "-1");
  112. $("#AfterInSchoolStatusID").combogridX("setValue", "-1");
  113. $("#AfterStudentStatus").combogridX("setValue", "-1");
  114. }
  115. else {
  116. $("#Name").val(data.Name);
  117. $("#SexID").combogridX("setValue", data.SexID);
  118. $("#BeforeCollegeID").combogridX("setValue", data.CollegeID);
  119. $("#BeforeGradeID").combogridX("setValue", data.GradeID);
  120. $("#BeforeStandardID").combogridX("setValue", data.StandardID);
  121. $("#BeforeStandardCode").val(data.StandardCode);
  122. $("#BeforeEducationID").combogridX("setValue", data.EducationID);
  123. $("#BeforeLearningformID").combogridX("setValue", data.LearningformID);
  124. $("#BeforeLearnSystem").val(data.LearnSystem);
  125. $("#BeforeClassmajorID").combogridX("setValue", data.ClassmajorID);
  126. $("#BeforeInSchoolStatusID").combogridX("setValue", data.InSchoolStatusID);
  127. $("#BeforeStudentStatus").combogridX("setValue", data.StudentStatus);
  128. $("#AfterCollegeID").combogridX("setValue", data.CollegeID);
  129. $("#AfterGradeID").combogridX("setValue", data.GradeID);
  130. $("#AfterStandardID").combogridX("setValue", data.StandardID);
  131. $("#AfterStandardCode").val(data.StandardCode);
  132. $("#AfterEducationID").combogridX("setValue", data.EducationID);
  133. $("#AfterLearningformID").combogridX("setValue", data.LearningformID);
  134. $("#AfterLearnSystem").val(data.LearnSystem);
  135. $("#AfterClassmajorID").combogridX("setValue", data.ClassmajorID);
  136. $("#AfterInSchoolStatusID").combogridX("setValue", data.InSchoolStatusID);
  137. $("#AfterStudentStatus").combogridX("setValue", data.StudentStatus);
  138. }
  139. }
  140. //院系所(异动后)
  141. function queryAfterCollege(data) {
  142. var afterCollegeID = $("#AfterCollegeID").combogridX("getValue");
  143. if (afterCollegeID == "" || afterCollegeID == "-1" || afterCollegeID == null) {
  144. $("#AfterClassmajorID").combogridX("setValue", "-1");
  145. } else {
  146. $("#AfterClassmajorID").combogridX("setValue", "-1");
  147. }
  148. queryAfterClass();
  149. }
  150. //专业名称(异动后)
  151. function queryAfterStandard(data) {
  152. var afterStandardID = $("#AfterStandardID").combogridX("getValue");
  153. if (afterStandardID == "" || afterStandardID == "-1" || afterStandardID == null) {
  154. $("#AfterStandardCode").val("");
  155. $("#AfterClassmajorID").combogridX("setValue", "-1");
  156. }
  157. else {
  158. $("#AfterStandardCode").val(data.Code);
  159. $("#AfterClassmajorID").combogridX("setValue", "-1");
  160. }
  161. queryAfterClass();
  162. }
  163. //班级名称(异动后)
  164. function queryAfterClassmajor(data) {
  165. queryAfterClass()
  166. var afterClassmajorID = $("#AfterClassmajorID").combogridX("getValue");
  167. if (afterClassmajorID == "" || afterClassmajorID == "-1" || afterClassmajorID == null) {
  168. $("#AfterCollegeID").combogridX("setValue", "-1");
  169. $("#AfterStandardID").combogridX("setValue", "-1");
  170. $("#AfterStandardCode").val("");
  171. $("#AfterClassmajorID").combogridX("setValue", "-1");
  172. }
  173. else {
  174. $("#AfterCollegeID").combogridX("setValue", data.CollegeID);
  175. $("#AfterGradeID").combogridX("setValue", data.GradeID);
  176. $("#AfterStandardID").combogridX("setValue", data.StandardID);
  177. $("#AfterStandardCode").val(data.StandardCode);
  178. $("#AfterEducationID").combogridX("setValue", data.EducationID);
  179. $("#AfterLearningformID").combogridX("setValue", data.LearningformID);
  180. $("#AfterLearnSystem").val(data.LearnSystem);
  181. $("#AfterClassmajorID").combogridX("setValue", data.ClassmajorID);
  182. }
  183. }
  184. //联动查询
  185. function queryAfterClass() {
  186. var jsonString = "";
  187. var parameterString = "";
  188. var afterCollegeID = $("#AfterCollegeID").combogridX("getValue");
  189. var afterGradeID = $("#AfterGradeID").combogridX("getValue");
  190. var afterStandardID = $("#AfterStandardID").combogridX("getValue");
  191. var afterEducationID = $("#AfterEducationID").combogridX("getValue");
  192. var afterLearningformID = $("#AfterLearningformID").combogridX("getValue");
  193. if (afterCollegeID != nonSelect) parameterString += "CollegeDropdown|*|" + afterCollegeID + "|@|";
  194. if (afterGradeID != nonSelect) parameterString += "DictionaryGrade|*|" + afterGradeID + "|@|";
  195. if (afterStandardID != nonSelect) parameterString += "DictionaryStandard|*|" + afterStandardID + "|@|";
  196. if (afterEducationID != nonSelect) parameterString += "DictionaryEducation|*|" + afterEducationID + "|@|";
  197. if (afterLearningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + afterLearningformID + "|@|";
  198. if (parameterString != "") {
  199. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  200. $("#AfterClassmajorID").combogridX("reload", eval(jsonString));
  201. }
  202. else {
  203. $("#AfterClassmajorID").combogridX("reload");
  204. }
  205. }
  206. //设置列颜色为红色
  207. function SetRedColumn(index, row, value) {
  208. return " <span style=\"color: red;\">" + value + "</span>";
  209. }
  210. //保存
  211. function ChangeApply_Save() {
  212. $(document.forms[0]).submit();
  213. }