var entSearch = new Vue({ el: '.vue-search-container', delimiters: ['${', '}'], mixins: [workspaceDescMixin], components: { areaCityComponent: areaCityComponent, selectListComponent: selectListComponent, priceComponent: priceComponent, noData: noDataComponent }, data: function () { return { isFree: true, foundingTime:'',//成立时间 provinceMap: provinceMap, searchContent: pageInfo.searchContent, tabActive: 'qy', filterShow: true, query: {}, searchTypeList: [ { label: '企业名称', value: 'A' }, { label: '法定代表人', value: 'B' }, // { // label: '股东', // value: 'C' // }, // { // label: '高管', // value: 'D' // }, { label: '经营范围', needVip: true, value: 'F' }, { label: '中标项目/标的物', needVip: true, value: 'E' } ], entTypeList: [ { label: '有限责任公司', value: 'A' }, { label: '股份有限公司', value: 'B' }, { label: '有限合伙', value: 'C' }, { label: '普通合伙', value: 'D' } ], entStateList: [ { label: '存续(在营、开业、在业)', value: 'A' }, { label: '吊销', value: 'B' }, { label: '注销', value: 'C' }, { label: '撤销', value: 'D' } ], entTimeList:[ { label: '近1年内', value: 'A' }, { label: '1-3年', value: 'B' }, { label: '3-5年', value: 'C' }, { label: '5-10年', value: 'D' }, { label: '10年以上', value: 'E' }, ], priceList: [ { label: '100万以内', value: '0-100' }, { label: '100-500万', value: '100-500' }, { label: '500-1000万', value: '500-1000' }, { label: '1000-5000万', value: '1000-5000' }, { label: '5000万以上', value: '5000-' }, ], zblyFilterOption: { zbAreaOptions: [ // { // label: '北京', // value: '北京' // } ], dwlxOptions: [ { label: '采购单位', value: '1' }, { label: '投标企业', value: '2' }, { label: '招标代理机构', value: '3' }, { label: '厂商', value: '4' } ], lxfsOptions: [ { label: '固定电话', value: '1' }, { label: '手机号', value: '2' }, // { // label: '电子邮箱', // value: '3' // }, // { // label: '不存在', // value: '4' // } ], }, filterState: { searchType: ['A'], entArea: [], entCity: [], entType: [], entStatus: [], entCapital: [], biddingArea: '', // 中标区域 entClass: '', // 单位类型 entContact: '', // 联系方式 establish:[],//成立时间 }, listState: { loaded: false, // 是否已经搜索过 loading: false, pageNum: 1, // 当前页, 从0开始 pageSize: 10, // 每页多少条数据 total: 0, // 一共多少条数据 list: [], // 查询请求返回的数据 pageTotal: 1 // 一共多少页(计算出来) }, preSearch: { hover: false, focus: false, list: [] }, entUseInfo: { used: 0, total: 0, province: 0 }, powerInfo: { entniche: '', member: '', vip: '' }, power: false, powerLoaded: false, powerDialogShow: false, baiduName: '', inputStatus: false, inIframe: false, isLogin: false, buttonType:false,//成立时间自定义区间确定按钮的显示状态 focusColor:false,//改变获取焦点输入框的背景颜色 startDate:'', endDate:'', thisStartTime:'', thisEndTime:'', indusShow: false, employInfo: [] } }, watch: { tabActive: function (newVal, oldVal) { if (newVal === 'zb') { if (this.searchContent) { location.href = '/jylab/supsearch/index.html?keywords=' + this.searchContent + '&publishtime=thisyear' } else { location.href = '/jylab/supsearch/index.html' } } else if (newVal === 'cgdw') { if (this.searchContent) { location.href = '/jylab/purSearch/index.html?keywords=' + this.searchContent } else { location.href = '/jylab/purSearch/index.html' } } else if (newVal === 'gy') { if (this.searchContent) { location.href = '/swordfish/page_web_pc/search/issued?keywords=' + this.searchContent } else { location.href = '/swordfish/page_web_pc/search/issued' } } } }, computed: { getInputStatus: function () { return this.inputStatus }, preSearchListShow: function () { return this.searchContent.trim().length >= 2 && this.preSearch.list.length && (this.preSearch.focus || this.preSearch.hover) }, buttonText: function () { if (this.power) { return '升级' } else { if (this.powerInfo.vip === 0) { return '开通' } else if (this.powerInfo.vip === 1) { return '升级' } else { return '升级' } } }, showEntUsage: function () { return !this.powerInfo.member && this.powerInfo.vip > 1 }, searchTypeListComputed: function () { if (this.isLogin) { var arr = [] this.searchTypeList.forEach(function (item) { if (!item.needVip) { arr.push(item) } else if(goTemplateData.inIframe) { arr.push(item) } }) return arr } else { var arr = [] this.searchTypeList.forEach(function (item) { if (!item.needVip) { arr.push(item) } }) return arr } }, getVipSubText: function () { var count = this.entUseInfo.province if (count == -1) { return '全国' } else { if (count) { return count + '个省' } else { return '' } } }, company_phone_show :function (){ return this.isLogin && !this.isFree }, getBIParams () { const urlParams = new URLSearchParams(window.location.search) return urlParams.get('resource') } }, created: function () { var params = goTemplateData.params this.inIframe = goTemplateData.inIframe this.isLogin = !!params.isLogin if (this.isLogin) { this.getPower() } else { this.doSearch() } }, mounted: function () { const entdata = sessionStorage.getItem('entdata') if(entdata) { const {filterState, listState, searchContent} = JSON.parse(entdata) this.filterState = filterState this.listState = listState this.searchContent = searchContent const proviceCity = { province: this.filterState.entArea, city: this.filterState.entCity, } this.$refs.areaCityFilter.setStateData(proviceCity) sessionStorage.removeItem('entdata') } else { this.getQuery() this.initPageData() this.initProvinceMapList() } this.initDOMEvents() this.filterEcho(this.filterState) // 全选按钮逻辑 // this.searchTypeChange([], true) this.industryTab() /** * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件 */ // if (this.inIframe) { // this._$SearchEvent = initSearchPageEvent({ // type: 'company', // el: '.search-header-top .input-container', // submitSelector: '.search-button', // change: function(val) { // this.searchContent = val // } // }) // } }, methods: { // 引导文案点击事件 guideGoWorkSpace: function () { if (!this.isLogin) { return openLoginDig() } this.goWorkSpace() }, goBack () { var back = function () { window.top.history.back() } var goHome = function () { // 判断是否在iframe,如果在iframe,则用父级返回 window.top.location.href = '/' } var referer = document.referer if(referer) { var inJianyuWebSite = referer.indexOf('jianyu360.cn') > 0 if (inJianyuWebSite) { // 本站的,判断是否是新窗口打开的页面 // 1.window.open可以通过判断window.opener // 2.a target='_black'可以通过判断history.length var opener = window.opener && window.opener !== window var target_blank = history.length <= 1 // 是否新窗口打开 var isNewWindow = opener || target_blank if (isNewWindow) { try { window.parent && window.parent.close() } catch (error) { window.close() } back() } else { back() } } else { goHome() } } else { goHome() } }, // 筛选条件回显 filterEcho: function (data) { const filterLabel = [ 'searchType', 'entCapital', 'entType', 'entState', 'entTime', ] filterLabel.forEach(item => { if (data[item] && data[item].length) { if(item ==='entCapital') { // 注册资本输入框是否有值 const writePrice = this.priceList.filter(f => { return data[item].some(v => f.value === v); }); if(!writePrice.length) { console.info(data[item][0]) const priceData = data[item][0].split('-') priceData.sort((a, b) => a - b) const min = priceData[0] const max = priceData[1] this.$refs.priceRef.setState(min, max) this.inputStatus = true this.$refs[item].setState([0]) } else { this.$refs[item].setState(data[item]) } } else { this.$refs[item].setState(data[item]) } } if(item === 'entTime') { const thisList = [] data['establish'].forEach(item => { if (item === '-1y') { thisList.push('A'); } else if (item === '1y-3y') { thisList.push('B'); } else if (item === '3y-5y') { thisList.push('C'); } else if (item === '5y-10y') { thisList.push('D'); } else if (item === '10y-') { thisList.push('E'); } else { // 回显时间输入框 this.focusColor = true; thisList.push('0') const timeData = item.split('-') timeData[0] = timeData[0] + '000' timeData[1] = timeData[1] + '000' this.startTimeChange(parseInt(timeData[0])) this.endTimeChange(parseInt(timeData[1])) } }) this.$refs[item].setState(thisList) } if(item === 'entState') { this.$refs[item].setState(data['entStatus']) } }) }, goWorkSpace: function () { const saveData = { filterState: this.filterState, listState: this.listState, searchContent: this.searchContent } sessionStorage.setItem('entdata', JSON.stringify(saveData)) var goHref = location.origin + '/jylab/entSearch/index.html' window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref)) }, // 查询收录情况 getEmployData (ids) { const url = '/jyapi/crmApplication/employ/info' const params = { employType: 2, idArr: ids ? ids.join(',') : '' } $.ajax({ url: url, type: 'POST', data: JSON.stringify(params), contentType: 'application/json', success: function (res) { if (res.error_code === 0) { this.employInfo = res.data res.data.forEach((r) => { this.listState.list.forEach(m => { if(m.id === r.id) { m.active = r.isEmploy ? 1 : 0 } }) }) this.$forceUpdate() console.info(this.listState.list) } }.bind(this) }) }, // 收录操作 setEmployEvent (item) { const _this = this const url = '/jyapi/crmApplication/employ/operate' const params = { idArr: item.id, isEmploy: !item.active, employType: 2 } $.ajax({ url: url, type: 'POST', data: JSON.stringify(params), contentType: 'application/json', success: function (res) { if(res.error_code === 0) { if (res.data.status) { item.active = !item.active ? 1 : 0 } else { _this.toastFn(res.data.msg, 800) } } this.$forceUpdate() }.bind(this), complete: function () { }.bind(this) }) }, getQuery: function () { this.query.from = getParam('from') this.query.point = getParam('point') }, industryTab: function() { $.ajax({ type:'POST', url:'/entnicheNew/buy/whetherbuy', success:function (res) { if (res && res.error_code == 1001 || res.error_msg.indexOf('登录') >- 1) { $('#tab-cgdw').css('display', 'none') } if (res && res.data && res.data.isNew) { $('#tab-cgdw').css('display', 'inline-block') } else { $('#tab-cgdw').css('display', 'none') } } }) }, getSearchForValues: function () { return this.searchTypeList.map(function (v) { return v.value }) }, checkLogin: function () { var moduleOpen = $('body').hasClass('modal-open') if (moduleOpen) return if (!loginflag) { $("#bidLogin").modal("show"); } }, getPower: function (callback) { $.ajax({ url: '/publicapply/bidcoll/power', type: 'POST', success: function (res) { if (res.error_code === 0 && res.data) { Object.assign(this.powerInfo, res.data) this.checkPower() this.doSearch() if (this.showEntUsage) { this.getEntProtUsage() } } else { // this.checkLogin() } }.bind(this), complete: function () { this.powerLoaded = true callback && callback() }.bind(this) }) }, checkPower: function () { this.power = this.powerInfo.member || this.powerInfo.vip !== 0 return this.power }, initPageData: function () { console.info(pageInfo) if (pageInfo.searchContent) { this.searchContent = pageInfo.searchContent } }, initProvinceMapList: function () { var provinceMapList = [] for (var key in this.provinceMap) { this.provinceMap[key].forEach(function (item) { provinceMapList.push({ label: item, value: item }) }) } this.zblyFilterOption.zbAreaOptions = provinceMapList }, initDOMEvents: function () { ewmMoveHover() refreshEwmText(this.searchContent) insertVipIcon($('.search-type .el-checkbox:nth-of-type(4)')) insertVipIcon($('.search-type .el-checkbox:nth-of-type(5)')) setTimeout(function () { tabHover() }, 300) }, isFilterShow: function () { if (this.filterShow) { $('.search-filters').slideUp() } else { $('.search-filters').slideDown() } this.filterShow = !this.filterShow }, searchTypeChange: function (t, hideTip) { // 全选逻辑隐藏 // var tempRef = this.$refs.searchType // var tempList = this.getSearchForValues() // if (t.length === 0) { // if (tempRef && tempRef.$data.selectList[0].selected) { // t = tempList // } // } else if (tempList.join('') === t.join('')) { // tempRef && tempRef.setState() // } console.info(t); console.info(hideTip); var eIndex = t.indexOf('E') if (!this.power && eIndex !== -1) { t.splice(eIndex, 1) this.$refs.searchType.setState(t) if (!hideTip) { this.powerDialogShow = true return } } var eIndex1 = t.indexOf('F') if (!this.power && eIndex1 !== -1) { t.splice(eIndex1, 1) this.$refs.searchType.setState(t) if (!hideTip) { this.powerDialogShow = true return } } this.filterState.searchType = t this.doSearch() }, areaCityChange: function (area) { var city = [] var area_arr = [] for (var key in area) { if(area[key].length>0){ city = city.concat(area[key]) }else{ area_arr = area_arr.concat(key) } } this.filterState.entArea = area_arr//Object.keys(area) this.filterState.entCity = city this.doSearch() }, entTypeChange: function (e) { if (!e.length) { this.$refs.entType.$data.selectList[0].selected = true } this.filterState.entType = e this.doSearch() }, entStateChange: function (e) { if (!e.length) { this.$refs.entState.$data.selectList[0].selected = true } this.filterState.entStatus = e this.doSearch() }, //计算几年前的时间戳 getTimeDate: function(year){ let time = Number(year); let date = new Date(); let lastYear = Number(date.getFullYear()-time)+'-'+Number(date.getMonth()+1)+'-'+date.getDate(); let lastYearDate = new Date(lastYear); lastYearDate = lastYearDate.getTime();//一年前时间戳; return lastYearDate; }, //成立时间多选 entTimeChange: function (e) { let _this = this; // console.info('成立时间多选',e); _this.focusColor = false; if (!e.length) { _this.$refs.entTime.$data.selectList[0].selected = true; _this.filterState.establish = []; }else{ let thisList = []; e.forEach(function (item) { // console.info(item); switch (item) { case 'A': // thisList.push(_this.getTimeDate(0)+'-'+_this.getTimeDate(1)) thisList.push('-1y') break; case 'B': // thisList.push(_this.getTimeDate(1)+'-'+_this.getTimeDate(3)) thisList.push('1y-3y') break; case 'C': // thisList.push(_this.getTimeDate(3)+'-'+_this.getTimeDate(5)) thisList.push('3y-5y') break; case 'D': // thisList.push(_this.getTimeDate(5)+'-'+_this.getTimeDate(10)) thisList.push('5y-10y') break; case 'E': // thisList.push(_this.getTimeDate(10)+'-'+_this.getTimeDate(1)) thisList.push('10y-') break; default: break; } _this.filterState.establish = thisList; }) // if (_this.foundingTime) { // // console.info(_this.foundingTime) // _this.filterState.establish.push(_this.foundingTime[0]+'-'+_this.foundingTime[1]) // } } console.info(_this.filterState.establish); _this.doSearch() }, //时间戳转换yyyy-mm-dd getThisDate:function(time){ var date = new Date(time); var YY = date.getFullYear() + '年'; var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'; var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日'; return YY + MM + DD }, //成立时间区间 foundingTimeChange:function(e){ if (e) { let time = e[0]+'-'+e[1]; console.info('成立时间',time); console.info('成立时间',e); this.startDate = this.getThisDate(e[0]); this.endDate = this.getThisDate(e[1]); } }, startTimeChange:function(e){ if (e) { console.info('startTimeChange',e); this.startDate = this.getThisDate(e); } }, endTimeChange:function(e){ if (e) { console.info('endTimeChange',e); if (e < this.thisStartTime && this.thisStartTime) { // alert('结束日期不能小于开始日期,请重新选择') this.endDate = ''; this.thisEndTime = ''; this.$notify.error({ title: '错误', message: '结束日期不能小于开始日期,请重新选择' }); }else{ this.endDate = this.getThisDate(e); } } }, //成立时间自定义区间搜索按钮 establishSearch:function () { let _this = this; let thisList = []; // console.info(_this.foundingTime); // if (_this.foundingTime) { // thisList.push(_this.foundingTime[0]/1000+'-'+_this.foundingTime[1]/1000) // _this.$refs.entTime.$data.selectList.forEach(function (item) { // // console.info(item); // item.selected = false; // }) // _this.filterState.establish = thisList; // }else{ // _this.$refs.entTime.$data.selectList.forEach(function (item) { // // console.info(item); // item.selected = false; // }) // _this.$refs.entTime.$data.selectList[0].selected = true; // _this.filterState.establish = []; // } if (_this.thisStartTime && _this.thisEndTime) { thisList.push(_this.thisStartTime/1000+'-'+_this.thisEndTime/1000) _this.$refs.entTime.$data.selectList.forEach(function (item) { // console.info(item); item.selected = false; }) _this.filterState.establish = thisList; }else{ _this.$refs.entTime.$data.selectList.forEach(function (item) { // console.info(item); item.selected = false; }) _this.$refs.entTime.$data.selectList[0].selected = true; _this.filterState.establish = []; } _this.doSearch(); _this.buttonType = false; }, showButton:function () { let _this = this; _this.buttonType = true; }, hiddenButton:function () { // let _this = this; // _this.buttonType = false; }, changeColor:function() { let _this = this; _this.focusColor = true; }, // 标准金额区间 inexactPriceChange: function (p) { if (!p.length) { this.$refs.entCapital.$data.selectList[0].selected = true } this.filterState.entCapital = p this.inputStatus = false this.doSearch() }, // 输入金额区间 exactPriceChange: function (p) { this.$refs.entCapital.setState() if (p.min === '' && p.max === '') { this.filterState.entCapital = [''] this.$refs.entCapital.$data.selectList[0].selected = true this.inputStatus = false } else { this.$refs.entCapital.$data.selectList[0].selected = false this.filterState.entCapital = [p.min + '-' + p.max] this.inputStatus = true } this.doSearch() }, zbFilterChange: function (name) { this.baiduName = name if (this.power) { this.doSearch() } else { this.filterState.biddingArea = '' this.filterState.entClass = '' this.filterState.entContact = '' this.powerDialogShow = true } }, getEntProtUsage: function () { $.ajax({ url: '/bigmember/portrait/subVipPortrait/usage', method: 'POST', success: function (res) { if (res.error_code === 0) { if (res.data.total) { this.entUseInfo.total = res.data.total } if (res.data.provin) { this.entUseInfo.province = res.data.provin } if (res.data.usage) { this.entUseInfo.used = res.data.usage } } }.bind(this) }) }, setPageTdk () { var name = this.searchContent.trim() if (name) { setPageTdkToView({ title: name + '相关搜索结果 - 剑鱼标讯', keywords: name + ',' + name + '中标信息,' + name + '项目动态,剑鱼标讯', description: '剑鱼标讯企业搜索是国内专业的中标企业信息查询平台,为您提供' + name + '相关的中标企业信息详情,帮助您全面了解中标企业最新动态,获取更多' + name + '相关搜索结果就上剑鱼标讯!' }) } else { setPageTdkToView({ title: '企业工商信息查询_公司招投标查询_中标企业查询 - 剑鱼标讯', keywords: '企业信息查询,工商查询,招投标公司查询,中标企业查询,中标单位,中标企业画像,剑鱼标讯', description: '剑鱼标讯企业搜索为您精准提供全国工商企业信息、招投标公司及中标企业信息查询服务,涵盖企业信息查询,工商查询,招投标公司查询,中标企业搜索,中标企业画像查看等多维度服务,帮您快速了解企业招投标情况,提前预判风险,拓展合作商机。' }) } }, doSearch: function () { this.setPageTdk() this.resetListState() this.getList() }, resetListState: function () { var state = { loaded: false, loading: false, pageNum: 1, total: 0, list: [] } Object.assign(this.listState, state) }, getPreSearchList: utils.debounce(function () { /** * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件 */ if (this._$SearchEvent) { this._$SearchEvent.syncInput() } var data = { name: this.searchContent.trim() } if (data.name.length < 2) return $.ajax({ url: '/bigmember/search/ent/association', method: 'POST', data: data, success: function (res) { if (res.error_code === 0) { if (res.data) { this.preSearch.list = res.data.list || [] } } else { // this.checkLogin() } }.bind(this) }) }, 200), getList: function () { var data = { match: this.searchContent, matchType: this.filterState.searchType.join(','), entArea: this.filterState.entArea.join(','), entCity: this.filterState.entCity.join(','), entCapital: this.filterState.entCapital.join(','), entType: this.filterState.entType.join(','), entStatus: this.filterState.entStatus.join(','), establish: this.filterState.establish.join(','),//成立时间筛选条件 biddingArea: this.filterState.biddingArea == '全国' ? '' : this.filterState.biddingArea, entClass: this.filterState.entClass, entContact: this.filterState.entContact, pageSize: this.listState.pageSize, pageNum: this.listState.pageNum - 1, // 当前页, 从0开始 } this.listState.loading = true this.listState.loaded = false $.ajax({ url: '/publicapply/enterpriseSearch/doQuery', method: 'POST', data: data, success: function (res) { if (res.error_code === 0) { this.setListStateAndCheckPower(res) } else { // this.checkLogin() } }.bind(this), complete: function () { this.listState.loading = false this.listState.loaded = true }.bind(this) }) }, setListStateAndCheckPower: function (res) { var _this = this if (res.data) { if (res.data.total) { this.listState.total = res.data.total this.listState.pageTotal = Math.ceil(res.data.total / this.listState.pageSize) } if (res.data.list) { res.data.list.forEach(function (d) { d.company_shortname = _this.getShortName(d.company_name) d.randomBgc = _this.randomBgc() try { d.visited = visitedPath.pathVisited( new VisitedPathItem( '/ent_portrait/*', 'id=' + d.id ) ) } catch (error) {} }) this.listState.list = res.data.list || [] const resultIds = res.data.list.map(v => v.id) this.getEmployData(resultIds) // if (this.power) { // this.listState.list = res.data.list || [] // } else { // if (res.data.list.length >= 4) { // res.data.list.length = 4 // res.data.list.push({ // company_shortname: 'xxx', // company_address: 'xxx', // company_name: 'xxx', // company_status: 'xxx', // legal_person: 'xxx', // id: 'xxx', // showMask: true // }) // } // this.listState.list = res.data.list || [] // } } } else { this.listState.total = 0 this.listState.list = [] } }, onPageChange: function (p) { console.log(p, this.listState.total, this.listState.pageTotal); if (p > this.listState.pageTotal) { return this.toastFn('超出页码', 3000) } this.listState.pageNum = p this.getList() }, openVipPage: function (param) { // 企业搜索中标区域-去开通 // 企业搜索单位类型-去开通 // 企业搜索联系方式-去开通 // 企业搜索底部第五条-去开通 // 企业搜索popover-去开通 if (param === 'more') { this.baiduName = '底部第五条' } else if (param === 'popover-link') { this.baiduName = '-超级订阅用户-当月已使用hover' } var str = '企业搜索' + this.baiduName + '-去开通' baiduEvent(str) // 去开通按钮百度统计 window.open('/swordfish/page_big_pc/free/svip/buy') }, openEntHistory: function () { baiduEvent('企业画像查看历史记录') window.open('/swordfish/frontPage/seeHistory/sess/index') }, openCustomerService: function () { $('#go-customer-4').trigger('click') }, toDetail: function (item) { var id = item.id || item.entId var seoId = item.nseo_id let BIPage = '' if (this.getBIParams) { BIPage = '?resource=BI' } else { BIPage = '' } var seoUrl = '/qy/' + seoId + '.html' + BIPage // 去超级订阅画像 var svipLink = '/swordfish/page_big_pc/svip/ent_ser_portrait/' + id + BIPage // 大会员画像 var memberLink = '/swordfish/page_big_pc/ent_portrait/' + id + BIPage // 是渠道合作页面需要登录后重定向 if(cooperateCode) { openLoginDig(null, svipLink) return } else { if (!this.inIframe && seoId) { // 工作桌面外跳转seo画像 return window.open(seoUrl) } } try { item.visited = true visitedPath.pathVisiting( new VisitedPathItem( '/ent_portrait/*', 'id=' + id ) ) } catch (error) {} if (this.powerInfo.member) { // 如果是专家版、智慧版 跳大会员页面 if (window.memberPower && window.memberPower.indexOf(4) !== -1) { window.open(memberLink) } else { // 如果是商机版、自定义版 // 如果同时是超级订阅 判断有没有画像查看次数 if (this.powerInfo.vip > 0) { $.ajax({ type: "POST", url: "/bigmember/portrait/subVipPortrait/usage", data: { entId: id }, success: function(r){ // 如果次数已用完 跳大会员企业画像页面 if (r.data.usage >= r.data.total) { window.open(memberLink) } else { // 没用完 超级订阅跳企业画像页面 window.open(svipLink) } } }); } else { window.open(memberLink) } } } else { window.open(svipLink) } }, calcListItemForCap: function (p) { if (p) { return p + '万元' } else { return '-' } }, getEntStatus: function (status) { if (status === '吊销') { return 'tag-danger' } else if (status === '注销') { return 'tag-danger' } else if (status === '撤销') { return 'tag-disabled' } else { return '' } }, randomBgc: function () { var arr = ['default', 'blue', 'orange', 'green'] var randomIndex = utils.getRandomNumber(0, arr.length - 1) return 'bgc-' + arr[randomIndex] }, getShortName: function (comName) { var areaMap = chinaMapJSON || [] var shortname = comName // 1. 循环省份城市进行替换 areaMap.forEach(function (item) { var p = item.name.replace(/[省市]/, '') if (shortname.indexOf(p) !== -1) { shortname = shortname.replace(item.name, '').replace(p, '') console.log(p + ' -> \'\'') } item.city.forEach(function (iitem) { var c = iitem.name.replace(/[省市]/, '') if (shortname.indexOf(c) !== -1) { shortname = shortname.replace(iitem.name, '').replace(c, '') console.log(c + ' -> \'\'') } iitem.area.forEach(function (iiitem) { if (shortname.indexOf(iiitem) !== -1) { shortname = shortname.replace(iiitem, '') console.log(iiitem + ' -> \'\'') } }) }) }) var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm) var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4) if (shortname.length < 4) { shortname = shortname.slice(0, 4) } return shortname }, onSizeChange: function (val) { this.listState.pageSize = val this.listState.pageNum = 1 this.onPageChange(this.listState.pageNum) }, toastFn: function (text, duration) { if (!duration) { duration = 2000 } var _html = "" _html+='