NewStudentEnterEdit.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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", "none")
  32. .next().css("display", "none")
  33. .next().css("display", "")
  34. .next().css("display", "");
  35. $("#specialtyExpander").attr("expanded", "1");
  36. $("#otherExpander").closest("tr")
  37. .next().css("display", "none")
  38. .next().css("display", "")
  39. .next().css("display", "none")
  40. .next().css("display", "none")
  41. .next().css("display", "")
  42. .next().css("display", "");
  43. $("#otherExpander").attr("expanded", "1");
  44. });
  45. //点击收缩(专业信息)
  46. function swapSpecialty() {
  47. if ($("#specialtyExpander").attr("expanded") == "1") {
  48. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  49. $("#specialtyExpander").closest("tr")
  50. .next().css("display", "")
  51. .next().css("display", "")
  52. .next().css("display", "")
  53. .next().css("display", "")
  54. .next().css("display", "");
  55. $("#specialtyExpander").attr("expanded", "0");
  56. } else {
  57. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  58. $("#specialtyExpander").closest("tr")
  59. .next().css("display", "")
  60. .next().css("display", "none")
  61. .next().css("display", "none")
  62. .next().css("display", "")
  63. .next().css("display", "");
  64. $("#specialtyExpander").attr("expanded", "1");
  65. }
  66. }
  67. //点击收缩(其它信息)
  68. function swapOther() {
  69. if ($("#otherExpander").attr("expanded") == "1") {
  70. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  71. $("#otherExpander").closest("tr")
  72. .next().css("display", "")
  73. .next().css("display", "")
  74. .next().css("display", "")
  75. .next().css("display", "")
  76. .next().css("display", "")
  77. .next().css("display", "");
  78. $("#otherExpander").attr("expanded", "0");
  79. } else {
  80. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  81. $("#otherExpander").closest("tr")
  82. .next().css("display", "none")
  83. .next().css("display", "")
  84. .next().css("display", "none")
  85. .next().css("display", "none")
  86. .next().css("display", "")
  87. .next().css("display", "");
  88. $("#otherExpander").attr("expanded", "1");
  89. }
  90. }
  91. //保存
  92. function NewStudentEnter_Save() {
  93. var certificatesType = $("#CertificatesType").combogridX("getValue");
  94. var iDNumber = $.trim($("#IDNumber").val());
  95. if (iDNumber != "") {
  96. if (certificatesType == "" || certificatesType == "-1" || certificatesType == null) {
  97. $.messager.alert("系统提示", "请选择对应的证件类型。");
  98. return;
  99. }
  100. }
  101. var classmajorID = $("#ClassmajorID").combogridX("getValue");
  102. var studentNo = $.trim($("#StudentNo").val());
  103. if (studentNo != "") {
  104. if (classmajorID == "" || classmajorID == "-1" || classmajorID == null) {
  105. $.messager.alert("系统提示", "请选择对应的班级名称(学号不为空时,班级名称不能为空)。");
  106. return;
  107. }
  108. }
  109. $(document.forms[0]).submit();
  110. }
  111. //删除照片(单个删除)
  112. function delPhoto() {
  113. var newStudentID = $("#NewStudentID").val();
  114. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentEnter/DeletePhoto', { newStudentID: newStudentID }, function (data) {
  115. if (data.IsSuccess) {
  116. $.messager.alert("系统提示", data.Message);
  117. $("#imgPhoto").attr('src', '');
  118. } else {
  119. $.messager.alert("系统提示", data.Message);
  120. }
  121. });
  122. }
  123. //联动查询
  124. function querySpecialty(data) {
  125. var specialtyID = $("#SpecialtyID").combogridX("getValue");
  126. if (specialtyID == "" || specialtyID == "-1" || specialtyID == null) {
  127. $("#Code").val("");
  128. $("#EducationID").combogridX("setValue", "-1");
  129. $("#LearningformID").combogridX("setValue", "-1");
  130. $("#LearnSystem").val("");
  131. //$("#ClassmajorID").combogridX("setValue", "-1");
  132. }
  133. else {
  134. $("#Code").val(data.Code);
  135. $("#EducationID").combogridX("setValue", data.EducationID);
  136. $("#LearningformID").combogridX("setValue", data.LearningformID);
  137. $("#LearnSystem").val(data.LearnSystem);
  138. }
  139. }