entportrait.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. var entType = "企业";
  2. var relationEntity = null;//关系网
  3. var copyrightEntity = null;//著作权
  4. var servicePaging = null;//服务列表
  5. var staffinfoEntity = null;//主要人员
  6. var dishonestyPaging = null;//失信
  7. var hasLoadPagingJs = false;//是否已经加载过js
  8. var identWayFlag = false;//认证状态
  9. var relationFlag = false;
  10. var staffinfoFlag = false;
  11. /**************著作权**************/
  12. var copyrightFlag = false;
  13. //作品
  14. var workCopyRight = null;
  15. var workCopyRightFlag = false;
  16. //软件
  17. var computerSoftCopyRight = null;
  18. var computerSoftCopyRightFlag = false;
  19. //专利
  20. var patent = null;
  21. var patentFlag = false;
  22. //解析服务列表
  23. $(function(){
  24. staffinfoFlag = typeof(staffinfo) != "undefined" && staffinfo != null && staffinfo.length > 0;
  25. copyrightFlag = typeof(copyright) != "undefined" && copyright != null;
  26. if(copyrightFlag){
  27. //作品
  28. workCopyRight = copyright.WorkCopyRight;
  29. workCopyRightFlag = typeof(workCopyRight) != "undefined" && workCopyRight != null;
  30. //软件
  31. computerSoftCopyRight = copyright.ComputerSoftCopyRight;
  32. computerSoftCopyRightFlag = typeof(computerSoftCopyRight) != "undefined" && computerSoftCopyRight != null;
  33. //专利
  34. patent = copyright.Patent;
  35. patentFlag = typeof(patent) != "undefined" && patent != null;
  36. }
  37. if($(".b-right").height() >= 500){
  38. $(".ent-tab-content.b-left").css("min-height",$(".b-right").height());
  39. }
  40. //显示著作权数量
  41. if(copyrightFlag){
  42. var copyrightCount = 0;
  43. if(workCopyRightFlag){
  44. copyrightCount += workCopyRight.length;
  45. }
  46. if(computerSoftCopyRightFlag){
  47. copyrightCount += computerSoftCopyRight.length;
  48. }
  49. if(patentFlag){
  50. copyrightCount += patent.length;
  51. }
  52. $("#ent-tab-copyright").text(copyrightCount);
  53. }else{
  54. $("#ent-tab-copyright").addClass("disabled");
  55. }
  56. //显示失信数量
  57. if(dishonesty.count > 0){
  58. $("#ent-tab-dishonesty").text(dishonesty.count);
  59. }else{
  60. $("#ent-tab-dishonesty").addClass("disabled");
  61. }
  62. //显示变更数量
  63. if(staffinfoFlag){
  64. $("#ent-tab-staffinfo").text(staffinfo.length);
  65. }else{
  66. $("#ent-tab-staffinfo").addClass("disabled");
  67. }
  68. //联系地址
  69. if($address){
  70. loadJS(cdn+"/js/jquery.cxselect.js",function(){
  71. $('#city_china').cxSelect({
  72. selects: ['province', 'city', 'area'],
  73. required:0
  74. });
  75. $.cxSelect.setVal(province,city,area);
  76. var pt=province?($("#provincesel option[value="+province+"]").text()):"";
  77. var ct=city?($("#citysel option[value="+city+"]").text()):"";
  78. var at=area?($("#areasel option[value="+area+"]").text()):"";
  79. //设置地图上显示的位置
  80. $("#location").attr("value",as1);
  81. $("#cityname").attr("value",pt.trim()+ct.trim()+at.trim());
  82. initMap();
  83. $("#city_china").text(pt+ct+at+as1);
  84. });
  85. }
  86. //隐藏地图
  87. $("#fade").click(closeMap);
  88. //分享
  89. $(".entinfo-share").click(function(){
  90. $(".bdsharebuttonbox").show();
  91. });
  92. //切换
  93. $(".ent-tab>li").click(function(){
  94. if($(this).hasClass("disabled")){
  95. return;
  96. }
  97. var index = $(this).index();
  98. $(".ent-tab>li").removeClass("ent-active");
  99. $(this).addClass("ent-active");
  100. $(".ent-tab-content>div").addClass("hide");
  101. $(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
  102. if(index != 0){
  103. //企业概况如果没有数据,选项卡不可点
  104. if((!gs || typeof(gs) == "undefined" || gs == null || gs.length == 0) && (typeof(investor) == "undefined" || investor == null || investor.length == 0) && (typeof(OpScope) == "undefined" || OpScope == null || OpScope.length == 0)){
  105. $(".ent-tab>li:eq(0)").addClass("disabled");
  106. }
  107. }
  108. if(index != 1){
  109. //关系网如果没有数据,选项卡不可点
  110. if(relationFlag){
  111. $(".ent-tab>li:eq(1)").addClass("disabled");
  112. }
  113. }
  114. if(index == 1){
  115. b_afterLogin(isLogined);
  116. }else if($(this).index() == 2 && staffinfoEntity == null){
  117. //加载服务列表
  118. staffinfoEntity = new StaffinfoEntity();
  119. }else if($(this).index() == 3 && copyrightEntity == null){
  120. //加载服务列表
  121. copyrightEntity = new CopyrightEntity();
  122. }else if($(this).index() == 5 && dishonestyPaging == null){
  123. //加载失信列表
  124. dishonestyPaging = new DishonestyPaging();
  125. }else if($(this).index() == 6 && servicePaging == null){
  126. //加载服务列表
  127. servicePaging = new ServicePaging();
  128. }
  129. });
  130. pcShare();
  131. });
  132. function initMap(){
  133. //获取地图的经纬度
  134. loadJS("http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217",function(){
  135. loadJS(cdn+"/js/geocoder.js",function(){
  136. doOptions();
  137. });
  138. });
  139. }
  140. //显示地图
  141. function showMap(){
  142. document.getElementById('mapshowdiv').style.display = 'block';
  143. document.getElementById('closeshowmap').style.display = 'block';
  144. document.getElementById('fade').style.display = 'block';
  145. $("html,body").addClass("overflow-hidden");
  146. }
  147. //关闭地图
  148. function closeMap(){
  149. document.getElementById('mapshowdiv').style.display = 'none';
  150. document.getElementById('closeshowmap').style.display = 'none';
  151. document.getElementById('fade').style.display = 'none';
  152. $("html,body").removeClass("overflow-hidden");
  153. }
  154. function b_afterLogin(flag,result){
  155. //关系网如果没有数据,选项卡不可点
  156. if(typeof(result) != "undefined"){
  157. identWayFlag = result.identWay == 1;
  158. }
  159. //identWayFlag = true;//暂时把认证权限放开
  160. relationFlag = flag && identWayFlag && !relFlag;
  161. if(!$(".ent-tab>li:eq(1)").hasClass("ent-active") && relationFlag){
  162. $(".ent-tab>li:eq(1)").addClass("disabled");
  163. }
  164. if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relationEntity == null){
  165. initRelation();
  166. }
  167. }
  168. //加载关系网
  169. function initRelation(){
  170. if(isLogined){
  171. /*if($("#entrelation-limit").hasClass("hide")){
  172. $(".entrelation").height($(".ent-tab-content").height());
  173. }*/
  174. var relationNoData = function(){
  175. $("#entrelation-limit,#entrelation-nologin").addClass("hide");
  176. relationEntity = "";
  177. $("#entrelation-infovis").hide();
  178. $("#entrelation-findnull").removeClass("hide");
  179. }
  180. if(identWayFlag){
  181. if(relationFlag){
  182. relationNoData();
  183. }else{
  184. $("#entrelation-limit,#entrelation-nologin").addClass("hide");
  185. $.ajax({
  186. url: "/member/getRelation",
  187. method: "post",
  188. data: {regNo:regNo,entName:entName},
  189. success: function(r){
  190. if(!r || !r.flag || !r.relation || !r.relation.links || r.relation.links.length == 0 || !r.relation.nodes || r.relation.nodes.length <= 1){
  191. relationNoData();
  192. }else{
  193. $(".entrelation").height($(".ent-tab-content").height());
  194. loadJS(cdn+"/js/d3.v3.min.js",function(){
  195. loadJS(cdn+"/js/geometry.js",function(){
  196. loadJS(cdn+"/js/provinceData.min.js",function(){
  197. loadJS(cdn+"/js/relation.js",function(){
  198. relationEntity = new Relation(legcerNo,regNo,regCapCurName,r.relation,r.relation.nodes.length>15);
  199. relationEntity.init();
  200. });
  201. });
  202. });
  203. });
  204. }
  205. },
  206. error: function(){
  207. relationNoData();
  208. }
  209. });
  210. }
  211. }else{
  212. $("#entrelation-nologin").addClass("hide");
  213. $("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
  214. $("#entrelation-infovis").hide();
  215. }
  216. }else{
  217. $("#entrelation-limit,#entrelation-nologin").removeClass("hide");
  218. }
  219. }
  220. function StaffinfoEntity(){
  221. //主要人员
  222. if(staffinfoFlag){
  223. var staffinfos1 = [],staffinfos2 = [],staffinfos3 = [],staffinfos4 = [];
  224. for(var i=0;i<staffinfo.length;i++){
  225. switch(staffinfo[i].Position){
  226. case "410A":
  227. case "410B":
  228. case "410C":
  229. case "431A":
  230. case "431B":
  231. staffinfos1.push(staffinfo[i]);
  232. break;
  233. case "432A":
  234. case "432K":
  235. staffinfos2.push(staffinfo[i]);
  236. break;
  237. case "434Q":
  238. case "434R":
  239. case "436A":
  240. staffinfos3.push(staffinfo[i]);
  241. break;
  242. default:
  243. staffinfos4.push(staffinfo[i]);
  244. break;
  245. }
  246. }
  247. staffinfos1.sort(function(a,b){return a.Position-b.Position});
  248. staffinfos2.sort(function(a,b){return a.Position-b.Position});
  249. staffinfos3.sort(function(a,b){return a.Position-b.Position});
  250. staffinfos4.sort(function(a,b){return a.Position-b.Position});
  251. var hm = '<div class="ent-mainpersons">';
  252. //计算出一行可以放几个
  253. var maxCout = parseInt($(".ent-tab-content").width() / (207+20));
  254. var verticalFlag = false;
  255. var appendStaffinfo = function(obj,index){
  256. var tmp = 0;
  257. for(var i=0;i<obj.length;i++){
  258. var positionName = obj[i].PositionName;
  259. if(typeof(positionName) == "undefined" || positionName == null || positionName == ""){
  260. positionName = "监事";
  261. }
  262. tmp++;
  263. if(i==0){
  264. hm+='<div class="staffinfo-level-'+index+'">';
  265. if(verticalFlag){
  266. hm+='<a class="staffinfo-vertical"></a>';
  267. }
  268. }
  269. verticalFlag = true;
  270. hm+='<div><img src="'+cdn+'/images/entcommunity/mainperson'+index+'.png">'
  271. +'<span><font class="b-com-name">'+obj[i].Name+'</font><font class="ent-positionName">'+positionName+'</font></span></div>';
  272. //竖线
  273. if(tmp == maxCout && i != obj.length-1){
  274. hm+='<a class="staffinfo-vertical"></a>';
  275. }
  276. //横线
  277. if(i != obj.length-1){
  278. if(tmp <= maxCout-1){
  279. hm+='<a class="staffinfo-horizontal"></a>';
  280. }else{
  281. tmp = 0;
  282. }
  283. }
  284. if(i==obj.length-1){
  285. hm+='</div>';
  286. }
  287. }
  288. }
  289. appendStaffinfo(staffinfos1,1);
  290. appendStaffinfo(staffinfos2,2);
  291. appendStaffinfo(staffinfos3,3);
  292. appendStaffinfo(staffinfos4,4);
  293. hm+='</div>';
  294. $(".ent-mainperson").html(hm);
  295. }else{
  296. $(".ent-mainperson .ent-findnull").removeClass("hide");
  297. }
  298. }
  299. function CopyrightEntity(){
  300. //著作权
  301. if(copyrightFlag){
  302. loadJS(cdn+"/js/frontpaging.js",function(){
  303. if(workCopyRightFlag){
  304. $("#workCopyRightList .badge").text(workCopyRight.length);
  305. workCopyRight.sort(function(a,b){
  306. if(a.FirstPublishDate<b.FirstPublishDate){
  307. return 1;
  308. }else if(a.FirstPublishDate==b.FirstPublishDate){
  309. return 0;
  310. }
  311. return -1;
  312. });
  313. var frontPaging = new FrontPaging("workCopyRightListPaging",workCopyRight,5,function(r){
  314. var hm = '';
  315. for(var i=0;i<r.length;i++){
  316. hm += '<tr><td><div class="b-com-first">'+(r[i].WorkName?r[i].WorkName:"")+'</div>'
  317. +'<div class="b-com-second"><div>'
  318. +'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
  319. +'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
  320. +'</div><span>作品类别:'+(r[i].WorkType?r[i].WorkType:"")+'</span>'
  321. +'<span>创作完成日期:'+(r[i].FinishedDate?r[i].FinishedDate:"")+'</span>'
  322. +'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
  323. +'</div></td></tr>';
  324. }
  325. $("#workCopyRightListPaging").parent().prevAll().remove();
  326. $("#workCopyRightListPaging").parent().before(hm);
  327. });
  328. }
  329. if(computerSoftCopyRightFlag){
  330. $("#computerSoftCopyRightList .badge").text(computerSoftCopyRight.length);
  331. computerSoftCopyRight.sort(function(a,b){
  332. if(a.FirstPublishDate<b.FirstPublishDate){
  333. return 1;
  334. }else if(a.FirstPublishDate==b.FirstPublishDate){
  335. return 0;
  336. }
  337. return -1;
  338. });
  339. var frontPaging = new FrontPaging("computerSoftCopyRightListPaging",computerSoftCopyRight,5,function(r){
  340. var hm = '';
  341. for(var i=0;i<r.length;i++){
  342. hm += '<tr><td><div class="b-com-first">'+(r[i].SoftFullName?r[i].SoftFullName:"")+'</div>'
  343. +'<div class="b-com-second"><div>'
  344. +'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
  345. +'<span>分类号:'+(r[i].SortNo?r[i].SortNo:"")+'</span>'
  346. +'<span>简称:'+(r[i].SoftSimpleName?r[i].SoftSimpleName:"")+'</span>'
  347. +'</div><span>版本号:'+(r[i].Version?r[i].Version:"")+'</span>'
  348. +'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
  349. +'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
  350. +'</div></td></tr>';
  351. }
  352. $("#computerSoftCopyRightListPaging").parent().prevAll().remove();
  353. $("#computerSoftCopyRightListPaging").parent().before(hm);
  354. });
  355. }
  356. if(patentFlag){
  357. $("#patentList .badge").text(patent.length);
  358. patent.sort(function(a,b){
  359. if(a.PublicDate<b.PublicDate){
  360. return 1;
  361. }else if(a.PublicDate==b.PublicDate){
  362. return 0;
  363. }
  364. return -1;
  365. });
  366. var frontPaging = new FrontPaging("patentListPaging",patent,5,function(r){
  367. var hm = '';
  368. for(var i=0;i<r.length;i++){
  369. hm += '<tr><td><div class="b-com-first">'+(r[i].PatentName?r[i].PatentName:"")+'</div>'
  370. +'<div class="b-com-second"><div>'
  371. +'<span>申请人:'+(r[i].ApplyPerson?r[i].ApplyPerson:"")+'</span>'
  372. +'<span>申请号:'+(r[i].ApplyNo?r[i].ApplyNo:"")+'</span>'
  373. +'<span>申请日期:'+(r[i].ApplyDate?r[i].ApplyDate.replace(/\./g,"-"):"")+'</span>'
  374. +'</div><span>分类号:'+(r[i].IpcTypeNo?r[i].IpcTypeNo:"")+'</span>'
  375. +'<span>公开号:'+(r[i].PublicNo?r[i].PublicNo:"")+'</span>'
  376. +'<span>公开日期:'+(r[i].PublicDate?r[i].PublicDate.replace(/\./g,"-"):"")+'</span>'
  377. +'</div></td></tr>';
  378. }
  379. $("#patentListPaging").parent().prevAll().remove();
  380. $("#patentListPaging").parent().before(hm);
  381. });
  382. }
  383. });
  384. }else{
  385. $("#copyright .ent-findnull").removeClass("hide");
  386. }
  387. }
  388. //服务列表
  389. function ServicePaging(){
  390. this.initServiceList = function(){
  391. var paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},service.pageSize,function(r){
  392. if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && r.length == 0){
  393. $(".ent-yellowpage .ent-findnull").removeClass("hide");
  394. $(".ent-yellowpage .ent-layout-down").remove();
  395. return;
  396. }
  397. $(".serviceList-layout").removeClass("hide");
  398. var html = '';
  399. for(var i=0;i<r.length;i++){
  400. var f_price = r[i].f_price;
  401. if(typeof(f_price) == "undefined" || f_price == null || f_price == ""){
  402. f_price = 0;
  403. }
  404. var i_sales = r[i].i_sales;
  405. if(typeof(i_sales) == "undefined" || i_sales == null || i_sales == ""){
  406. i_sales = 0;
  407. }
  408. var i_comments = r[i].i_comments;
  409. if(typeof(i_comments) == "undefined" || i_comments == null || i_comments == ""){
  410. i_comments = 0;
  411. }
  412. var flag = typeof(r[i].s_isshow) != "undefined" && r[i].s_isshow != null && r[i].s_isshow.indexOf("3")>-1;
  413. html += '<tr>'
  414. +'<td rowspan="2" width="130"><img src="'+(r[i].s_images==""?"null":(cdn+r[i].s_images))+'" onerror="this.src=\''+cdn+'/images/services/default.png\'"></td>'
  415. +'<td class="b-com-name">';
  416. if(flag){
  417. html += '<a href="/market/detail/'+r[i]._id+'.html">';
  418. }
  419. html += r[i].s_name;
  420. if(flag){
  421. html += '</a>';
  422. }
  423. html += '</td>';
  424. if(flag){
  425. html += '<td width="150" class="text-center"><font class="b-disabled">报价:</font><font class="text-primary">'+(r[i].s_pricemy==1?"面议":f_price+"元")+'</font></td>'
  426. +'<td width="250" class="text-center"><font class="b-disabled">成交:</font><font class="text-primary">'+i_sales+'</font><font class="margin-lr-5 b-disabled">|</font><font class="b-disabled">评价:</font><font class="text-primary">'+i_comments+'</font></td>';
  427. }else{
  428. html += '<td>&nbsp;</td><td>&nbsp;</td>';
  429. }
  430. html += '</tr><tr>'
  431. +'<td colspan="3"><div class="ent-serviceintroduction">'+r[i].s_introduction+'</div></td>'
  432. +'</tr>';
  433. }
  434. $("#serviceListPaging").parent().prevAll().remove();
  435. $("#serviceListPaging").parent().before(html);
  436. $(".ent-serviceintroduction").each(function(){
  437. var text = $(this).text();
  438. if(text.length > 200){
  439. text = text.substring(0,150)+"...";
  440. }
  441. $(this).html(text);
  442. });
  443. },service);
  444. paging.firstPageDatas = null;
  445. }
  446. if(hasLoadPagingJs){
  447. this.initServiceList();
  448. }else{
  449. var thisClass = this;
  450. loadJS(cdn+"/js/paging.js",function(){
  451. hasLoadPagingJs = true;
  452. thisClass.initServiceList();
  453. });
  454. }
  455. }
  456. //失信信息
  457. function DishonestyPaging(){
  458. this.initDishonesty = function(){
  459. var paging = new Paging("dishonestyListPaging","/front/getDishonesty",{legcerNo:legcerNo},dishonesty.pageSize,function(r){
  460. if(r.length == 0){
  461. $(".ent-dishonesty .ent-findnull").removeClass("hide");
  462. $(".ent-dishonesty .ent-layout-up").remove();
  463. return;
  464. }
  465. var html = '';
  466. for(var i=0;i<r.length;i++){
  467. html += '<tr><td>'
  468. +'<div class="b-com-first">'+r[i].iname+'</div>'
  469. +'<div class="b-com-second">案号:'+r[i].case_code+'</div>'
  470. +'<div class="b-com-third">'
  471. +'<span>法院:'+r[i].court_name+'</span>'
  472. +'<span>状态:'+r[i].performance+'</span>'
  473. +'<span>立案日期:'+new Date(Number(r[i].l_date+"000")).Format("yyyy-MM-dd")+'</span>'
  474. +'</div>'
  475. +'</td></tr>';;
  476. }
  477. $("#dishonestyListPaging").parent().prevAll().remove();
  478. $("#dishonestyListPaging").parent().before(html);
  479. },dishonesty);
  480. paging.firstPageDatas = null;
  481. }
  482. if(hasLoadPagingJs){
  483. this.initDishonesty();
  484. }else{
  485. var thisClass = this;
  486. loadJS(cdn+"/js/paging.js",function(){
  487. hasLoadPagingJs = true;
  488. thisClass.initDishonesty();
  489. });
  490. }
  491. }