123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491 |
- var entType = "企业";
- var relationEntity = null;//关系网
- var copyrightEntity = null;//著作权
- var servicePaging = null;//服务列表
- var staffinfoEntity = null;//主要人员
- var dishonestyPaging = null;//失信
- var hasLoadPagingJs = false;//是否已经加载过js
- var identWayFlag = false;//认证状态
- var relationFlag = false;
- var staffinfoFlag = false;
- /**************著作权**************/
- var copyrightFlag = false;
- //作品
- var workCopyRight = null;
- var workCopyRightFlag = false;
- //软件
- var computerSoftCopyRight = null;
- var computerSoftCopyRightFlag = false;
- //专利
- var patent = null;
- var patentFlag = false;
- //解析服务列表
- $(function(){
- staffinfoFlag = typeof(staffinfo) != "undefined" && staffinfo != null && staffinfo.length > 0;
- copyrightFlag = typeof(copyright) != "undefined" && copyright != null;
- if(copyrightFlag){
- //作品
- workCopyRight = copyright.WorkCopyRight;
- workCopyRightFlag = typeof(workCopyRight) != "undefined" && workCopyRight != null;
- //软件
- computerSoftCopyRight = copyright.ComputerSoftCopyRight;
- computerSoftCopyRightFlag = typeof(computerSoftCopyRight) != "undefined" && computerSoftCopyRight != null;
- //专利
- patent = copyright.Patent;
- patentFlag = typeof(patent) != "undefined" && patent != null;
- }
- if($(".b-right").height() >= 500){
- $(".ent-tab-content.b-left").css("min-height",$(".b-right").height());
- }
- //显示著作权数量
- if(copyrightFlag){
- var copyrightCount = 0;
- if(workCopyRightFlag){
- copyrightCount += workCopyRight.length;
- }
- if(computerSoftCopyRightFlag){
- copyrightCount += computerSoftCopyRight.length;
- }
- if(patentFlag){
- copyrightCount += patent.length;
- }
- $("#ent-tab-copyright").text(copyrightCount);
- }else{
- $("#ent-tab-copyright").addClass("disabled");
- }
- //显示失信数量
- if(dishonesty.count > 0){
- $("#ent-tab-dishonesty").text(dishonesty.count);
- }else{
- $("#ent-tab-dishonesty").addClass("disabled");
- }
- //显示变更数量
- if(staffinfoFlag){
- $("#ent-tab-staffinfo").text(staffinfo.length);
- }else{
- $("#ent-tab-staffinfo").addClass("disabled");
- }
- //联系地址
- if($address){
- loadJS(cdn+"/js/jquery.cxselect.js",function(){
- $('#city_china').cxSelect({
- selects: ['province', 'city', 'area'],
- required:0
- });
- $.cxSelect.setVal(province,city,area);
- var pt=province?($("#provincesel option[value="+province+"]").text()):"";
- var ct=city?($("#citysel option[value="+city+"]").text()):"";
- var at=area?($("#areasel option[value="+area+"]").text()):"";
- //设置地图上显示的位置
- $("#location").attr("value",as1);
- $("#cityname").attr("value",pt.trim()+ct.trim()+at.trim());
- initMap();
- $("#city_china").text(pt+ct+at+as1);
- });
- }
- //隐藏地图
- $("#fade").click(closeMap);
- //分享
- $(".entinfo-share").click(function(){
- $(".bdsharebuttonbox").show();
- });
- //切换
- $(".ent-tab>li").click(function(){
- if($(this).hasClass("disabled")){
- return;
- }
- var index = $(this).index();
- $(".ent-tab>li").removeClass("ent-active");
- $(this).addClass("ent-active");
- $(".ent-tab-content>div").addClass("hide");
- $(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
- if(index != 0){
- //企业概况如果没有数据,选项卡不可点
- 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)){
- $(".ent-tab>li:eq(0)").addClass("disabled");
- }
- }
- if(index != 1){
- //关系网如果没有数据,选项卡不可点
- if(relationFlag){
- $(".ent-tab>li:eq(1)").addClass("disabled");
- }
- }
- if(index == 1){
- b_afterLogin(isLogined);
- }else if($(this).index() == 2 && staffinfoEntity == null){
- //加载服务列表
- staffinfoEntity = new StaffinfoEntity();
- }else if($(this).index() == 3 && copyrightEntity == null){
- //加载服务列表
- copyrightEntity = new CopyrightEntity();
- }else if($(this).index() == 5 && dishonestyPaging == null){
- //加载失信列表
- dishonestyPaging = new DishonestyPaging();
- }else if($(this).index() == 6 && servicePaging == null){
- //加载服务列表
- servicePaging = new ServicePaging();
- }
- });
- pcShare();
- });
- function initMap(){
- //获取地图的经纬度
- loadJS("http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217",function(){
- loadJS(cdn+"/js/geocoder.js",function(){
- doOptions();
- });
- });
- }
- //显示地图
- function showMap(){
- document.getElementById('mapshowdiv').style.display = 'block';
- document.getElementById('closeshowmap').style.display = 'block';
- document.getElementById('fade').style.display = 'block';
- $("html,body").addClass("overflow-hidden");
- }
- //关闭地图
- function closeMap(){
- document.getElementById('mapshowdiv').style.display = 'none';
- document.getElementById('closeshowmap').style.display = 'none';
- document.getElementById('fade').style.display = 'none';
- $("html,body").removeClass("overflow-hidden");
- }
- function b_afterLogin(flag,result){
- //关系网如果没有数据,选项卡不可点
- if(typeof(result) != "undefined"){
- identWayFlag = result.identWay == 1;
- }
- //identWayFlag = true;//暂时把认证权限放开
- relationFlag = flag && identWayFlag && !relFlag;
- if(!$(".ent-tab>li:eq(1)").hasClass("ent-active") && relationFlag){
- $(".ent-tab>li:eq(1)").addClass("disabled");
- }
- if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relationEntity == null){
- initRelation();
- }
- }
- //加载关系网
- function initRelation(){
- if(isLogined){
- /*if($("#entrelation-limit").hasClass("hide")){
- $(".entrelation").height($(".ent-tab-content").height());
- }*/
- var relationNoData = function(){
- $("#entrelation-limit,#entrelation-nologin").addClass("hide");
- relationEntity = "";
- $("#entrelation-infovis").hide();
- $("#entrelation-findnull").removeClass("hide");
- }
- if(identWayFlag){
- if(relationFlag){
- relationNoData();
- }else{
- $("#entrelation-limit,#entrelation-nologin").addClass("hide");
- $.ajax({
- url: "/member/getRelation",
- method: "post",
- data: {regNo:regNo,entName:entName},
- success: function(r){
- if(!r || !r.flag || !r.relation || !r.relation.links || r.relation.links.length == 0 || !r.relation.nodes || r.relation.nodes.length <= 1){
- relationNoData();
- }else{
- $(".entrelation").height($(".ent-tab-content").height());
- loadJS(cdn+"/js/d3.v3.min.js",function(){
- loadJS(cdn+"/js/geometry.js",function(){
- loadJS(cdn+"/js/provinceData.min.js",function(){
- loadJS(cdn+"/js/relation.js",function(){
- relationEntity = new Relation(legcerNo,regNo,regCapCurName,r.relation,r.relation.nodes.length>15);
- relationEntity.init();
- });
- });
- });
- });
- }
- },
- error: function(){
- relationNoData();
- }
- });
- }
- }else{
- $("#entrelation-nologin").addClass("hide");
- $("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
- $("#entrelation-infovis").hide();
- }
- }else{
- $("#entrelation-limit,#entrelation-nologin").removeClass("hide");
- }
- }
- function StaffinfoEntity(){
- //主要人员
- if(staffinfoFlag){
- var staffinfos1 = [],staffinfos2 = [],staffinfos3 = [],staffinfos4 = [];
- for(var i=0;i<staffinfo.length;i++){
- switch(staffinfo[i].Position){
- case "410A":
- case "410B":
- case "410C":
- case "431A":
- case "431B":
- staffinfos1.push(staffinfo[i]);
- break;
- case "432A":
- case "432K":
- staffinfos2.push(staffinfo[i]);
- break;
- case "434Q":
- case "434R":
- case "436A":
- staffinfos3.push(staffinfo[i]);
- break;
- default:
- staffinfos4.push(staffinfo[i]);
- break;
- }
- }
- staffinfos1.sort(function(a,b){return a.Position-b.Position});
- staffinfos2.sort(function(a,b){return a.Position-b.Position});
- staffinfos3.sort(function(a,b){return a.Position-b.Position});
- staffinfos4.sort(function(a,b){return a.Position-b.Position});
- var hm = '<div class="ent-mainpersons">';
- //计算出一行可以放几个
- var maxCout = parseInt($(".ent-tab-content").width() / (207+20));
- var verticalFlag = false;
- var appendStaffinfo = function(obj,index){
- var tmp = 0;
- for(var i=0;i<obj.length;i++){
- var positionName = obj[i].PositionName;
- if(typeof(positionName) == "undefined" || positionName == null || positionName == ""){
- positionName = "监事";
- }
- tmp++;
- if(i==0){
- hm+='<div class="staffinfo-level-'+index+'">';
- if(verticalFlag){
- hm+='<a class="staffinfo-vertical"></a>';
- }
- }
- verticalFlag = true;
- hm+='<div><img src="'+cdn+'/images/entcommunity/mainperson'+index+'.png">'
- +'<span><font class="b-com-name">'+obj[i].Name+'</font><font class="ent-positionName">'+positionName+'</font></span></div>';
- //竖线
- if(tmp == maxCout && i != obj.length-1){
- hm+='<a class="staffinfo-vertical"></a>';
- }
- //横线
- if(i != obj.length-1){
- if(tmp <= maxCout-1){
- hm+='<a class="staffinfo-horizontal"></a>';
- }else{
- tmp = 0;
- }
- }
- if(i==obj.length-1){
- hm+='</div>';
- }
- }
- }
- appendStaffinfo(staffinfos1,1);
- appendStaffinfo(staffinfos2,2);
- appendStaffinfo(staffinfos3,3);
- appendStaffinfo(staffinfos4,4);
- hm+='</div>';
- $(".ent-mainperson").html(hm);
- }else{
- $(".ent-mainperson .ent-findnull").removeClass("hide");
- }
- }
- function CopyrightEntity(){
- //著作权
- if(copyrightFlag){
- loadJS(cdn+"/js/frontpaging.js",function(){
- if(workCopyRightFlag){
- $("#workCopyRightList .badge").text(workCopyRight.length);
- workCopyRight.sort(function(a,b){
- if(a.FirstPublishDate<b.FirstPublishDate){
- return 1;
- }else if(a.FirstPublishDate==b.FirstPublishDate){
- return 0;
- }
- return -1;
- });
- var frontPaging = new FrontPaging("workCopyRightListPaging",workCopyRight,5,function(r){
- var hm = '';
- for(var i=0;i<r.length;i++){
- hm += '<tr><td><div class="b-com-first">'+(r[i].WorkName?r[i].WorkName:"")+'</div>'
- +'<div class="b-com-second"><div>'
- +'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
- +'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
- +'</div><span>作品类别:'+(r[i].WorkType?r[i].WorkType:"")+'</span>'
- +'<span>创作完成日期:'+(r[i].FinishedDate?r[i].FinishedDate:"")+'</span>'
- +'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
- +'</div></td></tr>';
- }
- $("#workCopyRightListPaging").parent().prevAll().remove();
- $("#workCopyRightListPaging").parent().before(hm);
- });
- }
- if(computerSoftCopyRightFlag){
- $("#computerSoftCopyRightList .badge").text(computerSoftCopyRight.length);
- computerSoftCopyRight.sort(function(a,b){
- if(a.FirstPublishDate<b.FirstPublishDate){
- return 1;
- }else if(a.FirstPublishDate==b.FirstPublishDate){
- return 0;
- }
- return -1;
- });
- var frontPaging = new FrontPaging("computerSoftCopyRightListPaging",computerSoftCopyRight,5,function(r){
- var hm = '';
- for(var i=0;i<r.length;i++){
- hm += '<tr><td><div class="b-com-first">'+(r[i].SoftFullName?r[i].SoftFullName:"")+'</div>'
- +'<div class="b-com-second"><div>'
- +'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
- +'<span>分类号:'+(r[i].SortNo?r[i].SortNo:"")+'</span>'
- +'<span>简称:'+(r[i].SoftSimpleName?r[i].SoftSimpleName:"")+'</span>'
- +'</div><span>版本号:'+(r[i].Version?r[i].Version:"")+'</span>'
- +'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
- +'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
- +'</div></td></tr>';
- }
- $("#computerSoftCopyRightListPaging").parent().prevAll().remove();
- $("#computerSoftCopyRightListPaging").parent().before(hm);
- });
- }
- if(patentFlag){
- $("#patentList .badge").text(patent.length);
- patent.sort(function(a,b){
- if(a.PublicDate<b.PublicDate){
- return 1;
- }else if(a.PublicDate==b.PublicDate){
- return 0;
- }
- return -1;
- });
- var frontPaging = new FrontPaging("patentListPaging",patent,5,function(r){
- var hm = '';
- for(var i=0;i<r.length;i++){
- hm += '<tr><td><div class="b-com-first">'+(r[i].PatentName?r[i].PatentName:"")+'</div>'
- +'<div class="b-com-second"><div>'
- +'<span>申请人:'+(r[i].ApplyPerson?r[i].ApplyPerson:"")+'</span>'
- +'<span>申请号:'+(r[i].ApplyNo?r[i].ApplyNo:"")+'</span>'
- +'<span>申请日期:'+(r[i].ApplyDate?r[i].ApplyDate.replace(/\./g,"-"):"")+'</span>'
- +'</div><span>分类号:'+(r[i].IpcTypeNo?r[i].IpcTypeNo:"")+'</span>'
- +'<span>公开号:'+(r[i].PublicNo?r[i].PublicNo:"")+'</span>'
- +'<span>公开日期:'+(r[i].PublicDate?r[i].PublicDate.replace(/\./g,"-"):"")+'</span>'
- +'</div></td></tr>';
- }
- $("#patentListPaging").parent().prevAll().remove();
- $("#patentListPaging").parent().before(hm);
- });
- }
- });
- }else{
- $("#copyright .ent-findnull").removeClass("hide");
- }
- }
- //服务列表
- function ServicePaging(){
- this.initServiceList = function(){
- var paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},service.pageSize,function(r){
- if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && r.length == 0){
- $(".ent-yellowpage .ent-findnull").removeClass("hide");
- $(".ent-yellowpage .ent-layout-down").remove();
- return;
- }
- $(".serviceList-layout").removeClass("hide");
- var html = '';
- for(var i=0;i<r.length;i++){
- var f_price = r[i].f_price;
- if(typeof(f_price) == "undefined" || f_price == null || f_price == ""){
- f_price = 0;
- }
- var i_sales = r[i].i_sales;
- if(typeof(i_sales) == "undefined" || i_sales == null || i_sales == ""){
- i_sales = 0;
- }
- var i_comments = r[i].i_comments;
- if(typeof(i_comments) == "undefined" || i_comments == null || i_comments == ""){
- i_comments = 0;
- }
- var flag = typeof(r[i].s_isshow) != "undefined" && r[i].s_isshow != null && r[i].s_isshow.indexOf("3")>-1;
- html += '<tr>'
- +'<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>'
- +'<td class="b-com-name">';
- if(flag){
- html += '<a href="/market/detail/'+r[i]._id+'.html">';
- }
- html += r[i].s_name;
- if(flag){
- html += '</a>';
- }
- html += '</td>';
- if(flag){
- 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>'
- +'<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>';
- }else{
- html += '<td> </td><td> </td>';
- }
- html += '</tr><tr>'
- +'<td colspan="3"><div class="ent-serviceintroduction">'+r[i].s_introduction+'</div></td>'
- +'</tr>';
- }
- $("#serviceListPaging").parent().prevAll().remove();
- $("#serviceListPaging").parent().before(html);
- $(".ent-serviceintroduction").each(function(){
- var text = $(this).text();
- if(text.length > 200){
- text = text.substring(0,150)+"...";
- }
- $(this).html(text);
- });
- },service);
- paging.firstPageDatas = null;
- }
- if(hasLoadPagingJs){
- this.initServiceList();
- }else{
- var thisClass = this;
- loadJS(cdn+"/js/paging.js",function(){
- hasLoadPagingJs = true;
- thisClass.initServiceList();
- });
- }
- }
- //失信信息
- function DishonestyPaging(){
- this.initDishonesty = function(){
- var paging = new Paging("dishonestyListPaging","/front/getDishonesty",{legcerNo:legcerNo},dishonesty.pageSize,function(r){
- if(r.length == 0){
- $(".ent-dishonesty .ent-findnull").removeClass("hide");
- $(".ent-dishonesty .ent-layout-up").remove();
- return;
- }
- var html = '';
- for(var i=0;i<r.length;i++){
- html += '<tr><td>'
- +'<div class="b-com-first">'+r[i].iname+'</div>'
- +'<div class="b-com-second">案号:'+r[i].case_code+'</div>'
- +'<div class="b-com-third">'
- +'<span>法院:'+r[i].court_name+'</span>'
- +'<span>状态:'+r[i].performance+'</span>'
- +'<span>立案日期:'+new Date(Number(r[i].l_date+"000")).Format("yyyy-MM-dd")+'</span>'
- +'</div>'
- +'</td></tr>';;
- }
- $("#dishonestyListPaging").parent().prevAll().remove();
- $("#dishonestyListPaging").parent().before(html);
- },dishonesty);
- paging.firstPageDatas = null;
- }
- if(hasLoadPagingJs){
- this.initDishonesty();
- }else{
- var thisClass = this;
- loadJS(cdn+"/js/paging.js",function(){
- hasLoadPagingJs = true;
- thisClass.initDishonesty();
- });
- }
- }
|