portal html css js resource

cmp-workspaces.js 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. $(document).ready(function() {
  2. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  3. var id = $.cookie('orgId');
  4. if(id == "" || id == null || id == "null"){
  5. location.href = "cmp-settled-log.html";
  6. }
  7. /*企业信息*/
  8. function companyInformation() {
  9. $.ajax({
  10. url: "/ajax/org/" + id,
  11. type: "GET",
  12. timeout: 10000,
  13. dataType: "json",
  14. beforeSend: function() {},
  15. success: function(data, textState) {
  16. if(data.success) {
  17. var $data = data.data;
  18. var otext, oguimo;
  19. console.log(data);
  20. if($data.authStatus != 3) {
  21. /*$("#photoClass").addClass("authicon-com-no")
  22. $("#photoClass").attr("title", "未认证企业");*/
  23. $("#authBad").show();
  24. } else {
  25. $("#photoClass").addClass("authicon-com-ok");
  26. $("#authOk").show();
  27. $("#photoClass").attr("title", "认证企业");
  28. }
  29. $(".h1Font").find("span").text($data.name);
  30. if($data.hasOrgLogo) {
  31. $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg");
  32. } else {
  33. $("#oimg").attr("src", "../images/default-icon.jpg");
  34. }
  35. if($data.orgUrl) {
  36. $("#inteAddress").val($data.orgUrl);
  37. }
  38. if($data.city) {
  39. $("#ocity").text($data.city);
  40. }
  41. if($data.orgType) {
  42. switch($data.orgType) {
  43. case '2':
  44. otext = "上市企业";
  45. break;
  46. case '3':
  47. otext = "国有企业";
  48. break;
  49. case '4':
  50. otext = "合资企业";
  51. break;
  52. case '5':
  53. otext = "私人企业";
  54. break;
  55. case '6':
  56. otext = "外资企业";
  57. break;
  58. case '7':
  59. otext = "初创企业";
  60. break;
  61. default:
  62. otext = "";
  63. break;
  64. }
  65. if(otext != "")
  66. $("#cmpBasic").append("<span>" + otext + "</span>")
  67. }
  68. if($data.orgSize) {
  69. switch($data.orgSize) {
  70. case '1':
  71. oguimo = "50人以内";
  72. break;
  73. case '2':
  74. oguimo = "50-100人";
  75. break;
  76. case '3':
  77. oguimo = "100-200人";
  78. break;
  79. case '4':
  80. oguimo = "200-500人";
  81. break;
  82. case '5':
  83. oguimo = "500-1000人";
  84. break;
  85. case '6':
  86. oguimo = "1000人以上";
  87. break;
  88. default:
  89. oguimo = "";
  90. break;
  91. }
  92. if(oguimo!="")
  93. $("#cmpBasic").append("<span>" + oguimo + "</span>")
  94. }
  95. if($data.foundTime) {
  96. var oTime = timeGeshi($data.foundTime);
  97. $("#cmpBasic").append("<span>" + oTime + "</span>")
  98. }
  99. }
  100. },
  101. error: function(XMLHttpRequest, textStats, errorThrown) {
  102. $.MsgBox.Alert('提示', '服务器请求失败')
  103. }
  104. })
  105. }
  106. /*时间格式转换*/
  107. function timeGeshi(otm) {
  108. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  109. return otme;
  110. }
  111. companyInformation();
  112. /*获取所有的企业认证用户*/
  113. function companyUser() {
  114. $.ajax({
  115. url: "/ajax/professor/qaOrgAuth",
  116. type: "GET",
  117. timeout: 10000,
  118. dataType: "json",
  119. data: {
  120. "orgId": id,
  121. "orgAuth": 1
  122. },
  123. beforeSend: function() {},
  124. success: function(data, textState) {
  125. if(data.success) {
  126. console.log(data);
  127. var $info = data.data;
  128. userHtml($info);
  129. }
  130. },
  131. error: function(XMLHttpRequest, textStats, errorThrown) {
  132. $.MsgBox.Alert('提示', '服务器请求失败')
  133. }
  134. })
  135. }
  136. companyUser();
  137. function userHtml(arr) {
  138. for(var i = 0; i < arr.length; i++) {
  139. var tiof = "",
  140. 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. var oString = '<dd>'
  147. oString += '<div style="width: 60px;">'
  148. oString += '<img class="userRadius" src="' + img + '" width="100%" />'
  149. oString += '<div class="h4Font"><span>' + arr[i].name + '</span></div></div></dd>'
  150. $("#userList").append(oString);
  151. }
  152. }
  153. /*企业需求*/
  154. function companyDemand() {
  155. $.ajax({
  156. url: "/ajax/demand/pqOrg",
  157. type: "GET",
  158. timeout: 10000,
  159. dataType: "json",
  160. data: {
  161. "orgId": id,
  162. "demandStatus": 1,
  163. 'pageSize': 3
  164. },
  165. beforeSend: function() {},
  166. success: function(data, textState) {
  167. if(data.success) {
  168. console.log(data);
  169. var $info = data.data.data;
  170. companyDemandHtml($info);
  171. }
  172. },
  173. error: function(XMLHttpRequest, textStats, errorThrown) {
  174. $.MsgBox.Alert('提示', '服务器请求失败')
  175. }
  176. })
  177. }
  178. /*企业需求html*/
  179. function companyDemandHtml(arr) {
  180. for(var i = 0; i < arr.length; i++) {
  181. var tiof = "",
  182. img, oTime;
  183. if(arr[i].professor.hasHeadImage) {
  184. img = "/images/head/" + arr[i].professor.id + "_l.jpg";
  185. } else {
  186. img = "../images/default-photo.jpg"
  187. }
  188. if(arr[i].demandAim == 1) {
  189. tiof = "技术咨询";
  190. } else if(arr[i].demandAim == 2) {
  191. tiof = "寻找资源";
  192. } else if(arr[i].demandAim == 3) {
  193. tiof = "其他需求";
  194. }
  195. if(arr[i].createTime) {
  196. oTime = arr[i].createTime.substring(0, 4) + '年' + arr[i].createTime.substring(4, 6) + "月" + arr[i].createTime.substring(6, 8) + "日 " + arr[i].createTime.substring(8, 10) + ":" + arr[i].createTime.substring(10, 12)
  197. }
  198. var ostring = '<li>'
  199. ostring += '<div class="leftlogo floatL">'
  200. ostring += '<img class="userRadius" src="' + img + '" width="100%"/>'
  201. ostring += '<div class="h4Font"><span>' + arr[i].professor.name + '</span></div></div>'
  202. ostring += '<div class="rightinfo floatL">'
  203. ostring += '<p class="h3Font fontweight ellipsisSty">' + arr[i].demandTitle + '</p>'
  204. ostring += '<p class="h5Font"><span>' + tiof + '</span>-<span>' + oTime + '</span></p></div></li>'
  205. $(".needUlist").append(ostring);
  206. }
  207. }
  208. companyDemand();
  209. /*跳转企业浏览页面*/
  210. $("#conmliu").on("click",function(){
  211. window.open("../cmpInforShow.html?orgId="+id);
  212. })
  213. })