BuildingsEdit.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. //建筑层数
  6. var buildingsLevel = $("#BuildingsLevel").val();
  7. if (buildingsLevel == "" || buildingsLevel == null) {
  8. $("#BuildingsLevel").val("");
  9. }
  10. else {
  11. if (!reg.test(buildingsLevel)) {
  12. $("#BuildingsLevel").val("");
  13. }
  14. else {
  15. $("#BuildingsLevel").val(parseFloat(buildingsLevel).toFixed(1));
  16. }
  17. }
  18. //建筑面积
  19. var buildingsArea = $("#BuildingsArea").val();
  20. if (buildingsArea == "" || buildingsArea == null) {
  21. $("#BuildingsArea").val("");
  22. }
  23. else {
  24. if (!reg.test(buildingsArea)) {
  25. $("#BuildingsArea").val("");
  26. }
  27. else {
  28. $("#BuildingsArea").val(parseFloat(buildingsArea).toFixed(1));
  29. }
  30. }
  31. //使用面积
  32. var useArea = $("#UseArea").val();
  33. if (useArea == "" || useArea == null) {
  34. $("#UseArea").val("");
  35. }
  36. else {
  37. if (!reg.test(useArea)) {
  38. $("#UseArea").val("");
  39. }
  40. else {
  41. $("#UseArea").val(parseFloat(useArea).toFixed(1));
  42. }
  43. }
  44. });
  45. //保存
  46. function Buildings_Save() {
  47. $(document.forms[0]).submit();
  48. }
  49. //联动(暂不考虑)
  50. function QueryCampus() {
  51. var campusID = $("#CampusID").combogridX("getValue");
  52. if (campusID == "" || campusID == "-1" || campusID == null) {
  53. $("#CollegeID").combogridX("setValue", "-1");
  54. }
  55. else {
  56. $("#CollegeID").combogridX("setValue", "-1");
  57. }
  58. if (campusID != nonSelect) {
  59. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  60. $("#CollegeID").combogridX("reload", eval(jsonString));
  61. }
  62. }
  63. function QueryCollege() {
  64. var collegeID = $("#CollegeID").combogridX("getValue");
  65. //注:暂时不支持通过院系所联动校区信息,后续考虑
  66. }