StudentEdit.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. var score = $("#Score").val();
  18. if (score == "" || score == null) {
  19. $("#Score").val("");
  20. }
  21. else {
  22. if (!reg.test(score)) {
  23. $("#Score").val("");
  24. }
  25. else {
  26. $("#Score").val(parseFloat(score).toFixed(1));
  27. }
  28. }
  29. $("#specialtyExpander").closest("tr")
  30. .next().css("display", "")
  31. .next().css("display", "")
  32. .next().css("display", "")
  33. .next().css("display", "");
  34. $("#specialtyExpander").attr("expanded", "1");
  35. $("#profileExpander").closest("tr")
  36. .next().css("display", "none")
  37. .next().css("display", "none")
  38. .next().css("display", "none")
  39. .next().css("display", "none")
  40. .next().css("display", "none")
  41. .next().css("display", "none")
  42. .next().css("display", "")
  43. .next().css("display", "")
  44. .next().css("display", "")
  45. .next().css("display", "none");
  46. $("#profileExpander").attr("expanded", "1");
  47. $("#contactExpander").closest("tr")
  48. .next().css("display", "")
  49. .next().css("display", "none")
  50. .next().css("display", "none")
  51. .next().css("display", "none")
  52. .next().css("display", "none")
  53. .next().css("display", "none")
  54. .next().css("display", "none");
  55. $("#contactExpander").attr("expanded", "1");
  56. $("#accountExpander").closest("tr")
  57. .next().css("display", "");
  58. $("#accountExpander").attr("expanded", "1");
  59. $("#recruitExpander").closest("tr")
  60. .next().css("display", "")
  61. .next().css("display", "none")
  62. .next().css("display", "none")
  63. .next().css("display", "none")
  64. .next().css("display", "none");
  65. $("#recruitExpander").attr("expanded", "1");
  66. $("#otherExpander").closest("tr")
  67. .next().css("display", "")
  68. .next().css("display", "");
  69. $("#otherExpander").attr("expanded", "1");
  70. });
  71. //点击收缩(专业班级信息)
  72. function swapSpecialty() {
  73. if ($("#specialtyExpander").attr("expanded") == "1") {
  74. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  75. $("#specialtyExpander").closest("tr")
  76. .next().css("display", "none")
  77. .next().css("display", "none")
  78. .next().css("display", "none")
  79. .next().css("display", "");
  80. $("#specialtyExpander").attr("expanded", "0");
  81. } else {
  82. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  83. $("#specialtyExpander").closest("tr")
  84. .next().css("display", "")
  85. .next().css("display", "")
  86. .next().css("display", "")
  87. .next().css("display", "");
  88. $("#specialtyExpander").attr("expanded", "1");
  89. }
  90. }
  91. //点击收缩(学生扩展信息)
  92. function swapProfile() {
  93. if ($("#profileExpander").attr("expanded") == "1") {
  94. $("#profileExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  95. $("#profileExpander").closest("tr")
  96. .next().css("display", "")
  97. .next().css("display", "")
  98. .next().css("display", "")
  99. .next().css("display", "")
  100. .next().css("display", "")
  101. .next().css("display", "")
  102. .next().css("display", "")
  103. .next().css("display", "")
  104. .next().css("display", "")
  105. .next().css("display", "");
  106. $("#profileExpander").attr("expanded", "0");
  107. } else {
  108. $("#profileExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  109. $("#profileExpander").closest("tr")
  110. .next().css("display", "none")
  111. .next().css("display", "none")
  112. .next().css("display", "none")
  113. .next().css("display", "none")
  114. .next().css("display", "none")
  115. .next().css("display", "none")
  116. .next().css("display", "")
  117. .next().css("display", "")
  118. .next().css("display", "")
  119. .next().css("display", "none");
  120. $("#profileExpander").attr("expanded", "1");
  121. }
  122. }
  123. //点击收缩(学生联系信息)
  124. function swapContact() {
  125. if ($("#contactExpander").attr("expanded") == "1") {
  126. $("#contactExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  127. $("#contactExpander").closest("tr")
  128. .next().css("display", "")
  129. .next().css("display", "")
  130. .next().css("display", "")
  131. .next().css("display", "")
  132. .next().css("display", "")
  133. .next().css("display", "")
  134. .next().css("display", "");
  135. $("#contactExpander").attr("expanded", "0");
  136. } else {
  137. $("#contactExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  138. $("#contactExpander").closest("tr")
  139. .next().css("display", "")
  140. .next().css("display", "none")
  141. .next().css("display", "none")
  142. .next().css("display", "none")
  143. .next().css("display", "none")
  144. .next().css("display", "none")
  145. .next().css("display", "none");
  146. $("#contactExpander").attr("expanded", "1");
  147. }
  148. }
  149. //点击收缩(学生缴费信息)
  150. function swapAccount() {
  151. if ($("#accountExpander").attr("expanded") == "1") {
  152. $("#accountExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  153. $("#accountExpander").closest("tr")
  154. .next().css("display", "");
  155. $("#accountExpander").attr("expanded", "0");
  156. } else {
  157. $("#accountExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  158. $("#accountExpander").closest("tr")
  159. .next().css("display", "");
  160. $("#accountExpander").attr("expanded", "1");
  161. }
  162. }
  163. //点击收缩(高考招生信息)
  164. function swapRecruit() {
  165. if ($("#recruitExpander").attr("expanded") == "1") {
  166. $("#recruitExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  167. $("#recruitExpander").closest("tr")
  168. .next().css("display", "")
  169. .next().css("display", "")
  170. .next().css("display", "")
  171. .next().css("display", "")
  172. .next().css("display", "");
  173. $("#recruitExpander").attr("expanded", "0");
  174. } else {
  175. $("#recruitExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  176. $("#recruitExpander").closest("tr")
  177. .next().css("display", "")
  178. .next().css("display", "none")
  179. .next().css("display", "none")
  180. .next().css("display", "none")
  181. .next().css("display", "none");
  182. $("#recruitExpander").attr("expanded", "1");
  183. }
  184. }
  185. //点击收缩(其它信息)
  186. function swapOther() {
  187. if ($("#otherExpander").attr("expanded") == "1") {
  188. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  189. $("#otherExpander").closest("tr")
  190. .next().css("display", "none")
  191. .next().css("display", "");
  192. $("#otherExpander").attr("expanded", "0");
  193. } else {
  194. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  195. $("#otherExpander").closest("tr")
  196. .next().css("display", "")
  197. .next().css("display", "");
  198. $("#otherExpander").attr("expanded", "1");
  199. }
  200. }
  201. //保存
  202. function Student_Save() {
  203. var certificatesType = $("#CertificatesType").combogridX("getValue");
  204. var iDNumber = $.trim($("#IDNumber").val());
  205. if (iDNumber != "") {
  206. if (certificatesType == "" || certificatesType == "-1" || certificatesType == null) {
  207. $.messager.alert("系统提示", "请选择对应的证件类型。");
  208. return;
  209. }
  210. }
  211. $(document.forms[0]).submit();
  212. }
  213. //删除照片(单个删除)
  214. function delPhoto() {
  215. var userID = $("#UserID").val();
  216. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/DeletePhoto', { userID: userID }, function (data) {
  217. if (data.IsSuccess) {
  218. $.messager.alert("系统提示", data.Message);
  219. $("#imgPhoto").attr('src', '');
  220. } else {
  221. $.messager.alert("系统提示", data.Message);
  222. }
  223. });
  224. }
  225. //联动
  226. function queryClassmajor(data) {
  227. var classmajorID = $("#ClassmajorID").combogridX("getValue");
  228. if (classmajorID == "" || classmajorID == "-1" || classmajorID == null) {
  229. $("#GradeID").combogridX("setValue", "-1");
  230. $("#StandardID").combogridX("setValue", "-1");
  231. $("#StandardCode").val("");
  232. $("#EducationID").combogridX("setValue", "-1");
  233. $("#LearningformID").combogridX("setValue", "-1");
  234. $("#LearnSystem").val("");
  235. $("#CollegeID").combogridX("setValue", "-1");
  236. $("#PlanningGraduateDate").val("");
  237. $("#GraduateDate").val("");
  238. }
  239. else {
  240. $("#GradeID").combogridX("setValue", data.GradeID);
  241. $("#StandardID").combogridX("setValue", data.StandardID);
  242. $("#StandardCode").val(data.StandardCode);
  243. $("#EducationID").combogridX("setValue", data.EducationID);
  244. $("#LearningformID").combogridX("setValue", data.LearningformID);
  245. $("#LearnSystem").val(data.LearnSystem);
  246. $("#CollegeID").combogridX("setValue", data.CollegeID);
  247. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/GetPlanningGraduateDate', { grademajorID: data.GrademajorID }, function (data) {
  248. if (data != null) {
  249. $("#PlanningGraduateDate").val(data);
  250. }
  251. else {
  252. $("#PlanningGraduateDate").val("");
  253. }
  254. });
  255. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/GetGraduateDate', { grademajorID: data.GrademajorID }, function (data) {
  256. if (data != null) {
  257. $("#GraduateDate").val(data);
  258. }
  259. else {
  260. $("#GraduateDate").val("");
  261. }
  262. });
  263. }
  264. }