portal html css js resource

cmp-workspaces.js 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. console.log($data.orgType)
  42. if($data.orgType) {
  43. switch($data.orgType) {
  44. case '2':
  45. otext = "上市企业";
  46. break;
  47. case '3':
  48. otext = "外资企业";
  49. break;
  50. case '4':
  51. otext = "合资企业";
  52. break;
  53. case '5':
  54. otext = "独资企业";
  55. break;
  56. case '6':
  57. otext = "个体经营";
  58. break;
  59. case '7':
  60. otext = "政府机构";
  61. break;
  62. case '8':
  63. otext = "公益组织";
  64. break;
  65. case '9':
  66. otext = "协会学会";
  67. break;
  68. case '10':
  69. otext = "新闻媒体";
  70. break;
  71. case '11':
  72. otext = "教育机构";
  73. break;
  74. default:
  75. otext = "";
  76. break;
  77. }
  78. if(otext != "")
  79. $("#cmpBasic").append("<span>" + otext + "</span>")
  80. }
  81. if($data.orgSize) {
  82. switch($data.orgSize) {
  83. case '1':
  84. oguimo = "50人以内";
  85. break;
  86. case '2':
  87. oguimo = "50-100人";
  88. break;
  89. case '3':
  90. oguimo = "100-200人";
  91. break;
  92. case '4':
  93. oguimo = "200-500人";
  94. break;
  95. case '5':
  96. oguimo = "500-1000人";
  97. break;
  98. case '6':
  99. oguimo = "1000人以上";
  100. break;
  101. default:
  102. oguimo = "";
  103. break;
  104. }
  105. if(oguimo!="")
  106. $("#cmpBasic").append("<span>" + oguimo + "</span>")
  107. }
  108. if($data.foundTime) {
  109. var oTime = timeGeshi($data.foundTime);
  110. $("#cmpBasic").append("<span>" + oTime + "</span>")
  111. }
  112. }
  113. },
  114. error: function(XMLHttpRequest, textStats, errorThrown) {
  115. $.MsgBox.Alert('提示', '服务器请求失败')
  116. }
  117. })
  118. }
  119. /*时间格式转换*/
  120. function timeGeshi(otm) {
  121. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  122. return otme;
  123. }
  124. companyInformation();
  125. /*获取所有的企业认证用户*/
  126. function companyUser() {
  127. $.ajax({
  128. url: "/ajax/professor/qaOrgAuth",
  129. type: "GET",
  130. timeout: 10000,
  131. dataType: "json",
  132. data: {
  133. "orgId": id,
  134. "orgAuth": 1
  135. },
  136. beforeSend: function() {},
  137. success: function(data, textState) {
  138. if(data.success) {
  139. console.log(data);
  140. var $info = data.data;
  141. userHtml($info);
  142. }
  143. },
  144. error: function(XMLHttpRequest, textStats, errorThrown) {
  145. $.MsgBox.Alert('提示', '服务器请求失败')
  146. }
  147. })
  148. }
  149. companyUser();
  150. function userHtml(arr) {
  151. for(var i = 0; i < arr.length; i++) {
  152. var tiof = "",
  153. img;
  154. if(arr[i].hasHeadImage) {
  155. img = "/images/head/" + arr[i].id + "_l.jpg";
  156. } else {
  157. img = "../images/default-photo.jpg"
  158. }
  159. var oString = '<dd>'
  160. oString += '<div style="width: 60px;">'
  161. oString += '<img class="userRadius" src="' + img + '" width="100%" />'
  162. oString += '<div class="h4Font"><span>' + arr[i].name + '</span></div></div></dd>'
  163. $("#userList").append(oString);
  164. }
  165. }
  166. /*企业需求*/
  167. function companyDemand() {
  168. $.ajax({
  169. url: "/ajax/demand/pqOrg",
  170. type: "GET",
  171. timeout: 10000,
  172. dataType: "json",
  173. data: {
  174. "orgId": id,
  175. "demandStatus": 1,
  176. 'pageSize': 3
  177. },
  178. beforeSend: function() {},
  179. success: function(data, textState) {
  180. if(data.success) {
  181. console.log(data);
  182. var $info = data.data.data;
  183. companyDemandHtml($info);
  184. }
  185. },
  186. error: function(XMLHttpRequest, textStats, errorThrown) {
  187. $.MsgBox.Alert('提示', '服务器请求失败')
  188. }
  189. })
  190. }
  191. /*企业需求html*/
  192. function companyDemandHtml(arr) {
  193. for(var i = 0; i < arr.length; i++) {
  194. var tiof = "",
  195. img, oTime;
  196. if(arr[i].professor.hasHeadImage) {
  197. img = "/images/head/" + arr[i].professor.id + "_l.jpg";
  198. } else {
  199. img = "../images/default-photo.jpg"
  200. }
  201. if(arr[i].demandAim == 1) {
  202. tiof = "技术咨询";
  203. } else if(arr[i].demandAim == 2) {
  204. tiof = "寻找资源";
  205. } else if(arr[i].demandAim == 3) {
  206. tiof = "其他需求";
  207. }
  208. if(arr[i].createTime) {
  209. 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)
  210. }
  211. var ostring = '<li>'
  212. ostring += '<div class="leftlogo floatL">'
  213. ostring += '<img class="userRadius" src="' + img + '" width="100%"/>'
  214. ostring += '<div class="h4Font"><span>' + arr[i].professor.name + '</span></div></div>'
  215. ostring += '<div class="rightinfo floatL">'
  216. ostring += '<p class="h3Font fontweight ellipsisSty">' + arr[i].demandTitle + '</p>'
  217. ostring += '<p class="h5Font"><span>' + tiof + '</span>-<span>' + oTime + '</span></p></div></li>'
  218. $(".needUlist").append(ostring);
  219. }
  220. }
  221. companyDemand();
  222. /*跳转企业浏览页面*/
  223. $("#conmliu").on("click",function(){
  224. window.open("../cmpInforShow.html?orgId="+id);
  225. })
  226. })