NewStudentCollegeEdit.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. $("#otherExpander").closest("tr")
  36. .next().css("display", "none")
  37. .next().css("display", "")
  38. .next().css("display", "none")
  39. .next().css("display", "none")
  40. .next().css("display", "")
  41. .next().css("display", "");
  42. $("#otherExpander").attr("expanded", "1");
  43. });
  44. //点击收缩(专业信息)
  45. function swapSpecialty() {
  46. if ($("#specialtyExpander").attr("expanded") == "1") {
  47. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  48. $("#specialtyExpander").closest("tr")
  49. .next().css("display", "")
  50. .next().css("display", "none")
  51. .next().css("display", "none")
  52. .next().css("display", "");
  53. $("#specialtyExpander").attr("expanded", "0");
  54. } else {
  55. $("#specialtyExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  56. $("#specialtyExpander").closest("tr")
  57. .next().css("display", "")
  58. .next().css("display", "")
  59. .next().css("display", "")
  60. .next().css("display", "");
  61. $("#specialtyExpander").attr("expanded", "1");
  62. }
  63. }
  64. //点击收缩(其它信息)
  65. function swapOther() {
  66. if ($("#otherExpander").attr("expanded") == "1") {
  67. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  68. $("#otherExpander").closest("tr")
  69. .next().css("display", "")
  70. .next().css("display", "")
  71. .next().css("display", "")
  72. .next().css("display", "")
  73. .next().css("display", "")
  74. .next().css("display", "");
  75. $("#otherExpander").attr("expanded", "0");
  76. } else {
  77. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  78. $("#otherExpander").closest("tr")
  79. .next().css("display", "none")
  80. .next().css("display", "")
  81. .next().css("display", "none")
  82. .next().css("display", "none")
  83. .next().css("display", "")
  84. .next().css("display", "");
  85. $("#otherExpander").attr("expanded", "1");
  86. }
  87. }
  88. //联动
  89. function querySpecialty(data) {
  90. var specialtyID = $("#SpecialtyID").combogridX("getValue");
  91. if (specialtyID == "" || specialtyID == "-1" || specialtyID == null) {
  92. $("#Code").val("");
  93. $("#EducationID").combogridX("setValue", "-1");
  94. $("#LearningformID").combogridX("setValue", "-1");
  95. $("#LearnSystem").val("");
  96. }
  97. else {
  98. $("#Code").val(data.Code);
  99. $("#EducationID").combogridX("setValue", data.EducationID);
  100. $("#LearningformID").combogridX("setValue", data.LearningformID);
  101. $("#LearnSystem").val(data.LearnSystem);
  102. }
  103. }