portal html css js resource

cmp-workspaces.js 6.3KB

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