portal html css js resource

cmp-workspaces.js 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. $.cookie("colMgr",data.data.colMgr);
  18. var $data = data.data;
  19. var otext, oguimo;
  20. console.log(data);
  21. if($data.authStatus != 3) {
  22. /*$("#photoClass").addClass("authicon-com-no")
  23. $("#photoClass").attr("title", "未认证企业");*/
  24. $("#authBad").show();
  25. } else {
  26. $("#photoClass").addClass("authicon-com-ok");
  27. $("#authOk").show();
  28. $("#photoClass").attr("title", "认证企业");
  29. }
  30. $(".h1Font").find("span").text($data.name);
  31. if($data.hasOrgLogo) {
  32. $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg");
  33. } else {
  34. $("#oimg").attr("src", "../images/default-icon.jpg");
  35. }
  36. if($data.orgUrl) {
  37. $("#inteAddress").val($data.orgUrl);
  38. }
  39. if($data.city) {
  40. $("#ocity").text($data.city);
  41. }
  42. console.log($data.orgType)
  43. if($data.orgType) {
  44. switch($data.orgType) {
  45. case '2':
  46. otext = "上市企业";
  47. break;
  48. case '3':
  49. otext = "外资企业";
  50. break;
  51. case '4':
  52. otext = "合资企业";
  53. break;
  54. case '5':
  55. otext = "独资企业";
  56. break;
  57. case '6':
  58. otext = "个体经营";
  59. break;
  60. case '7':
  61. otext = "政府机构";
  62. break;
  63. case '8':
  64. otext = "公益组织";
  65. break;
  66. case '9':
  67. otext = "协会学会";
  68. break;
  69. case '10':
  70. otext = "新闻媒体";
  71. break;
  72. case '11':
  73. otext = "教育机构";
  74. break;
  75. default:
  76. otext = "";
  77. break;
  78. }
  79. if(otext != "")
  80. $("#cmpBasic").append("<span>" + otext + "</span>")
  81. }
  82. if($data.orgSize) {
  83. switch($data.orgSize) {
  84. case '1':
  85. oguimo = "50人以内";
  86. break;
  87. case '2':
  88. oguimo = "50-100人";
  89. break;
  90. case '3':
  91. oguimo = "100-200人";
  92. break;
  93. case '4':
  94. oguimo = "200-500人";
  95. break;
  96. case '5':
  97. oguimo = "500-1000人";
  98. break;
  99. case '6':
  100. oguimo = "1000人以上";
  101. break;
  102. default:
  103. oguimo = "";
  104. break;
  105. }
  106. if(oguimo!="")
  107. $("#cmpBasic").append("<span>" + oguimo + "</span>")
  108. }
  109. if($data.foundTime) {
  110. var oTime = timeGeshi($data.foundTime);
  111. $("#cmpBasic").append("<span>" + oTime + "</span>")
  112. }
  113. }
  114. },
  115. error: function(XMLHttpRequest, textStats, errorThrown) {
  116. $.MsgBox.Alert('提示', '服务器请求失败')
  117. }
  118. })
  119. }
  120. /*时间格式转换*/
  121. function timeGeshi(otm) {
  122. var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
  123. return otme;
  124. }
  125. companyInformation();
  126. /*获取所有的企业认证用户*/
  127. function companyUser() {
  128. $.ajax({
  129. url: "/ajax/professor/qaOrgAuth",
  130. type: "GET",
  131. timeout: 10000,
  132. dataType: "json",
  133. data: {
  134. "orgId": id,
  135. "orgAuth": 1
  136. },
  137. beforeSend: function() {},
  138. success: function(data, textState) {
  139. if(data.success) {
  140. console.log(data);
  141. var $info = data.data;
  142. userHtml($info);
  143. }
  144. },
  145. error: function(XMLHttpRequest, textStats, errorThrown) {
  146. $.MsgBox.Alert('提示', '服务器请求失败')
  147. }
  148. })
  149. }
  150. companyUser();
  151. function userHtml(arr) {
  152. for(var i = 0; i < arr.length; i++) {
  153. var tiof = "",
  154. img;
  155. if(arr[i].hasHeadImage) {
  156. img = "/images/head/" + arr[i].id + "_l.jpg";
  157. } else {
  158. img = "../images/default-photo.jpg"
  159. }
  160. var oString = '<dd>'
  161. oString += '<div style="width: 60px;">'
  162. oString += '<img class="userRadius" src="' + img + '" width="100%" />'
  163. oString += '<div class="h4Font ellipsisSty"><span>' + arr[i].name + '</span></div></div></dd>'
  164. $("#userList").append(oString);
  165. }
  166. }
  167. /*企业需求*/
  168. function companyDemand() {
  169. $.ajax({
  170. url: "/ajax/demand/pq",
  171. type: "GET",
  172. timeout: 10000,
  173. dataType: "json",
  174. data: {
  175. "oid": id,
  176. "state": 1,
  177. 'pageSize': 3
  178. },
  179. beforeSend: function() {},
  180. success: function(data, textState) {
  181. if(data.success) {
  182. console.log(data);
  183. var $info = data.data.data;
  184. companyDemandHtml($info);
  185. }
  186. },
  187. error: function(XMLHttpRequest, textStats, errorThrown) {
  188. $.MsgBox.Alert('提示', '服务器请求失败')
  189. }
  190. })
  191. }
  192. /*企业需求html*/
  193. function companyDemandHtml(arr) {
  194. for(var i = 0; i < arr.length; i++) {
  195. var oTime;
  196. if(arr[i].createTime) {
  197. oTime = commenTime(arr[i].createTime)
  198. }
  199. var ostring = '<li>'
  200. ostring += '<div class="leftlogo floatL">'
  201. ostring += '<img class="userRadius creatorimg" src="" width="100%"/>'
  202. ostring += '<div class="h4Font"><span class="creator"></span></div></div>'
  203. ostring += '<div class="rightinfo floatL">'
  204. ostring += '<p class="h3Font fontweight ellipsisSty">' + arr[i].title + '</p>'
  205. ostring += '<p class="h5Font"><span>' + oTime + '</span></p></div></li>'
  206. var $ostring=$(ostring);
  207. $(".needUlist").append($ostring);
  208. userFun(arr[i].creator,$ostring);
  209. }
  210. }
  211. function userFun(id,$listItem) {
  212. $.ajax({
  213. "url": "/ajax/professor/editBaseInfo/" + id,
  214. "type": "get",
  215. "async": true,
  216. "data":{
  217. "id":id
  218. },
  219. "success": function(data) {
  220. if(data.success && data.data) {
  221. $listItem.find(".creator").text(data.data.name);
  222. var img=""
  223. if(data.data.hasHeadImage) {
  224. img = "/images/head/" + data.data.id + "_l.jpg";
  225. } else {
  226. img = "../images/default-photo.jpg"
  227. }
  228. $listItem.find(".creatorimg").attr("src",img);
  229. }
  230. },
  231. "error": function() {
  232. $.MsgBox.Alert('提示', '链接服务器超时')
  233. }
  234. });
  235. }
  236. companyDemand();
  237. /*跳转企业浏览页面*/
  238. $("#conmliu").on("click",function(){
  239. window.open("../cmpInforShow.html?orgId="+id);
  240. })
  241. })