portal html css js resource

companybrowinfor.js 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. $(document).ready(function() {
  2. //var id = "05FBD2E6F568461CA7EC378E66C47ABE";
  3. var id="BB8EE2EC6881419DACC5AF4FE650055A";
  4. /*企业信息*/
  5. function companyInformation() {
  6. $.ajax({
  7. url: "/ajax/org/" + id,
  8. type: "GET",
  9. timeout: 10000,
  10. dataType: "json",
  11. beforeSend: function() {},
  12. success: function(data, textState) {
  13. if(data.success) {
  14. var $data = data.data;
  15. $(".h1Font").text($data.name);
  16. if($data.hasOrgLogo) {
  17. $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg");
  18. }
  19. if($data.orgUrl) {
  20. $("#inteAddress").text($data.orgUrl);
  21. } else {
  22. $("#inteAddress").text("");
  23. }
  24. if($data.foundTime) {
  25. var oTime = timeGeshi($data.foundTime);
  26. $("#createTime").text(oTime);
  27. } else {
  28. $("#createTime").val("");
  29. }
  30. if($data.city) {
  31. $("#ocity").text($data.city);
  32. }
  33. if($data.descp) {
  34. $(".editbox").text($data.descp);
  35. }
  36. if($data.orgSize) {
  37. switch($data.orgSize) {
  38. case '1':
  39. $("#qualificationList").text("50人以内")
  40. break;
  41. case '2':
  42. $("#qualificationList").text("50-100人")
  43. break;
  44. case '3':
  45. $("#qualificationList").text("100-200人")
  46. break;
  47. case '4':
  48. $("#qualificationList").text("200-500人")
  49. break;
  50. case '5':
  51. $("#qualificationList").text("500-1000人")
  52. break;
  53. default:
  54. $("#qualificationList").text("1000人以上")
  55. break;
  56. }
  57. }
  58. if($data.orgType) {
  59. switch($data.orgType) {
  60. case '2':
  61. $("#orgType").text("国有企业");
  62. break;
  63. case '3':
  64. $("#orgType").text("上市企业");
  65. break;
  66. case '4':
  67. $("#orgType").text("合资企业");
  68. break;
  69. case '5':
  70. $("#orgType").text("私人企业");
  71. break;
  72. case '6':
  73. $("#orgType").text("外资企业");
  74. break;
  75. default:
  76. $("#orgType").text("初创企业");
  77. break;
  78. }
  79. }
  80. if($data.industry) {
  81. indu($data.industry, '#industryShow')
  82. }
  83. if($data.subject) {
  84. indu($data.subject, '#subjectShow')
  85. }
  86. if($data.qualification) {
  87. indu($data.qualification, '#qiye ')
  88. }
  89. }
  90. },
  91. error: function(XMLHttpRequest, textStats, errorThrown) {
  92. $.MsgBox.Alert('提示', '服务器请求失败')
  93. }
  94. })
  95. }
  96. /*时间格式转换*/
  97. function timeGeshi(otm) {
  98. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  99. return otme;
  100. }
  101. /*应用行业及领域及企业纸质*/
  102. function indu(oString, oSelector) {
  103. var arr = oString.split(",");
  104. var oArr = new Array();
  105. var i;
  106. for(i in arr) {
  107. if(oSelector == "#subjectShow") {
  108. oArr.push('<div class="acad">' + arr[i] + '</div>');
  109. } else {
  110. oArr.push('<li>' + arr[i] + '</li>');
  111. }
  112. }
  113. $(oSelector).html(oArr.join(""));
  114. }
  115. /*获取所有的企业用户*/
  116. function companyUser() {
  117. $.ajax({
  118. url: "/ajax/professor/qaOrgAuth",
  119. type: "GET",
  120. timeout: 10000,
  121. dataType: "json",
  122. data: {
  123. "orgId": id,
  124. },
  125. beforeSend: function() {},
  126. success: function(data, textState) {
  127. if(data.success) {
  128. var $info=data.data;
  129. userHtml($info);
  130. }
  131. },
  132. error: function(XMLHttpRequest, textStats, errorThrown) {
  133. $.MsgBox.Alert('提示', '服务器请求失败')
  134. }
  135. })
  136. }
  137. /*填充企业下用户*/
  138. function userHtml(arr) {
  139. for(var i=0; i < arr.length; i++) {
  140. var tiof="",img;
  141. if(arr[i].hasHeadImage){
  142. img = "/images/head/" + arr[i].id + "_l.jpg";
  143. }else{
  144. img ="images/default-photo.jpg"
  145. }
  146. if(arr[i].title){
  147. if(arr[i].office){
  148. tiof=arr[i].title+" ,"+arr[i].office;
  149. }else{
  150. tiof=arr[i].title;
  151. }
  152. }else{
  153. if(arr[i].office){
  154. tiof=arr[i].office;
  155. }
  156. }
  157. var oString = '<dd>'
  158. oString += '<div class="staffChild">'
  159. oString += '<img class="headRadius" src="'+img+'" width="100%" />'
  160. oString += '</div><div class="h4Font"><span>'+arr[i].name+'</span></div>'
  161. oString += '<div class="h4Font">'+tiof+'</div></dd>'
  162. $("#userList").append(oString);
  163. }
  164. }
  165. companyInformation();
  166. companyUser();
  167. })