|
@@ -1,256 +1,191 @@
|
|
|
var vNode = {
|
|
|
- delimiters: ['${', '}'],
|
|
|
- el: '#ent-portrait',
|
|
|
- components: {
|
|
|
- vipComponent: vipComponent,
|
|
|
- hisproComponent: hisproComponent
|
|
|
- },
|
|
|
- data () {
|
|
|
- // 修改柱状条颜色为渐变色
|
|
|
- this.colorGreen = [new echarts.graphic.LinearGradient(
|
|
|
- 0, 0, 0, 1,
|
|
|
- [
|
|
|
- {offset: 1, color: '#2ABED1'},
|
|
|
- {offset: 0.5, color: '#2ABED1'},
|
|
|
- {offset: 0, color: '#8DE0EB'}
|
|
|
- ], false
|
|
|
- ), '#FF9F40']
|
|
|
+ delimiters: ['${', '}'],
|
|
|
+ el: '#ent-portrait',
|
|
|
+ components: {
|
|
|
+ vipComponent: vipComponent,
|
|
|
+ hisproComponent: hisproComponent
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ // 修改柱状条颜色为渐变色
|
|
|
+ this.colorGreen = [new echarts.graphic.LinearGradient(
|
|
|
+ 0, 0, 0, 1,
|
|
|
+ [
|
|
|
+ { offset: 1, color: '#2ABED1' },
|
|
|
+ { offset: 0.5, color: '#2ABED1' },
|
|
|
+ { offset: 0, color: '#8DE0EB' }
|
|
|
+ ], false
|
|
|
+ ), '#FF9F40']
|
|
|
|
|
|
- return {
|
|
|
- sessKey: '$data-ent_portrait',
|
|
|
- conf: {
|
|
|
- // 权限查询是否完成
|
|
|
- powerLoaded: false,
|
|
|
- // 是否只显示完整的企业画像
|
|
|
- showPortraitAll: true,
|
|
|
- // 是否显示,企业全景分析
|
|
|
- _4: false,
|
|
|
- // 是否显示中标企业动态
|
|
|
- _13: false,
|
|
|
- isMember: 0, // 是否是大会员
|
|
|
- arr: [], // 权限列表
|
|
|
- vipStatus: 0 // 是否是超级订阅
|
|
|
- },
|
|
|
- powerInfo: {},
|
|
|
- tabActiveName: '',
|
|
|
- // 企业信息
|
|
|
- entInfo: {
|
|
|
- name: '',
|
|
|
- follow: 0,
|
|
|
- followSearchFinish: false,
|
|
|
- entExist: true
|
|
|
- },
|
|
|
- // tab1中的企业基础信息
|
|
|
- entBaseInfo: {
|
|
|
- type: null,
|
|
|
- status: null,
|
|
|
- creditNo: '',
|
|
|
- capital: '',
|
|
|
- employeeNo: '',
|
|
|
- address: '',
|
|
|
- scope: '',
|
|
|
- operStart: -1,
|
|
|
- operEnd: -1,
|
|
|
- establish: '',
|
|
|
- showEntChange: false,
|
|
|
- org_code: '',
|
|
|
- company_code: '',
|
|
|
- legal: '',
|
|
|
- phone: '',
|
|
|
- taxCode: ''
|
|
|
- },
|
|
|
- // tab2中的项目动态
|
|
|
- topProject: {
|
|
|
- list: [],
|
|
|
- count: 0, // 总共多少条数据
|
|
|
- pageSize: 3,
|
|
|
- showGetNextButton: true
|
|
|
- },
|
|
|
- entPortraitInfo: {},
|
|
|
- stickyTop: 0,
|
|
|
- singleTab: true,
|
|
|
- // 年度项目统计设置
|
|
|
- annualSetting:{
|
|
|
- showLine: ['项目金额'],
|
|
|
- axisSite: { right: ['项目金额'] }
|
|
|
- },
|
|
|
- // 地图配置项
|
|
|
- mapSettings: mapSettings,
|
|
|
- // 年度项目统计数据
|
|
|
- annualData: {
|
|
|
- columns: ["日期","项目数量","项目金额"],
|
|
|
- rows: []
|
|
|
- },
|
|
|
- // 地图数据
|
|
|
- mapChartData: {
|
|
|
- columns: ['name', 'value'],
|
|
|
- rows: []
|
|
|
- },
|
|
|
- // 月度中标金额
|
|
|
- monthZbData: {
|
|
|
- columns: [],
|
|
|
- rows: []
|
|
|
- },
|
|
|
- // 平均折扣率
|
|
|
- rateData: {
|
|
|
- columns: [],
|
|
|
- rows: []
|
|
|
- },
|
|
|
- pieChartSettings: {
|
|
|
- roseType: 'radius'
|
|
|
- },
|
|
|
- importantCustomers: [],
|
|
|
- scrollTop: 0,
|
|
|
- getEntPortraitInfoTimes: 0,
|
|
|
- initEchartsOptions: {
|
|
|
- renderer: 'svg'
|
|
|
- },
|
|
|
- gotTab2: false, // 是否已经获取到tab2的数据了
|
|
|
- svip: false, // 判断是否是超级订阅的企业画像
|
|
|
- overlayShow: true, // 弹窗遮罩是否显示
|
|
|
- isVip: false, // 只是超级订阅
|
|
|
- bidcollPowerInfo: {
|
|
|
- vip: 0,
|
|
|
- text: '开通',
|
|
|
- btntext: '去开通'
|
|
|
- },
|
|
|
- entvisit: {
|
|
|
- total: 0, // 本月画像次数总量
|
|
|
- usage: 0, // 本月已使用次数
|
|
|
- provin: 0, // 购买省份数量
|
|
|
- visited: false // 是否查看中标信息
|
|
|
- },
|
|
|
- portrait:'winner',
|
|
|
- showBaseInfo: false
|
|
|
- }
|
|
|
- },
|
|
|
- created: function () {
|
|
|
- // svip是超级订阅企业查询, 如果是超级订阅不能查看企业情报历史记录
|
|
|
- var svip = utils.getParam('svip')
|
|
|
- if (svip) {
|
|
|
- this.svip = true
|
|
|
- }
|
|
|
- // 企业名称恢复
|
|
|
- var eId = utils.getParam('eId')
|
|
|
- if (eId) {
|
|
|
- eId = decodeURIComponent(eId)
|
|
|
- }
|
|
|
- this.entInfo.id = eId
|
|
|
- this.entInfo.name = ''
|
|
|
- this.restore = this.reStoreState()
|
|
|
- this.getEntVisits()
|
|
|
- this.getPowerInfo()
|
|
|
- if (!this.restore) {
|
|
|
- // 获取企业基本信息
|
|
|
- this.getEntBaseInfo()
|
|
|
- }
|
|
|
- var storageId = sessionStorage.getItem('winner_high_eid')
|
|
|
- // 判断如果url中的企业id和高级分析设置中存的企业id不一致就清除高级分析设置中存的筛选条件
|
|
|
- if (storageId && storageId !== eId) {
|
|
|
- sessionStorage.removeItem('winner_high_set')
|
|
|
- sessionStorage.removeItem('winner_high_eid')
|
|
|
- }
|
|
|
+ return {
|
|
|
+ sessKey: '$data-ent_portrait',
|
|
|
+ conf: {
|
|
|
+ // 权限查询是否完成
|
|
|
+ powerLoaded: false,
|
|
|
+ // 是否只显示完整的企业画像
|
|
|
+ showPortraitAll: true,
|
|
|
+ // 是否显示,企业全景分析
|
|
|
+ _4: false,
|
|
|
+ // 是否显示中标企业动态
|
|
|
+ _13: false,
|
|
|
+ isMember: 0, // 是否是大会员
|
|
|
+ arr: [], // 权限列表
|
|
|
+ vipStatus: 0 // 是否是超级订阅
|
|
|
+ },
|
|
|
+ powerInfo: {},
|
|
|
+ tabActiveName: '',
|
|
|
+ // 企业信息
|
|
|
+ entInfo: {
|
|
|
+ name: '',
|
|
|
+ follow: 0,
|
|
|
+ followSearchFinish: false,
|
|
|
+ entExist: true
|
|
|
+ },
|
|
|
+ // tab1中的企业基础信息
|
|
|
+ entBaseInfo: {
|
|
|
+ type: null,
|
|
|
+ status: null,
|
|
|
+ creditNo: '',
|
|
|
+ capital: '',
|
|
|
+ employeeNo: '',
|
|
|
+ address: '',
|
|
|
+ scope: '',
|
|
|
+ operStart: -1,
|
|
|
+ operEnd: -1,
|
|
|
+ establish: '',
|
|
|
+ showEntChange: false,
|
|
|
+ org_code: '',
|
|
|
+ company_code: '',
|
|
|
+ legal: '',
|
|
|
+ phone: '',
|
|
|
+ taxCode: ''
|
|
|
+ },
|
|
|
+ // tab2中的项目动态
|
|
|
+ topProject: {
|
|
|
+ list: [],
|
|
|
+ count: 0, // 总共多少条数据
|
|
|
+ pageSize: 3,
|
|
|
+ showGetNextButton: true
|
|
|
+ },
|
|
|
+ entPortraitInfo: {},
|
|
|
+ stickyTop: 0,
|
|
|
+ singleTab: true,
|
|
|
+ // 年度项目统计设置
|
|
|
+ annualSetting: {
|
|
|
+ showLine: ['项目金额'],
|
|
|
+ axisSite: { right: ['项目金额'] }
|
|
|
+ },
|
|
|
+ // 地图配置项
|
|
|
+ mapSettings: mapSettings,
|
|
|
+ // 年度项目统计数据
|
|
|
+ annualData: {
|
|
|
+ columns: ["日期", "项目数量", "项目金额"],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 地图数据
|
|
|
+ mapChartData: {
|
|
|
+ columns: ['name', 'value'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 月度中标金额
|
|
|
+ monthZbData: {
|
|
|
+ columns: [],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 平均折扣率
|
|
|
+ rateData: {
|
|
|
+ columns: [],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ pieChartSettings: {
|
|
|
+ roseType: 'radius'
|
|
|
+ },
|
|
|
+ importantCustomers: [],
|
|
|
+ scrollTop: 0,
|
|
|
+ getEntPortraitInfoTimes: 0,
|
|
|
+ initEchartsOptions: {
|
|
|
+ renderer: 'svg'
|
|
|
+ },
|
|
|
+ gotTab2: false, // 是否已经获取到tab2的数据了
|
|
|
+ svip: false, // 判断是否是超级订阅的企业画像
|
|
|
+ overlayShow: true, // 弹窗遮罩是否显示
|
|
|
+ isVip: false, // 只是超级订阅
|
|
|
+ bidcollPowerInfo: {
|
|
|
+ vip: 0,
|
|
|
+ text: '开通',
|
|
|
+ btntext: '去开通'
|
|
|
+ },
|
|
|
+ entvisit: {
|
|
|
+ total: 0, // 本月画像次数总量
|
|
|
+ usage: 0, // 本月已使用次数
|
|
|
+ provin: 0, // 购买省份数量
|
|
|
+ visited: false // 是否查看中标信息
|
|
|
+ },
|
|
|
+ portrait: 'winner',
|
|
|
+ showBaseInfo: false,
|
|
|
+ show: {
|
|
|
+ yearData: true,
|
|
|
+ monthData: true,
|
|
|
+ areaData: true,
|
|
|
+ rate: true,
|
|
|
+ top10: true,
|
|
|
+ topShow: true,
|
|
|
+ dt: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+ // svip是超级订阅企业查询, 如果是超级订阅不能查看企业情报历史记录
|
|
|
+ var svip = utils.getParam('svip')
|
|
|
+ if (svip) {
|
|
|
+ this.svip = true
|
|
|
+ }
|
|
|
+ // 企业名称恢复
|
|
|
+ var eId = utils.getParam('eId')
|
|
|
+ if (eId) {
|
|
|
+ eId = decodeURIComponent(eId)
|
|
|
+ }
|
|
|
+ this.entInfo.id = eId
|
|
|
+ this.entInfo.name = ''
|
|
|
+ this.restore = this.reStoreState()
|
|
|
+ this.getEntVisits()
|
|
|
+ this.getPowerInfo()
|
|
|
+ if (!this.restore) {
|
|
|
+ // 获取企业基本信息
|
|
|
+ this.getEntBaseInfo()
|
|
|
+ }
|
|
|
+ var storageId = sessionStorage.getItem('winner_high_eid')
|
|
|
+ // 判断如果url中的企业id和高级分析设置中存的企业id不一致就清除高级分析设置中存的筛选条件
|
|
|
+ if (storageId && storageId !== eId) {
|
|
|
+ sessionStorage.removeItem('winner_high_set')
|
|
|
+ sessionStorage.removeItem('winner_high_eid')
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- mounted: function () {
|
|
|
- var _this = this
|
|
|
- // 动态调整sticky距离顶部的高度
|
|
|
- this.getStickyTop()
|
|
|
- if (this.scrollTop) {
|
|
|
- setTimeout(function () {
|
|
|
- $('#ent-portrait').scrollTop(_this.scrollTop)
|
|
|
- }, 0)
|
|
|
- }
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ var _this = this
|
|
|
+ // 动态调整sticky距离顶部的高度
|
|
|
+ this.getStickyTop()
|
|
|
+ if (this.scrollTop) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $('#ent-portrait').scrollTop(_this.scrollTop)
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
|
|
|
- window.addEventListener('resize', function() {
|
|
|
- _this.getStickyTop()
|
|
|
- })
|
|
|
- },
|
|
|
- watch: {
|
|
|
- tabActiveName: function (newVal, oldVal) {
|
|
|
- var _this = this
|
|
|
- if (newVal == '2') {
|
|
|
- this.$nextTick(function () {
|
|
|
- if (_this.gotTab2) {
|
|
|
- // 初始化图表
|
|
|
- if (_this.entPortraitInfo && _this.conf.showPortraitAll && !_this.singleTab) {
|
|
|
- _this.initChartsData();
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (_this.conf._4) {
|
|
|
- // 获取企业画像信息-4
|
|
|
- _this.getEntPortrait(function () {
|
|
|
- _this.initChartsData()
|
|
|
- })
|
|
|
- _this.gotTab2 = true
|
|
|
- console.log('获取企业全景分析...')
|
|
|
- }
|
|
|
- // 获取企业中标动态-13
|
|
|
- if (_this.conf._13) {
|
|
|
- _this.getProjectNews()
|
|
|
- _this.gotTab2 = true
|
|
|
- console.log('获取企业中标动态...')
|
|
|
- }
|
|
|
- if(_this.powerInfo.memberStatus <= 0) {
|
|
|
- // 不是大会员点击中标信息使用次数加一
|
|
|
- // if(!_this.entvisit.visited) {
|
|
|
- // _this.entvisit.usage++
|
|
|
- // _this.entvisit.visited = true
|
|
|
- // }
|
|
|
- }
|
|
|
- _this.gotTab2 = true
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 3个权限有1个就为true(取反为3个权限1个都没有)
|
|
|
- hasOnePower: function () {
|
|
|
- return this.conf._4 || this.conf._12 || this.conf._13
|
|
|
- },
|
|
|
- setShow: function() {
|
|
|
- // 必须在tab2,并且三个权限都没有,就用显示
|
|
|
- return this.tabActiveName == '2' && !this.hasOnePower
|
|
|
- },
|
|
|
- // 查看次数为零,显示遮罩
|
|
|
- getStatus: function () {
|
|
|
- return (!this.conf._4 && !this.isVip) || (this.entvisit.total <= this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited) || (this.entvisit.total <= this.entvisit.usage && !this.showContacts && !this.entvisit.visited)
|
|
|
- },
|
|
|
- isMember () {
|
|
|
- return this.powerInfo.memberStatus <= 0 || !this.conf._4
|
|
|
- },
|
|
|
- isShowUpTip () {
|
|
|
- return this.entvisit.provin == -1 ? false : true && !this.surplus && this.isVip && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited
|
|
|
- },
|
|
|
- surplus: function () {
|
|
|
- return this.entvisit.total > this.entvisit.usage
|
|
|
- },
|
|
|
- showContacts: function () {
|
|
|
- return this.conf.arr.indexOf(4) > -1 && this.powerInfo.memberStatus > 0
|
|
|
- },
|
|
|
- // 是否展示升级提示 是新超级订阅用户且购买的不是全国且浏览次数已用完
|
|
|
- showUpdateTip: function() {
|
|
|
- return this.isVip && this.entvisit.provin !== -1 && !this.surplus && this.conf._4 && this.powerInfo.memberStatus <= 0
|
|
|
- },
|
|
|
- // 是否隐藏动态 显示遮罩
|
|
|
- hideDt: function() {
|
|
|
- // 是新超级订阅 且不是大会员且次数已用完 或大会员没有项目动态权限
|
|
|
- return this.isVip && this.powerInfo.memberStatus <= 0 && this.entvisit.total <= this.entvisit.usage || this.conf.arr.indexOf(13) === -1
|
|
|
- },
|
|
|
- isMemberAndSvip: function () {
|
|
|
- return this.powerInfo.memberStatus > 0 || this.powerInfo.vipStatus > 0
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getDataFn: function () {
|
|
|
- var _this = this
|
|
|
- this.$nextTick(function () {
|
|
|
+ window.addEventListener('resize', function () {
|
|
|
+ _this.getStickyTop()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ tabActiveName: function (newVal, oldVal) {
|
|
|
+ var _this = this
|
|
|
+ if (newVal == '2') {
|
|
|
+ this.$nextTick(function () {
|
|
|
+ if (_this.gotTab2) {
|
|
|
// 初始化图表
|
|
|
- if (_this.entPortraitInfo && _this.conf.showPortraitAll) {
|
|
|
+ if (_this.entPortraitInfo && _this.conf.showPortraitAll && !_this.singleTab) {
|
|
|
_this.initChartsData();
|
|
|
}
|
|
|
-
|
|
|
+ } else {
|
|
|
if (_this.conf._4) {
|
|
|
// 获取企业画像信息-4
|
|
|
_this.getEntPortrait(function () {
|
|
@@ -273,857 +208,961 @@ var vNode = {
|
|
|
// }
|
|
|
}
|
|
|
_this.gotTab2 = true
|
|
|
-
|
|
|
- });
|
|
|
- },
|
|
|
- // 点击去开通记住tab栏下标
|
|
|
- tabActive: function(data) {
|
|
|
- this.savePageState()
|
|
|
- },
|
|
|
- showToast: function (message) {
|
|
|
- this.$toast({
|
|
|
- duration: 1500,
|
|
|
- forbidClick: true,
|
|
|
- message: message,
|
|
|
- })
|
|
|
- },
|
|
|
- showLoading: function() {
|
|
|
- var loading = this.$toast.loading({
|
|
|
- duration: 0,
|
|
|
- forbidClick: true,
|
|
|
- message: '',
|
|
|
- })
|
|
|
- return loading
|
|
|
- },
|
|
|
- // 超级订阅提示弹窗取消按钮事件
|
|
|
- beforeClose: function (e, done) {
|
|
|
- console.log(e)
|
|
|
- if (e === 'cancel') {
|
|
|
- this.tabActiveName = '1'
|
|
|
- done(false)
|
|
|
- this.overlayShow = true
|
|
|
- } else if (e === 'confirm') {
|
|
|
- var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
- try {
|
|
|
- _hmt.push(['_trackEvent','超级订阅-' + (isWeiXinBrowser ? 'wx' : 'app'), 'click', '企业画像中标信息-去开通']);
|
|
|
- } catch (e) {
|
|
|
- console.log('未初始化百度统计')
|
|
|
- }
|
|
|
- // 去开通
|
|
|
- if(this.bidcollPowerInfo.vip == 1) {
|
|
|
- location.href = '/front/vipsubscribe/upgradePage'
|
|
|
- } else {
|
|
|
- location.href = "/front/vipsubscribe/vipsubscribe_new"
|
|
|
- }
|
|
|
- }
|
|
|
- this.overlayShow = true
|
|
|
- },
|
|
|
- // 获取画像信息
|
|
|
- getEntPortrait: function (callback) {
|
|
|
- var storageSet = JSON.parse(sessionStorage.getItem('winner_high_set'))
|
|
|
- // if (!storageSet) return
|
|
|
- var _this = this
|
|
|
- var data = {
|
|
|
- entId: _this.entInfo.id
|
|
|
- }
|
|
|
- let urls = ''
|
|
|
- // 如果专家版、智慧版 调大会员接口,如果是专家版、自定义版,同时是超级订阅 根据可查看次数判断 调大会员还是超级订阅接口
|
|
|
- if (_this.powerInfo.memberStatus > 0 && _this.powerInfo.memberStatus <= 2) {
|
|
|
- urls = '/bigmember/portrait/winner/getData'
|
|
|
- } else if (_this.powerInfo.memberStatus > 2) {
|
|
|
- if ( _this.isVip) { // 超级订阅
|
|
|
- if(_this.entvisit.total <= _this.entvisit.usage && !_this.entvisit.visited) {
|
|
|
- urls = '/bigmember/portrait/winner/getData'
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/subVipPortrait/winner'
|
|
|
- }
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/winner/getData'
|
|
|
- // 商机版、自定义版
|
|
|
- }
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/subVipPortrait/winner'
|
|
|
- }
|
|
|
- _this.getEntPortraitInfoTimes++
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: urls,
|
|
|
- data: storageSet ? Object.assign(data, storageSet) : data,
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- _this.loading.clear()
|
|
|
- if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
- _this.singleTab = false
|
|
|
- // 将数据保存到data中
|
|
|
- for (var key in res.data) {
|
|
|
- _this.entPortraitInfo[key] = res.data[key]
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 3个权限有1个就为true(取反为3个权限1个都没有)
|
|
|
+ hasOnePower: function () {
|
|
|
+ return this.conf._4 || this.conf._12 || this.conf._13
|
|
|
+ },
|
|
|
+ setShow: function () {
|
|
|
+ // 必须在tab2,并且三个权限都没有,就用显示
|
|
|
+ return this.tabActiveName == '2' && !this.hasOnePower
|
|
|
+ },
|
|
|
+ // 查看次数为零,显示遮罩
|
|
|
+ getStatus: function () {
|
|
|
+ return (!this.conf._4 && !this.isVip) || (this.entvisit.total <= this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited) || (this.entvisit.total <= this.entvisit.usage && !this.showContacts && !this.entvisit.visited)
|
|
|
+ },
|
|
|
+ isMember () {
|
|
|
+ return this.powerInfo.memberStatus <= 0 || !this.conf._4
|
|
|
+ },
|
|
|
+ isShowUpTip () {
|
|
|
+ return this.entvisit.provin == -1 ? false : true && !this.surplus && this.isVip && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited
|
|
|
+ },
|
|
|
+ surplus: function () {
|
|
|
+ return this.entvisit.total > this.entvisit.usage
|
|
|
+ },
|
|
|
+ showContacts: function () {
|
|
|
+ return this.conf.arr.indexOf(4) > -1 && this.powerInfo.memberStatus > 0
|
|
|
+ },
|
|
|
+ // 是否展示升级提示 是新超级订阅用户且购买的不是全国且浏览次数已用完
|
|
|
+ showUpdateTip: function () {
|
|
|
+ return this.isVip && this.entvisit.provin !== -1 && !this.surplus && this.conf._4 && this.powerInfo.memberStatus <= 0
|
|
|
+ },
|
|
|
+ // 是否隐藏动态 显示遮罩
|
|
|
+ hideDt: function () {
|
|
|
+ // 是新超级订阅 且不是大会员且次数已用完 或大会员没有项目动态权限
|
|
|
+ return this.isVip && this.powerInfo.memberStatus <= 0 && this.entvisit.total <= this.entvisit.usage || this.conf.arr.indexOf(13) === -1
|
|
|
+ },
|
|
|
+ isMemberAndSvip: function () {
|
|
|
+ return this.powerInfo.memberStatus > 0 || this.powerInfo.vipStatus > 0
|
|
|
+ },
|
|
|
+ allNot: function () {
|
|
|
+ var data = this.show
|
|
|
+ var arr = []
|
|
|
+ for (var key in data) {
|
|
|
+ arr.push(data[key])
|
|
|
+ }
|
|
|
+ var isShow = arr.some(function (item) {
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ return !isShow
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getDataFn: function () {
|
|
|
+ var _this = this
|
|
|
+ this.$nextTick(function () {
|
|
|
+ // 初始化图表
|
|
|
+ if (_this.entPortraitInfo && _this.conf.showPortraitAll) {
|
|
|
+ _this.initChartsData();
|
|
|
+ }
|
|
|
|
|
|
- if (res.data.timeRange && res.data.timeRange.start) {
|
|
|
- _this.entPortraitInfo.timeRangeStart = res.data.timeRange.start
|
|
|
- }
|
|
|
- if (res.data.timeRange && res.data.timeRange.end) {
|
|
|
- _this.entPortraitInfo.timeRangeEnd = res.data.timeRange.end
|
|
|
- }
|
|
|
+ if (_this.conf._4) {
|
|
|
+ // 获取企业画像信息-4
|
|
|
+ _this.getEntPortrait(function () {
|
|
|
+ _this.initChartsData()
|
|
|
+ })
|
|
|
+ _this.gotTab2 = true
|
|
|
+ console.log('获取企业全景分析...')
|
|
|
+ }
|
|
|
+ // 获取企业中标动态-13
|
|
|
+ if (_this.conf._13) {
|
|
|
+ _this.getProjectNews()
|
|
|
+ _this.gotTab2 = true
|
|
|
+ console.log('获取企业中标动态...')
|
|
|
+ }
|
|
|
+ if (_this.powerInfo.memberStatus <= 0) {
|
|
|
+ // 不是大会员点击中标信息使用次数加一
|
|
|
+ // if(!_this.entvisit.visited) {
|
|
|
+ // _this.entvisit.usage++
|
|
|
+ // _this.entvisit.visited = true
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ _this.gotTab2 = true
|
|
|
|
|
|
- callback && callback()
|
|
|
- } else {
|
|
|
- if (_this.getEntPortraitInfoTimes < 5) {
|
|
|
- _this.getEntPortrait()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- _this.$toast('请求失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 企业画像访问量查询
|
|
|
- getEntVisits: function() {
|
|
|
- let _this = this
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: "/bigmember/portrait/subVipPortrait/usage",
|
|
|
- data: {
|
|
|
- entId: _this.entInfo.id
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- console.log(res)
|
|
|
- if(res.error_code == 0) {
|
|
|
- if(res.data) {
|
|
|
- _this.entvisit = res.data
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- getProjectNewsUrl: function () {
|
|
|
- var _this = this
|
|
|
- var urls = ''
|
|
|
- // 判断专家版、智慧版; 商机版和自定义版时判断是不是超级订阅
|
|
|
- if (_this.powerInfo.memberStatus > 0 && _this.powerInfo.memberStatus <= 2) {
|
|
|
- urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
- } else if (_this.powerInfo.memberStatus > 2) {
|
|
|
- if (_this.isVip) {
|
|
|
- if (_this.entvisit.total <= _this.entvisit.usage && !_this.entvisit.visited) {
|
|
|
- urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/subVipPortrait/winnerNewMsg'
|
|
|
- }
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 点击去开通记住tab栏下标
|
|
|
+ tabActive: function (data) {
|
|
|
+ this.savePageState()
|
|
|
+ },
|
|
|
+ showToast: function (message) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 1500,
|
|
|
+ forbidClick: true,
|
|
|
+ message: message,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showLoading: function () {
|
|
|
+ var loading = this.$toast.loading({
|
|
|
+ duration: 0,
|
|
|
+ forbidClick: true,
|
|
|
+ message: '',
|
|
|
+ })
|
|
|
+ return loading
|
|
|
+ },
|
|
|
+ // 超级订阅提示弹窗取消按钮事件
|
|
|
+ beforeClose: function (e, done) {
|
|
|
+ console.log(e)
|
|
|
+ if (e === 'cancel') {
|
|
|
+ this.tabActiveName = '1'
|
|
|
+ done(false)
|
|
|
+ this.overlayShow = true
|
|
|
+ } else if (e === 'confirm') {
|
|
|
+ var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
+ try {
|
|
|
+ _hmt.push(['_trackEvent', '超级订阅-' + (isWeiXinBrowser ? 'wx' : 'app'), 'click', '企业画像中标信息-去开通']);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('未初始化百度统计')
|
|
|
+ }
|
|
|
+ // 去开通
|
|
|
+ if (this.bidcollPowerInfo.vip == 1) {
|
|
|
+ location.href = '/front/vipsubscribe/upgradePage'
|
|
|
+ } else {
|
|
|
+ location.href = "/front/vipsubscribe/vipsubscribe_new"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.overlayShow = true
|
|
|
+ },
|
|
|
+ // 获取画像信息
|
|
|
+ getEntPortrait: function (callback) {
|
|
|
+ var storageSet = JSON.parse(sessionStorage.getItem('winner_high_set'))
|
|
|
+ // if (!storageSet) return
|
|
|
+ var _this = this
|
|
|
+ var data = {
|
|
|
+ entId: _this.entInfo.id
|
|
|
+ }
|
|
|
+ let urls = ''
|
|
|
+ // 如果专家版、智慧版 调大会员接口,如果是专家版、自定义版,同时是超级订阅 根据可查看次数判断 调大会员还是超级订阅接口
|
|
|
+ if (_this.powerInfo.memberStatus > 0 && _this.powerInfo.memberStatus <= 2) {
|
|
|
+ urls = '/bigmember/portrait/winner/getData'
|
|
|
+ } else if (_this.powerInfo.memberStatus > 2) {
|
|
|
+ if (_this.isVip) { // 超级订阅
|
|
|
+ if (_this.entvisit.total <= _this.entvisit.usage && !_this.entvisit.visited) {
|
|
|
+ urls = '/bigmember/portrait/winner/getData'
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/subVipPortrait/winner'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/winner/getData'
|
|
|
+ // 商机版、自定义版
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/subVipPortrait/winner'
|
|
|
+ }
|
|
|
+ _this.getEntPortraitInfoTimes++
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: urls,
|
|
|
+ data: storageSet ? Object.assign(data, storageSet) : data,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ _this.loading.clear()
|
|
|
+ if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
+ _this.singleTab = false
|
|
|
+ // 将数据保存到data中
|
|
|
+ for (var key in res.data) {
|
|
|
+ _this.entPortraitInfo[key] = res.data[key]
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.data.timeRange && res.data.timeRange.start) {
|
|
|
+ _this.entPortraitInfo.timeRangeStart = res.data.timeRange.start
|
|
|
+ }
|
|
|
+ if (res.data.timeRange && res.data.timeRange.end) {
|
|
|
+ _this.entPortraitInfo.timeRangeEnd = res.data.timeRange.end
|
|
|
}
|
|
|
+
|
|
|
+ callback && callback()
|
|
|
} else {
|
|
|
- urls = '/bigmember/portrait/subVipPortrait/winnerNewMsg'
|
|
|
+ if (_this.getEntPortraitInfoTimes < 5) {
|
|
|
+ _this.getEntPortrait()
|
|
|
+ }
|
|
|
}
|
|
|
- return urls
|
|
|
- },
|
|
|
- // 获取项目动态
|
|
|
- getProjectNews: function () {
|
|
|
- var storageSet = JSON.parse(sessionStorage.getItem('winner_high_set'))
|
|
|
- // if (!storageSet) return
|
|
|
- var _this = this
|
|
|
- var data = {
|
|
|
- entId: _this.entInfo.id,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: _this.topProject.pageSize
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (error) {
|
|
|
+ _this.$toast('请求失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 企业画像访问量查询
|
|
|
+ getEntVisits: function () {
|
|
|
+ let _this = this
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "/bigmember/portrait/subVipPortrait/usage",
|
|
|
+ data: {
|
|
|
+ entId: _this.entInfo.id
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ if (res.data) {
|
|
|
+ _this.entvisit = res.data
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getProjectNewsUrl: function () {
|
|
|
+ var _this = this
|
|
|
+ var urls = ''
|
|
|
+ // 判断专家版、智慧版; 商机版和自定义版时判断是不是超级订阅
|
|
|
+ if (_this.powerInfo.memberStatus > 0 && _this.powerInfo.memberStatus <= 2) {
|
|
|
+ urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
+ } else if (_this.powerInfo.memberStatus > 2) {
|
|
|
+ if (_this.isVip) {
|
|
|
+ if (_this.entvisit.total <= _this.entvisit.usage && !_this.entvisit.visited) {
|
|
|
+ urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/subVipPortrait/winnerNewMsg'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/winner/getNewMsg'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/subVipPortrait/winnerNewMsg'
|
|
|
+ }
|
|
|
+ return urls
|
|
|
+ },
|
|
|
+ // 获取项目动态
|
|
|
+ getProjectNews: function () {
|
|
|
+ var storageSet = JSON.parse(sessionStorage.getItem('winner_high_set'))
|
|
|
+ // if (!storageSet) return
|
|
|
+ var _this = this
|
|
|
+ var data = {
|
|
|
+ entId: _this.entInfo.id,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: _this.topProject.pageSize
|
|
|
+ }
|
|
|
|
|
|
- this.loading = this.showLoading()
|
|
|
+ this.loading = this.showLoading()
|
|
|
|
|
|
- var urls = this.getProjectNewsUrl()
|
|
|
+ var urls = this.getProjectNewsUrl()
|
|
|
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: urls,
|
|
|
- data: storageSet ? Object.assign(data, storageSet) : data,
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- _this.loading.clear()
|
|
|
- _this.topProject.count = res.data.count
|
|
|
- if (res.data.list && $.isArray(res.data.list)) {
|
|
|
- _this.singleTab = false
|
|
|
- _this.topProject.list = res.data.list
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.$toast(res.error_msg)
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- _this.$toast('请求失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 去中标单位画像
|
|
|
- toUnitPortrayal: function (item) {
|
|
|
- this.savePageState()
|
|
|
- if (item.name) {
|
|
|
- location.href = '/big/wx/page/unit_portrayal?entName=' + item.name
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: urls,
|
|
|
+ data: storageSet ? Object.assign(data, storageSet) : data,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ _this.loading.clear()
|
|
|
+ _this.topProject.count = res.data.count
|
|
|
+ if (!res.data.list || res.data.list.length == 0) {
|
|
|
+ // 新加变量 判断中标动态有无数据 用于展示缺省页组件
|
|
|
+ _this.show.dt = false
|
|
|
}
|
|
|
+ if (res.data.list && $.isArray(res.data.list)) {
|
|
|
+ _this.singleTab = false
|
|
|
+ _this.topProject.list = res.data.list
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
},
|
|
|
- // 查询企业基础信息
|
|
|
- getEntBaseInfo: function () {
|
|
|
- var _this = this
|
|
|
- let urls = ''
|
|
|
- if(_this.powerInfo.memberStatus <= 0 || _this.svip) {
|
|
|
- urls = '/bigmember/portrait/subVipPortrait/entDetail'
|
|
|
- } else {
|
|
|
- urls = '/bigmember/portrait/ent/detail'
|
|
|
+ error: function (error) {
|
|
|
+ _this.$toast('请求失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 去中标单位画像
|
|
|
+ toUnitPortrayal: function (item) {
|
|
|
+ this.savePageState()
|
|
|
+ if (item.name) {
|
|
|
+ location.href = '/big/wx/page/unit_portrayal?entName=' + item.name
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询企业基础信息
|
|
|
+ getEntBaseInfo: function () {
|
|
|
+ var _this = this
|
|
|
+ let urls = ''
|
|
|
+ if (_this.powerInfo.memberStatus <= 0 || _this.svip) {
|
|
|
+ urls = '/bigmember/portrait/subVipPortrait/entDetail'
|
|
|
+ } else {
|
|
|
+ urls = '/bigmember/portrait/ent/detail'
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: urls,
|
|
|
+ data: {
|
|
|
+ entId: _this.entInfo.id
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ _this.loading.clear()
|
|
|
+ if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
+ _this.entInfo.name = res.data.entName
|
|
|
+ for (var key in res.data) {
|
|
|
+ _this.entBaseInfo[key] = res.data[key]
|
|
|
+ }
|
|
|
}
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: urls,
|
|
|
- data: {
|
|
|
- entId: _this.entInfo.id
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- _this.loading.clear()
|
|
|
- if (res.data && Object.keys(res.data).length !== 0) {
|
|
|
- _this.entInfo.name = res.data.entName
|
|
|
- for (var key in res.data) {
|
|
|
- _this.entBaseInfo[key] = res.data[key]
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 不显示提示信息
|
|
|
- // _this.$toast(res.error_msg)
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ // 不显示提示信息
|
|
|
+ // _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
},
|
|
|
- // 查询企业是否存在和企业关注状态
|
|
|
- getEntFollowState: function () {
|
|
|
- var _this = this
|
|
|
- _this.entInfo.followSearchFinish = false
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: '/bigmember/follow/ent/followCheck',
|
|
|
- data: {
|
|
|
- entId: _this.entInfo.id
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- _this.entInfo.followSearchFinish = true
|
|
|
- if (res.data) {
|
|
|
- _this.entInfo.follow = !!res.data.followed
|
|
|
- _this.entInfo.entExist = !!res.data.isShow
|
|
|
- } else {
|
|
|
- _this.entInfo.entExist = false
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.$toast(res.error_msg)
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- })
|
|
|
+ error: function (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询企业是否存在和企业关注状态
|
|
|
+ getEntFollowState: function () {
|
|
|
+ var _this = this
|
|
|
+ _this.entInfo.followSearchFinish = false
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: '/bigmember/follow/ent/followCheck',
|
|
|
+ data: {
|
|
|
+ entId: _this.entInfo.id
|
|
|
},
|
|
|
- changeFollowState: function () {
|
|
|
- var _this = this
|
|
|
- if (this.entInfo.follow) {
|
|
|
- this.$dialog.confirm({
|
|
|
- title: '提示信息',
|
|
|
- message: '取消对“' + _this.entInfo.name + '”的关注?',
|
|
|
- confirmButtonColor: '#2cb7ca'
|
|
|
- }).then(function () {
|
|
|
- _this.changeFollowStateRequest()
|
|
|
- })
|
|
|
- .catch(function () {
|
|
|
- console.log('取消操作')
|
|
|
- })
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ _this.entInfo.followSearchFinish = true
|
|
|
+ if (res.data) {
|
|
|
+ _this.entInfo.follow = !!res.data.followed
|
|
|
+ _this.entInfo.entExist = !!res.data.isShow
|
|
|
} else {
|
|
|
- this.changeFollowStateRequest()
|
|
|
+ _this.entInfo.entExist = false
|
|
|
}
|
|
|
+ } else {
|
|
|
+ _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
},
|
|
|
- // 获取权限信息
|
|
|
- getPowerInfo: function () {
|
|
|
- var _this = this
|
|
|
- this.loading = this.showLoading()
|
|
|
- $.ajax({
|
|
|
- type: 'GET',
|
|
|
- url: '/bigmember/use/isAdd',
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- _this.conf.powerLoaded = true
|
|
|
- if (res.data) {
|
|
|
- _this.powerInfo = res.data
|
|
|
- }
|
|
|
- if (res.data && $.isArray(res.data.power)) {
|
|
|
- // 显示完整企业画像(不完整的企业画像只有中标动态)
|
|
|
- // _this.conf.showPortraitAll = true
|
|
|
- // 根据power判断权限,企业画像包含权限(4,12,13)
|
|
|
- var power = res.data.power
|
|
|
- if (res.data.viper) {
|
|
|
- _this.isVip = true
|
|
|
- }
|
|
|
- if (power.indexOf(4) != -1 || res.data.viper) {
|
|
|
- // 获取企业画像信息-4
|
|
|
- _this.conf._4 = true
|
|
|
- }
|
|
|
- if (power.indexOf(13) != -1 || res.data.viper) {
|
|
|
- // 获取企业中标动态-13
|
|
|
- _this.conf._13 = true
|
|
|
- }
|
|
|
- if (power.indexOf(12) != -1) {
|
|
|
- // 获取企业情报历史记录-12
|
|
|
- _this.conf._12 = true
|
|
|
- }
|
|
|
- // follow的权限:4.12.13只要有一个就可以
|
|
|
- if (res.data.memberStatus > 0 && (power.indexOf(4) != -1||power.indexOf(12) != -1||power.indexOf(13) != -1)) {
|
|
|
- _this.getEntFollowState()
|
|
|
- } else {
|
|
|
- _this.entInfo.followSearchFinish = true
|
|
|
- _this.entInfo.entExist = false
|
|
|
- _this.getEntVisits()
|
|
|
- _this.portrait = 'winnerVip'
|
|
|
- }
|
|
|
- _this.singleTab = false
|
|
|
- }
|
|
|
-
|
|
|
- if (res.data.vipStatus > 0) {
|
|
|
- if (!res.data.viper) {
|
|
|
- _this.bidcollPowerInfo.text = '升级'
|
|
|
- _this.bidcollPowerInfo.btntext = '去升级'
|
|
|
- _this.bidcollPowerInfo.vip = 1
|
|
|
- }
|
|
|
- }
|
|
|
- _this.conf.isMember = res.data.memberStatus
|
|
|
- _this.conf.arr = res.data.power
|
|
|
- _this.conf.vipStatus = res.data.memberStatus
|
|
|
- _this.getDataFn()
|
|
|
- } else {
|
|
|
- _this.$toast(res.error_msg)
|
|
|
- }
|
|
|
- },
|
|
|
- complete: function () {
|
|
|
- if (_this.loading) {
|
|
|
- _this.loading.clear()
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 修改企业关注状态
|
|
|
- changeFollowStateRequest: function () {
|
|
|
- var _this = this
|
|
|
- var loading = this.showLoading()
|
|
|
- var urls = {
|
|
|
- addFollow: '/bigmember/follow/ent/addFollow',
|
|
|
- delFollow: '/bigmember/follow/ent/delFollow'
|
|
|
+ error: function (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeFollowState: function () {
|
|
|
+ var _this = this
|
|
|
+ if (this.entInfo.follow) {
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '提示信息',
|
|
|
+ message: '取消对“' + _this.entInfo.name + '”的关注?',
|
|
|
+ confirmButtonColor: '#2cb7ca'
|
|
|
+ }).then(function () {
|
|
|
+ _this.changeFollowStateRequest()
|
|
|
+ })
|
|
|
+ .catch(function () {
|
|
|
+ console.log('取消操作')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.changeFollowStateRequest()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取权限信息
|
|
|
+ getPowerInfo: function () {
|
|
|
+ var _this = this
|
|
|
+ this.loading = this.showLoading()
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: '/bigmember/use/isAdd',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ _this.conf.powerLoaded = true
|
|
|
+ if (res.data) {
|
|
|
+ _this.powerInfo = res.data
|
|
|
+ }
|
|
|
+ if (res.data && $.isArray(res.data.power)) {
|
|
|
+ // 显示完整企业画像(不完整的企业画像只有中标动态)
|
|
|
+ // _this.conf.showPortraitAll = true
|
|
|
+ // 根据power判断权限,企业画像包含权限(4,12,13)
|
|
|
+ var power = res.data.power
|
|
|
+ if (res.data.viper) {
|
|
|
+ _this.isVip = true
|
|
|
+ }
|
|
|
+ if (power.indexOf(4) != -1 || res.data.viper) {
|
|
|
+ // 获取企业画像信息-4
|
|
|
+ _this.conf._4 = true
|
|
|
+ }
|
|
|
+ if (power.indexOf(13) != -1 || res.data.viper) {
|
|
|
+ // 获取企业中标动态-13
|
|
|
+ _this.conf._13 = true
|
|
|
+ }
|
|
|
+ if (power.indexOf(12) != -1) {
|
|
|
+ // 获取企业情报历史记录-12
|
|
|
+ _this.conf._12 = true
|
|
|
+ }
|
|
|
+ // follow的权限:4.12.13只要有一个就可以
|
|
|
+ if (res.data.memberStatus > 0 && (power.indexOf(4) != -1 || power.indexOf(12) != -1 || power.indexOf(13) != -1)) {
|
|
|
+ _this.getEntFollowState()
|
|
|
+ } else {
|
|
|
+ _this.entInfo.followSearchFinish = true
|
|
|
+ _this.entInfo.entExist = false
|
|
|
+ _this.getEntVisits()
|
|
|
+ _this.portrait = 'winnerVip'
|
|
|
+ }
|
|
|
+ _this.singleTab = false
|
|
|
}
|
|
|
- var url = !!this.entInfo.follow ? urls.delFollow : urls.addFollow
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: url,
|
|
|
- data: {
|
|
|
- entId: _this.entInfo.id
|
|
|
- },
|
|
|
- success: function (res) {
|
|
|
- if (res.error_code == 0) {
|
|
|
- // 清除上个页面缓存
|
|
|
- sessionStorage.removeItem('$data-ent_follow')
|
|
|
- loading.clear()
|
|
|
- if (res.data && res.data == 'success') {
|
|
|
- _this.entInfo.follow = !_this.entInfo.follow
|
|
|
- }
|
|
|
|
|
|
- if (!_this.entInfo.follow) {
|
|
|
- history.back()
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.showToast(res.error_msg)
|
|
|
- }
|
|
|
- },
|
|
|
- error: function (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 初始化图标数据
|
|
|
- initChartsData: function () {
|
|
|
- var dataSet = this.entPortraitInfo
|
|
|
- // 初始化 年度项目统计数据
|
|
|
- this.arrangeAnnualData(dataSet.yearData)
|
|
|
- // 初始化 月度统计数据
|
|
|
- this.arrangeMonthZbData(dataSet.monthData)
|
|
|
- // 初始化 地图数据
|
|
|
- this.arrangeMapData(dataSet.areaData)
|
|
|
- // 初始化 平局折扣率数据
|
|
|
- this.arrangeRateData(dataSet.rate)
|
|
|
- // 初始化 饼图 客户类型分布
|
|
|
- this.initPieChartData(dataSet.top10)
|
|
|
- // 初始化 重要客户数据
|
|
|
- this.arrangeImportantData(dataSet.topShow)
|
|
|
+ if (res.data.vipStatus > 0) {
|
|
|
+ if (!res.data.viper) {
|
|
|
+ _this.bidcollPowerInfo.text = '升级'
|
|
|
+ _this.bidcollPowerInfo.btntext = '去升级'
|
|
|
+ _this.bidcollPowerInfo.vip = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _this.conf.isMember = res.data.memberStatus
|
|
|
+ _this.conf.arr = res.data.power
|
|
|
+ _this.conf.vipStatus = res.data.memberStatus
|
|
|
+ _this.getDataFn()
|
|
|
+ } else {
|
|
|
+ _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
},
|
|
|
- getStickyTop: function () {
|
|
|
- // this.stickyTop = $('.jy-app-header').height() - 1
|
|
|
+ complete: function () {
|
|
|
+ if (_this.loading) {
|
|
|
+ _this.loading.clear()
|
|
|
+ }
|
|
|
},
|
|
|
- goToEntHistory: function () {
|
|
|
- // if (this.powerInfo.isSubCount) {
|
|
|
- // return this.showToast('子账号无法使用企业情报监控')
|
|
|
- // }
|
|
|
-
|
|
|
- this.savePageState()
|
|
|
- var info = {
|
|
|
- anchor: '企业情报监控'
|
|
|
- }
|
|
|
- sessionStorage.setItem('landinfo',JSON.stringify(info))
|
|
|
- location.href = './ent_portrait_change?eId=' + encodeURIComponent(this.entInfo.id)
|
|
|
+ error: function (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 修改企业关注状态
|
|
|
+ changeFollowStateRequest: function () {
|
|
|
+ var _this = this
|
|
|
+ var loading = this.showLoading()
|
|
|
+ var urls = {
|
|
|
+ addFollow: '/bigmember/follow/ent/addFollow',
|
|
|
+ delFollow: '/bigmember/follow/ent/delFollow'
|
|
|
+ }
|
|
|
+ var url = !!this.entInfo.follow ? urls.delFollow : urls.addFollow
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: url,
|
|
|
+ data: {
|
|
|
+ entId: _this.entInfo.id
|
|
|
},
|
|
|
- // 修改年度项目统计里点击浮窗显示效果
|
|
|
- formatter: function (params) {
|
|
|
- //移除重复的数据
|
|
|
- for (var i = 0; i < params.length; i++) {
|
|
|
- for (var j = params.length - 1; j > i; j--) {
|
|
|
- if (params[j].data == params[i].data) {
|
|
|
- params.splice(j, 1);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code == 0) {
|
|
|
+ // 清除上个页面缓存
|
|
|
+ sessionStorage.removeItem('$data-ent_follow')
|
|
|
+ loading.clear()
|
|
|
+ if (res.data && res.data == 'success') {
|
|
|
+ _this.entInfo.follow = !_this.entInfo.follow
|
|
|
}
|
|
|
- var tip = '';
|
|
|
- for (var i = 0; i < params.length; i++) {
|
|
|
- // 因柱状图颜色为渐变色,此处获取到的柱状图颜色,css不能识别,需单独设置小圆点的颜色
|
|
|
- params[0].marker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#2ABED1"></span>'
|
|
|
- if( i=== 0) {
|
|
|
- tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '个' + '<br/>';
|
|
|
- }else if(i == 1){
|
|
|
- tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '万元' + '<br/>';
|
|
|
- }
|
|
|
+
|
|
|
+ if (!_this.entInfo.follow) {
|
|
|
+ history.back()
|
|
|
}
|
|
|
- tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
- return tip;
|
|
|
+ } else {
|
|
|
+ _this.showToast(res.error_msg)
|
|
|
+ }
|
|
|
},
|
|
|
- // 1. 年度项目统计图表单独配置
|
|
|
- annualConfig: function (options) {
|
|
|
- var that = this;
|
|
|
- options.grid.bottom = 60
|
|
|
- options.tooltip.axisPointer.shadowStyle.color = 'rgba(42, 190, 209,0.1)' // 修改点击柱条后背景颜色
|
|
|
- options.legend.show = true // 显示底部数量、金额、圆点
|
|
|
- options.yAxis[1].axisLabel.show = true; // 显示右侧y轴刻度
|
|
|
- options.yAxis[1].axisLabel.formatter = function(value, index) {
|
|
|
- return value.toString().replace(/,/, '')
|
|
|
- } // 去掉右轴逗号分割
|
|
|
- options.series[1].lineStyle.width = 2 // 折线
|
|
|
- options.series[1].lineStyle.color = '#FF9F40'
|
|
|
- // 以下代码为:处理左侧y轴与右侧y轴刻度保持在同一X轴水平线上
|
|
|
- var maxCountList = this.annualData.rows.map(function(v){
|
|
|
- return v['项目数量']
|
|
|
- })
|
|
|
- var maxPriceList = this.annualData.rows.map(function(v){
|
|
|
- return v['项目金额']
|
|
|
- })
|
|
|
+ error: function (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 初始化图标数据
|
|
|
+ initChartsData: function () {
|
|
|
+ var dataSet = this.entPortraitInfo
|
|
|
+ // 初始化 年度项目统计数据
|
|
|
+ this.arrangeAnnualData(dataSet.yearData)
|
|
|
+ // 初始化 月度统计数据
|
|
|
+ this.arrangeMonthZbData(dataSet.monthData)
|
|
|
+ // 初始化 地图数据
|
|
|
+ this.arrangeMapData(dataSet.areaData)
|
|
|
+ // 初始化 平局折扣率数据
|
|
|
+ this.arrangeRateData(dataSet.rate)
|
|
|
+ // 初始化 饼图 客户类型分布
|
|
|
+ this.initPieChartData(dataSet.top10)
|
|
|
+ // 初始化 重要客户数据
|
|
|
+ this.arrangeImportantData(dataSet.topShow)
|
|
|
+ },
|
|
|
+ getStickyTop: function () {
|
|
|
+ // this.stickyTop = $('.jy-app-header').height() - 1
|
|
|
+ },
|
|
|
+ goToEntHistory: function () {
|
|
|
+ // if (this.powerInfo.isSubCount) {
|
|
|
+ // return this.showToast('子账号无法使用企业情报监控')
|
|
|
+ // }
|
|
|
|
|
|
- var maxCount = Math.ceil(Math.max.apply(null,maxCountList)).toString();// 取出数量中最大值
|
|
|
- var maxPrice = Math.ceil(Math.max.apply(null,maxPriceList)).toString();// 取出金额中最大值
|
|
|
- // var minPrice = Math.min.apply(null,maxPriceList);// 去除金额最小值
|
|
|
- maxPrice = Math.ceil(maxPrice / (Math.pow(10,maxPrice.length -1))) * Math.pow(10,maxPrice.length -1)
|
|
|
- maxCount = Math.ceil(maxCount / (Math.pow(10,maxCount.length -1))) * Math.pow(10,maxCount.length -1)
|
|
|
- var item = options.yAxis
|
|
|
- item[0].min = 0;
|
|
|
- item[1].min = 0;
|
|
|
- item[0].max = maxCount;
|
|
|
- item[0].interval = Math.ceil(maxCount / 5);
|
|
|
- item[1].max = maxPrice;
|
|
|
- item[1].interval = Math.ceil((maxPrice - 0) / 5);
|
|
|
+ this.savePageState()
|
|
|
+ var info = {
|
|
|
+ anchor: '企业情报监控'
|
|
|
+ }
|
|
|
+ sessionStorage.setItem('landinfo', JSON.stringify(info))
|
|
|
+ location.href = './ent_portrait_change?eId=' + encodeURIComponent(this.entInfo.id)
|
|
|
+ },
|
|
|
+ // 修改年度项目统计里点击浮窗显示效果
|
|
|
+ formatter: function (params) {
|
|
|
+ //移除重复的数据
|
|
|
+ for (var i = 0; i < params.length; i++) {
|
|
|
+ for (var j = params.length - 1; j > i; j--) {
|
|
|
+ if (params[j].data == params[i].data) {
|
|
|
+ params.splice(j, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var tip = '';
|
|
|
+ for (var i = 0; i < params.length; i++) {
|
|
|
+ // 因柱状图颜色为渐变色,此处获取到的柱状图颜色,css不能识别,需单独设置小圆点的颜色
|
|
|
+ params[0].marker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#2ABED1"></span>'
|
|
|
+ if (i === 0) {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '个' + '<br/>';
|
|
|
+ } else if (i == 1) {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '万元' + '<br/>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
+ return tip;
|
|
|
+ },
|
|
|
+ // 1. 年度项目统计图表单独配置
|
|
|
+ annualConfig: function (options) {
|
|
|
+ var that = this;
|
|
|
+ options.grid.bottom = 60
|
|
|
+ options.tooltip.axisPointer.shadowStyle.color = 'rgba(42, 190, 209,0.1)' // 修改点击柱条后背景颜色
|
|
|
+ options.legend.show = true // 显示底部数量、金额、圆点
|
|
|
+ options.yAxis[1].axisLabel.show = true; // 显示右侧y轴刻度
|
|
|
+ options.yAxis[1].axisLabel.formatter = function (value, index) {
|
|
|
+ return value.toString().replace(/,/, '')
|
|
|
+ } // 去掉右轴逗号分割
|
|
|
+ options.series[1].lineStyle.width = 2 // 折线
|
|
|
+ options.series[1].lineStyle.color = '#FF9F40'
|
|
|
+ // 以下代码为:处理左侧y轴与右侧y轴刻度保持在同一X轴水平线上
|
|
|
+ var maxCountList = this.annualData.rows.map(function (v) {
|
|
|
+ return v['项目数量']
|
|
|
+ })
|
|
|
+ var maxPriceList = this.annualData.rows.map(function (v) {
|
|
|
+ return v['项目金额']
|
|
|
+ })
|
|
|
|
|
|
- // 处理点击浮窗显示效果
|
|
|
- options.tooltip.formatter = function(params) {
|
|
|
- return that.formatter(params)
|
|
|
- }
|
|
|
- options.legend.formatter = function (name) {
|
|
|
- var wnYuan = ['金额', '项目金额']
|
|
|
- var ge = ['数量', '项目数量']
|
|
|
- if (wnYuan.indexOf(name) !== -1) {
|
|
|
- name += '(万元)-右轴'
|
|
|
- } else if (ge.indexOf(name) !== -1) {
|
|
|
- name += '(个)'
|
|
|
- }
|
|
|
- return name;
|
|
|
- }
|
|
|
- return options
|
|
|
- },
|
|
|
- // 2. 月度中标金额(折线图)
|
|
|
- lineChartConfig: function (options) {
|
|
|
- options.yAxis[0].name = '中标金额(万元)';
|
|
|
- options.legend.itemGap = 20;
|
|
|
- options.tooltip.formatter = function(params) {
|
|
|
- var tip = '';
|
|
|
- for (var i = 0; i < params.length; i++) {
|
|
|
- params[i].marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params[i].color + ';"></span>'
|
|
|
- if(params[i].value[1] !== undefined && params[i].value[1] !== null && !isNaN(params[i].value[1])) {
|
|
|
- tip = tip + params[i].marker + params[i].seriesName + params[i].name + '中标金额:' + params[i].value[1].toString().replace(/,/,'') + '万元' +'<br/>';
|
|
|
- }
|
|
|
- }
|
|
|
- tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
- return tip;
|
|
|
- }
|
|
|
- return options;
|
|
|
- },
|
|
|
- // 3. 地图配置项
|
|
|
- mapConfig: function (options) {
|
|
|
- var _this = this
|
|
|
- var arr = this.mapChartData.rows
|
|
|
- // 最大值、最小值
|
|
|
- var maxNum = Math.max.apply(Math, arr.map(function(o) {return o.value}))
|
|
|
- var minNum = Math.min.apply(Math, arr.map(function(o) {return o.value}))
|
|
|
+ var maxCount = Math.ceil(Math.max.apply(null, maxCountList)).toString();// 取出数量中最大值
|
|
|
+ var maxPrice = Math.ceil(Math.max.apply(null, maxPriceList)).toString();// 取出金额中最大值
|
|
|
+ // var minPrice = Math.min.apply(null,maxPriceList);// 去除金额最小值
|
|
|
+ maxPrice = Math.ceil(maxPrice / (Math.pow(10, maxPrice.length - 1))) * Math.pow(10, maxPrice.length - 1)
|
|
|
+ maxCount = Math.ceil(maxCount / (Math.pow(10, maxCount.length - 1))) * Math.pow(10, maxCount.length - 1)
|
|
|
+ var item = options.yAxis
|
|
|
+ item[0].min = 0;
|
|
|
+ item[1].min = 0;
|
|
|
+ item[0].max = maxCount;
|
|
|
+ item[0].interval = Math.ceil(maxCount / 5);
|
|
|
+ item[1].max = maxPrice;
|
|
|
+ item[1].interval = Math.ceil((maxPrice - 0) / 5);
|
|
|
|
|
|
- options.visualMap.min = minNum;
|
|
|
- options.visualMap.max = maxNum < 100 ? 100 : maxNum;
|
|
|
+ // 处理点击浮窗显示效果
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ return that.formatter(params)
|
|
|
+ }
|
|
|
+ options.legend.formatter = function (name) {
|
|
|
+ var wnYuan = ['金额', '项目金额']
|
|
|
+ var ge = ['数量', '项目数量']
|
|
|
+ if (wnYuan.indexOf(name) !== -1) {
|
|
|
+ name += '(万元)-右轴'
|
|
|
+ } else if (ge.indexOf(name) !== -1) {
|
|
|
+ name += '(个)'
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ // 2. 月度中标金额(折线图)
|
|
|
+ lineChartConfig: function (options) {
|
|
|
+ options.yAxis[0].name = '中标金额(万元)';
|
|
|
+ options.legend.itemGap = 20;
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ var tip = '';
|
|
|
+ for (var i = 0; i < params.length; i++) {
|
|
|
+ params[i].marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params[i].color + ';"></span>'
|
|
|
+ if (params[i].value[1] !== undefined && params[i].value[1] !== null && !isNaN(params[i].value[1])) {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + params[i].name + '中标金额:' + params[i].value[1].toString().replace(/,/, '') + '万元' + '<br/>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
+ return tip;
|
|
|
+ }
|
|
|
+ return options;
|
|
|
+ },
|
|
|
+ // 3. 地图配置项
|
|
|
+ mapConfig: function (options) {
|
|
|
+ var _this = this
|
|
|
+ var arr = this.mapChartData.rows
|
|
|
+ // 最大值、最小值
|
|
|
+ var maxNum = Math.max.apply(Math, arr.map(function (o) { return o.value }))
|
|
|
+ var minNum = Math.min.apply(Math, arr.map(function (o) { return o.value }))
|
|
|
|
|
|
- // 设置最大值
|
|
|
- options.graphic[options.graphic.length - 1].children[0].style.text = maxNum > 100 ? maxNum : 100
|
|
|
- options.graphic[options.graphic.length - 1].children[1].style.text = 1;
|
|
|
- options.visualMap.min = 1;
|
|
|
- options.visualMap.max = maxNum < 100 ? 100 : maxNum;
|
|
|
- options.graphic[0].children[0].style.text = '项目数量(个)'
|
|
|
- options.tooltip.formatter = function (params) {
|
|
|
- var index = params.dataIndex
|
|
|
- var item = _this.mapChartData.rows[index]
|
|
|
- var string = ''
|
|
|
- if (item) {
|
|
|
- if (item.value && item.amount) {
|
|
|
- string = item.name + '<br/>项目数量:' + item.value + '个<br/>中标金额:' + item.amount + '万元'
|
|
|
- } else if (item.value) {
|
|
|
- string = item.name + '<br/>项目数量:' + item.value + '个'
|
|
|
- } else if (item.amount) {
|
|
|
- string = item.name + '<br/>中标金额:' + item.amount + '万元'
|
|
|
- }
|
|
|
- }
|
|
|
- return string
|
|
|
- }
|
|
|
- return options
|
|
|
- },
|
|
|
- // 4. 客户平均折扣率配置
|
|
|
- rateConfig: function (options) {
|
|
|
- options.color = ['#FB483D', '#05A6F3', '#0BD991', '#FF9F40','#8E6DF2','#C0C4CC'];
|
|
|
- options.xAxis[0].axisLabel.margin = 12
|
|
|
- options.yAxis[0].axisLabel.formatter = '{value}%'
|
|
|
- options.grid = {
|
|
|
- top: 20,
|
|
|
- right: 16,
|
|
|
- bottom: 70,
|
|
|
- left: 10
|
|
|
- }
|
|
|
- options.legend.textStyle.padding = [0, 18, 0,0];
|
|
|
- options.legend.left = 16;
|
|
|
- options.legend.bottom = 10;
|
|
|
- options.tooltip.formatter = function(params) {
|
|
|
- var tip = '';
|
|
|
- for (var i = 0; i < params.length; i++) {
|
|
|
- params[i].marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params[i].color + ';"></span>'
|
|
|
- if(params[i].value[1] === undefined || params[i].value[1] == null) {
|
|
|
- tip = tip + params[i].marker + params[i].seriesName + ':--<br/>';
|
|
|
- } else {
|
|
|
- tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value[1] + '%<br/>';
|
|
|
- }
|
|
|
- }
|
|
|
- tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
- return tip;
|
|
|
- }
|
|
|
- return options;
|
|
|
- },
|
|
|
- // 整理年度项目统计数据
|
|
|
- arrangeAnnualData: function (data) {
|
|
|
- if (!data) return
|
|
|
+ options.visualMap.min = minNum;
|
|
|
+ options.visualMap.max = maxNum < 100 ? 100 : maxNum;
|
|
|
|
|
|
- var rows = [];
|
|
|
- var count = 0;
|
|
|
- for (var key in data) {
|
|
|
- var item = data[key]
|
|
|
- // 统计数据总数是否为0
|
|
|
- count += item.Count
|
|
|
- count += item.Money
|
|
|
- rows.push({
|
|
|
- '日期': parseInt(key),
|
|
|
- '项目数量': item.Count,
|
|
|
- '项目金额': Math.round(item.Money / 10000)
|
|
|
- })
|
|
|
- }
|
|
|
+ // 设置最大值
|
|
|
+ options.graphic[options.graphic.length - 1].children[0].style.text = maxNum > 100 ? maxNum : 100
|
|
|
+ options.graphic[options.graphic.length - 1].children[1].style.text = 1;
|
|
|
+ options.visualMap.min = 1;
|
|
|
+ options.visualMap.max = maxNum < 100 ? 100 : maxNum;
|
|
|
+ options.graphic[0].children[0].style.text = '项目数量(个)'
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ var index = params.dataIndex
|
|
|
+ var item = _this.mapChartData.rows[index]
|
|
|
+ var string = ''
|
|
|
+ if (item) {
|
|
|
+ if (item.value && item.amount) {
|
|
|
+ string = item.name + '<br/>项目数量:' + item.value + '个<br/>中标金额:' + item.amount + '万元'
|
|
|
+ } else if (item.value) {
|
|
|
+ string = item.name + '<br/>项目数量:' + item.value + '个'
|
|
|
+ } else if (item.amount) {
|
|
|
+ string = item.name + '<br/>中标金额:' + item.amount + '万元'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return string
|
|
|
+ }
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ // 4. 客户平均折扣率配置
|
|
|
+ rateConfig: function (options) {
|
|
|
+ options.color = ['#FB483D', '#05A6F3', '#0BD991', '#FF9F40', '#8E6DF2', '#C0C4CC'];
|
|
|
+ options.xAxis[0].axisLabel.margin = 12
|
|
|
+ options.yAxis[0].axisLabel.formatter = '{value}%'
|
|
|
+ options.grid = {
|
|
|
+ top: 20,
|
|
|
+ right: 16,
|
|
|
+ bottom: 70,
|
|
|
+ left: 10
|
|
|
+ }
|
|
|
+ options.legend.textStyle.padding = [0, 18, 0, 0];
|
|
|
+ options.legend.left = 16;
|
|
|
+ options.legend.bottom = 10;
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ var tip = '';
|
|
|
+ for (var i = 0; i < params.length; i++) {
|
|
|
+ params[i].marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params[i].color + ';"></span>'
|
|
|
+ if (params[i].value[1] === undefined || params[i].value[1] == null) {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':--<br/>';
|
|
|
+ } else {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value[1] + '%<br/>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
+ return tip;
|
|
|
+ }
|
|
|
+ return options;
|
|
|
+ },
|
|
|
+ // 整理年度项目统计数据
|
|
|
+ arrangeAnnualData: function (data) {
|
|
|
+ if (!data) return
|
|
|
|
|
|
- // rows = utils.bSort(rows, '日期').reverse()
|
|
|
- rows = utils.bSort(rows, '日期')
|
|
|
+ var rows = [];
|
|
|
+ var count = 0;
|
|
|
+ for (var key in data) {
|
|
|
+ var item = data[key]
|
|
|
+ // 统计数据总数是否为0
|
|
|
+ count += item.Count
|
|
|
+ count += item.Money
|
|
|
+ rows.push({
|
|
|
+ '日期': parseInt(key),
|
|
|
+ '项目数量': item.Count,
|
|
|
+ '项目金额': Math.round(item.Money / 10000)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- // 数据总量为0,不赋值
|
|
|
- if (count != 0) {
|
|
|
- this.annualData.rows = rows;
|
|
|
- }
|
|
|
- },
|
|
|
- // 整理月度项目统计数据
|
|
|
- arrangeMonthZbData: function (data) {
|
|
|
- if (!data) return
|
|
|
- var rows = []
|
|
|
- var columns = ['月份']
|
|
|
- var count = 0
|
|
|
- var allNum = []
|
|
|
- // 1. 先将月份提取出来, 并排序
|
|
|
- var yearArr = []
|
|
|
- for (var key in data) {
|
|
|
- yearArr.push(parseInt(key))
|
|
|
- for (var n in data[key]) {
|
|
|
- allNum.push(data[key][n])
|
|
|
- }
|
|
|
- }
|
|
|
- yearArr.sort(function (a, b) { return a - b })
|
|
|
+ // rows = utils.bSort(rows, '日期').reverse()
|
|
|
+ rows = utils.bSort(rows, '日期')
|
|
|
|
|
|
- // 2. 循环12个月份,并进行处理
|
|
|
- yearArr.forEach(function (item) {
|
|
|
- columns.push(item + '年')
|
|
|
- })
|
|
|
- for (var i = 1; i <= 12; i++) {
|
|
|
- var columnsItem = {}
|
|
|
- columns.forEach(function (item) {
|
|
|
- var value = ''
|
|
|
- if (item == '月份') {
|
|
|
- value = i + '月'
|
|
|
- } else if (/年/g.test(item)) {
|
|
|
- if (data[item.slice(0, -1)]) {
|
|
|
- value = data[item.slice(0, -1)][i]
|
|
|
- value = (value / 10000).fixed(2)
|
|
|
- count += parseInt(value)
|
|
|
- }
|
|
|
- }
|
|
|
- columnsItem[item] = value
|
|
|
- })
|
|
|
- rows.push(columnsItem)
|
|
|
- }
|
|
|
- var maxNum = Math.max.apply(Math, allNum.map(function(o) { return o }))
|
|
|
- // 数据总量为0,不赋值
|
|
|
- if (count != 0 && maxNum !== 0) {
|
|
|
- this.monthZbData.columns = columns;
|
|
|
- this.monthZbData.rows = rows;
|
|
|
+ // 数据总量为0,不赋值
|
|
|
+ if (count != 0) {
|
|
|
+ this.annualData.rows = rows;
|
|
|
+ } else {
|
|
|
+ this.show.yearData = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 整理月度项目统计数据
|
|
|
+ arrangeMonthZbData: function (data) {
|
|
|
+ if (!data) return
|
|
|
+ var rows = []
|
|
|
+ var columns = ['月份']
|
|
|
+ var count = 0
|
|
|
+ var allNum = []
|
|
|
+ // 1. 先将月份提取出来, 并排序
|
|
|
+ var yearArr = []
|
|
|
+ for (var key in data) {
|
|
|
+ yearArr.push(parseInt(key))
|
|
|
+ for (var n in data[key]) {
|
|
|
+ allNum.push(data[key][n])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ yearArr.sort(function (a, b) { return a - b })
|
|
|
+
|
|
|
+ // 2. 循环12个月份,并进行处理
|
|
|
+ yearArr.forEach(function (item) {
|
|
|
+ columns.push(item + '年')
|
|
|
+ })
|
|
|
+ for (var i = 1; i <= 12; i++) {
|
|
|
+ var columnsItem = {}
|
|
|
+ columns.forEach(function (item) {
|
|
|
+ var value = ''
|
|
|
+ if (item == '月份') {
|
|
|
+ value = i + '月'
|
|
|
+ } else if (/年/g.test(item)) {
|
|
|
+ if (data[item.slice(0, -1)]) {
|
|
|
+ value = data[item.slice(0, -1)][i]
|
|
|
+ value = (value / 10000).fixed(2)
|
|
|
+ count += parseInt(value)
|
|
|
}
|
|
|
- },
|
|
|
- // 整理主要市场分布(中国地图)数据
|
|
|
- arrangeMapData: function(data) {
|
|
|
- if (!data) return
|
|
|
+ }
|
|
|
+ columnsItem[item] = value
|
|
|
+ })
|
|
|
+ rows.push(columnsItem)
|
|
|
+ }
|
|
|
+ var maxNum = Math.max.apply(Math, allNum.map(function (o) { return o }))
|
|
|
+ // 数据总量为0,不赋值
|
|
|
+ if (count != 0 && maxNum !== 0) {
|
|
|
+ this.monthZbData.columns = columns;
|
|
|
+ this.monthZbData.rows = rows;
|
|
|
+ } else {
|
|
|
+ this.show.monthData = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 整理主要市场分布(中国地图)数据
|
|
|
+ arrangeMapData: function (data) {
|
|
|
+ if (!data) return
|
|
|
|
|
|
- var mapRows = []
|
|
|
- var count = 0
|
|
|
- if (data && $.isArray(data)) {
|
|
|
- data.forEach(function (n) {
|
|
|
- count += n.projectCount
|
|
|
+ var mapRows = []
|
|
|
+ var count = 0
|
|
|
+ if (data && $.isArray(data)) {
|
|
|
+ data.forEach(function (n) {
|
|
|
+ count += n.projectCount
|
|
|
|
|
|
- mapRows.push({
|
|
|
- name: n.areaName,
|
|
|
- value: n.projectCount,
|
|
|
- amount: (n.bidamountCount / 10000).fixed(2)
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ mapRows.push({
|
|
|
+ name: n.areaName,
|
|
|
+ value: n.projectCount,
|
|
|
+ amount: (n.bidamountCount / 10000).fixed(2)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- // 数据总量为0,不赋值
|
|
|
- if (count != 0) {
|
|
|
- this.mapChartData.rows = mapRows;
|
|
|
- }
|
|
|
- },
|
|
|
- // 整理平均折扣率数据
|
|
|
- arrangeRateData: function (data) {
|
|
|
- if (!data) return
|
|
|
- var rows = []
|
|
|
- var columns = ['日期', '全部客户']
|
|
|
- var count = 0
|
|
|
+ // 数据总量为0,不赋值
|
|
|
+ if (count != 0) {
|
|
|
+ this.mapChartData.rows = mapRows;
|
|
|
+ } else {
|
|
|
+ this.show.areaData = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 整理平均折扣率数据
|
|
|
+ arrangeRateData: function (data) {
|
|
|
+ if (!data) return
|
|
|
+ var rows = []
|
|
|
+ var columns = ['日期', '全部客户']
|
|
|
+ var count = 0
|
|
|
|
|
|
- for (var c in data) {
|
|
|
- if (c !== '全部客户') {
|
|
|
- columns.push(c)
|
|
|
- }
|
|
|
- }
|
|
|
- // 获取年份数组
|
|
|
- var yearArr = []
|
|
|
- for (var key in data['全部客户']) {
|
|
|
- yearArr.push(key)
|
|
|
- }
|
|
|
- yearArr.sort(function (a, b) { return a - b })
|
|
|
+ for (var c in data) {
|
|
|
+ if (c !== '全部客户') {
|
|
|
+ columns.push(c)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取年份数组
|
|
|
+ var yearArr = []
|
|
|
+ for (var key in data['全部客户']) {
|
|
|
+ yearArr.push(key)
|
|
|
+ }
|
|
|
+ yearArr.sort(function (a, b) { return a - b })
|
|
|
|
|
|
- yearArr.forEach(function (item) {
|
|
|
- var rowsItem = {
|
|
|
- '日期': item + '年'
|
|
|
- }
|
|
|
- for (var k in data) {
|
|
|
- count += (data[k][item] * 100)
|
|
|
- rowsItem[k] = data[k][item] == null ? null : (data[k][item] * 100).fixed(2)
|
|
|
- }
|
|
|
- rows.push(rowsItem)
|
|
|
- })
|
|
|
+ yearArr.forEach(function (item) {
|
|
|
+ var rowsItem = {
|
|
|
+ '日期': item + '年'
|
|
|
+ }
|
|
|
+ for (var k in data) {
|
|
|
+ count += (data[k][item] * 100)
|
|
|
+ rowsItem[k] = data[k][item] == null ? null : (data[k][item] * 100).fixed(2)
|
|
|
+ }
|
|
|
+ rows.push(rowsItem)
|
|
|
+ })
|
|
|
|
|
|
- // 数据总量为0,不赋值
|
|
|
- if (count != 0) {
|
|
|
- this.rateData.columns = columns;
|
|
|
- this.rateData.rows = rows;
|
|
|
- }
|
|
|
- },
|
|
|
- // 初始化饼图
|
|
|
- initPieChartData: function (d) {
|
|
|
- if (!d) return
|
|
|
- var that = this
|
|
|
- var arr = []
|
|
|
- var data = JSON.parse(JSON.stringify(d))
|
|
|
- // 降序排列
|
|
|
- data.sort(function (a, b) {
|
|
|
- return b.bidamount_share - a.bidamount_share
|
|
|
- })
|
|
|
- data.forEach(function (item){
|
|
|
- arr.push(item.buyerClass,item.bidamount_share,item.bidamount_count,item.project_count,item.rate_avg)
|
|
|
- })
|
|
|
- var normal =['行业','中标金额占比','中标金额','项目数量','平均折扣率'];
|
|
|
- var newArr = that.arrTrans(5,arr);
|
|
|
- newArr.unshift(normal)
|
|
|
- chartOptions.deformPieChart.dataset.source = newArr;
|
|
|
- chartOptions.deformPieChart.tooltip.formatter = function(params){
|
|
|
- var tip = '';
|
|
|
- var data = params.data;
|
|
|
- params.marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params.color +'"></span>';
|
|
|
- var percent = '<span style="padding-left:13px;">中标金额占比:' + (data[1]*100).fixed(2) + '%</span></br>';
|
|
|
- var scale = '<span style="padding-left:13px;">中标金额:' + utils.moneyUnit(data[2].fixed(2)) + '</span></br>';
|
|
|
- var count = '<span style="padding-left:13px;">项目数量:' + data[3] + '个</span></br>';
|
|
|
- var rate = (typeof data[4] === 'number' && !isNaN(data[4])) ? '<span style="padding-left:13px;">平均折扣率:' + (data[4]*100).fixed(2) + '%</span></br>' : '';
|
|
|
- tip = params.marker + params.name +'<br/>' + percent + scale + count + rate
|
|
|
- return tip;
|
|
|
- }
|
|
|
- chartOptions.deformPieChart.legend.formatter = null
|
|
|
- that.$nextTick(function(){
|
|
|
- var ref = that.$refs.pieChart;
|
|
|
- var pieChart = echarts.init(ref, null, that.initEchartsOptions);
|
|
|
- pieChart.setOption(chartOptions.deformPieChart);
|
|
|
- pieChart.resize();
|
|
|
+ // 数据总量为0,不赋值
|
|
|
+ if (count != 0) {
|
|
|
+ this.rateData.columns = columns;
|
|
|
+ this.rateData.rows = rows;
|
|
|
+ } else {
|
|
|
+ this.show.rate = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 初始化饼图
|
|
|
+ initPieChartData: function (d) {
|
|
|
+ if (!d) return
|
|
|
+ if (d && d.length == 0) {
|
|
|
+ // 新增变量 用于判断是否展示缺省页
|
|
|
+ this.show.top10 = false
|
|
|
+ }
|
|
|
+ var that = this
|
|
|
+ var arr = []
|
|
|
+ var data = JSON.parse(JSON.stringify(d))
|
|
|
+ // 降序排列
|
|
|
+ data.sort(function (a, b) {
|
|
|
+ return b.bidamount_share - a.bidamount_share
|
|
|
+ })
|
|
|
+ data.forEach(function (item) {
|
|
|
+ arr.push(item.buyerClass, item.bidamount_share, item.bidamount_count, item.project_count, item.rate_avg)
|
|
|
+ })
|
|
|
+ var normal = ['行业', '中标金额占比', '中标金额', '项目数量', '平均折扣率'];
|
|
|
+ var newArr = that.arrTrans(5, arr);
|
|
|
+ newArr.unshift(normal)
|
|
|
+ chartOptions.deformPieChart.dataset.source = newArr;
|
|
|
+ chartOptions.deformPieChart.tooltip.formatter = function (params) {
|
|
|
+ var tip = '';
|
|
|
+ var data = params.data;
|
|
|
+ params.marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params.color + '"></span>';
|
|
|
+ var percent = '<span style="padding-left:13px;">中标金额占比:' + (data[1] * 100).fixed(2) + '%</span></br>';
|
|
|
+ var scale = '<span style="padding-left:13px;">中标金额:' + utils.moneyUnit(data[2].fixed(2)) + '</span></br>';
|
|
|
+ var count = '<span style="padding-left:13px;">项目数量:' + data[3] + '个</span></br>';
|
|
|
+ var rate = (typeof data[4] === 'number' && !isNaN(data[4])) ? '<span style="padding-left:13px;">平均折扣率:' + (data[4] * 100).fixed(2) + '%</span></br>' : '';
|
|
|
+ tip = params.marker + params.name + '<br/>' + percent + scale + count + rate
|
|
|
+ return tip;
|
|
|
+ }
|
|
|
+ chartOptions.deformPieChart.legend.formatter = null
|
|
|
+ that.$nextTick(function () {
|
|
|
+ var ref = that.$refs.pieChart;
|
|
|
+ var pieChart = echarts.init(ref, null, that.initEchartsOptions);
|
|
|
+ pieChart.setOption(chartOptions.deformPieChart);
|
|
|
+ pieChart.resize();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ arrTrans: function (num, arr) { // 一维数组转换为二维数组
|
|
|
+ var iconsArr = [];
|
|
|
+ arr.forEach(function (item, index) {
|
|
|
+ var page = Math.floor(index / num); // 计算该元素为第几个素组内
|
|
|
+ if (!iconsArr[page]) { // 判断是否存在
|
|
|
+ iconsArr[page] = [];
|
|
|
+ }
|
|
|
+ iconsArr[page].push(item);
|
|
|
+ });
|
|
|
+ return iconsArr;
|
|
|
+ },
|
|
|
+ // 整理重要客户数据
|
|
|
+ arrangeImportantData: function (data) {
|
|
|
+ if (!data) return
|
|
|
+ if (data && data.length == 0) {
|
|
|
+ this.show.topShow = false
|
|
|
+ }
|
|
|
+ var arr = []
|
|
|
+ if ($.isArray(data)) {
|
|
|
+ data.forEach(function (list) {
|
|
|
+ var i1 = {
|
|
|
+ title: list.buyerclass,
|
|
|
+ list: []
|
|
|
+ }
|
|
|
+ if (list.topData && $.isArray(list.topData)) {
|
|
|
+ list.topData.forEach(function (item) {
|
|
|
+ i1.list.push({
|
|
|
+ name: item.BuyerName,
|
|
|
+ money: item.CountMoney,
|
|
|
+ count: item.CountProject,
|
|
|
+ rate: item.AvgRate ? (item.AvgRate * 100).fixed(2) : item.AvgRate,
|
|
|
+ time: new Date(item.lastTime * 1000).pattern('yyyy/MM/dd'),
|
|
|
+ percent: item.CountMoney / list.topData[0].CountMoney * 100 + '%'
|
|
|
+ })
|
|
|
})
|
|
|
- },
|
|
|
- arrTrans: function(num, arr) { // 一维数组转换为二维数组
|
|
|
- var iconsArr = [];
|
|
|
- arr.forEach(function(item, index) {
|
|
|
- var page = Math.floor(index / num); // 计算该元素为第几个素组内
|
|
|
- if (!iconsArr[page]) { // 判断是否存在
|
|
|
- iconsArr[page] = [];
|
|
|
- }
|
|
|
- iconsArr[page].push(item);
|
|
|
- });
|
|
|
- return iconsArr;
|
|
|
- },
|
|
|
- // 整理重要客户数据
|
|
|
- arrangeImportantData: function (data) {
|
|
|
- if (!data) return
|
|
|
- var arr = []
|
|
|
- if ($.isArray(data)) {
|
|
|
- data.forEach(function (list) {
|
|
|
- var i1 = {
|
|
|
- title: list.buyerclass,
|
|
|
- list: []
|
|
|
- }
|
|
|
- if (list.topData && $.isArray(list.topData)) {
|
|
|
- list.topData.forEach(function (item) {
|
|
|
- i1.list.push({
|
|
|
- name: item.BuyerName,
|
|
|
- money: item.CountMoney,
|
|
|
- count: item.CountProject,
|
|
|
- rate: item.AvgRate ? (item.AvgRate*100).fixed(2) : item.AvgRate,
|
|
|
- time: new Date(item.lastTime * 1000).pattern('yyyy/MM/dd'),
|
|
|
- percent: item.CountMoney / list.topData[0].CountMoney*100 + '%'
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- if (!list.buyerclass || ($.isArray(list.topData) && list.topData.length === 0)) {
|
|
|
- // console.log('此数据为空')
|
|
|
- } else {
|
|
|
- arr.push(i1)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- this.importantCustomers = arr
|
|
|
- },
|
|
|
- // 去公告详情页
|
|
|
- toProjectDetail: function (item) {
|
|
|
- this.savePageState()
|
|
|
- if (item.id) {
|
|
|
- var href = '/article/content/' + item.id + '.html'
|
|
|
- location.href = href
|
|
|
- }
|
|
|
- },
|
|
|
- goToFilterProjectNews: function () {
|
|
|
- this.savePageState()
|
|
|
- var url = this.getProjectNewsUrl()
|
|
|
- var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
|
|
|
- location.href = '/big/wx/page/free_ent_project_news?eid=' + this.entInfo.id + '&reqSign=' + reqSign
|
|
|
- },
|
|
|
- savePageState: function () {
|
|
|
- this.scrollTop = $('#ent-portrait').scrollTop()
|
|
|
- var data = {
|
|
|
- conf: this.conf,
|
|
|
- tabActiveName: this.tabActiveName,
|
|
|
- entInfo: this.entInfo,
|
|
|
- entBaseInfo: this.entBaseInfo,
|
|
|
- topProject: this.topProject,
|
|
|
- entPortraitInfo: this.entPortraitInfo,
|
|
|
- powerInfo: this.powerInfo,
|
|
|
- singleTab: this.singleTab,
|
|
|
- scrollTop: this.scrollTop,
|
|
|
- gotTab2: this.gotTab2
|
|
|
- }
|
|
|
- sessionStorage.setItem(this.sessKey, JSON.stringify(data))
|
|
|
- },
|
|
|
- reStoreState: function () {
|
|
|
- var $data = sessionStorage.getItem(this.sessKey)
|
|
|
- if ($data) {
|
|
|
- $data = JSON.parse($data)
|
|
|
- // 如果恢复的企业名称和当前url企业名称不同,则清除缓存,重新请求
|
|
|
- if (this.entInfo.id !== $data.entInfo.id) {
|
|
|
- sessionStorage.removeItem(this.sessKey)
|
|
|
- return false
|
|
|
- }
|
|
|
- this.tabActiveName = $data.tabActiveName
|
|
|
- Object.assign(this.conf, $data.conf || {})
|
|
|
- Object.assign(this.entInfo, $data.entInfo || {})
|
|
|
- Object.assign(this.entBaseInfo, $data.entBaseInfo || {})
|
|
|
- Object.assign(this.topProject, $data.topProject || {})
|
|
|
- Object.assign(this.entPortraitInfo, $data.entPortraitInfo || {})
|
|
|
- Object.assign(this.powerInfo, $data.powerInfo || {})
|
|
|
- Object.assign(this.entvisit, $data.entvisit || {})
|
|
|
- this.singleTab = $data.singleTab
|
|
|
- this.scrollTop = $data.scrollTop
|
|
|
- this.gotTab2 = $data.gotTab2
|
|
|
- sessionStorage.removeItem(this.sessKey)
|
|
|
- }
|
|
|
- return !!$data
|
|
|
- },
|
|
|
- // 高级分析设置
|
|
|
- goHighSet () {
|
|
|
- var url = this.getProjectNewsUrl()
|
|
|
- var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
|
|
|
- if (this.conf._4) {
|
|
|
- location.href = '/big/wx/page/free_high_set?header=中标分析高级设置&eid=' + utils.getParam('eId') + '&reqSign=' + reqSign
|
|
|
+ if (!list.buyerclass || ($.isArray(list.topData) && list.topData.length === 0)) {
|
|
|
+ // console.log('此数据为空')
|
|
|
} else {
|
|
|
- this.$dialog.confirm({
|
|
|
- className:'promatch',
|
|
|
- title: '您暂无使用权限',
|
|
|
- message: '您未购买此服务,如需使用请联系您的销售人员或客服升级套餐,谢谢!',
|
|
|
- showCancelButton: false,
|
|
|
- confirmButtonColor: '#2cb7ca',
|
|
|
- confirmButtonText: '我知道了'
|
|
|
- }).then(function () {})
|
|
|
+ arr.push(i1)
|
|
|
}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.importantCustomers = arr
|
|
|
+ },
|
|
|
+ // 去公告详情页
|
|
|
+ toProjectDetail: function (item) {
|
|
|
+ this.savePageState()
|
|
|
+ if (item.id) {
|
|
|
+ var href = '/article/content/' + item.id + '.html'
|
|
|
+ location.href = href
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goToFilterProjectNews: function () {
|
|
|
+ this.savePageState()
|
|
|
+ var url = this.getProjectNewsUrl()
|
|
|
+ var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
|
|
|
+ location.href = '/big/wx/page/free_ent_project_news?eid=' + this.entInfo.id + '&reqSign=' + reqSign
|
|
|
+ },
|
|
|
+ savePageState: function () {
|
|
|
+ this.scrollTop = $('#ent-portrait').scrollTop()
|
|
|
+ var data = {
|
|
|
+ conf: this.conf,
|
|
|
+ tabActiveName: this.tabActiveName,
|
|
|
+ entInfo: this.entInfo,
|
|
|
+ entBaseInfo: this.entBaseInfo,
|
|
|
+ topProject: this.topProject,
|
|
|
+ entPortraitInfo: this.entPortraitInfo,
|
|
|
+ powerInfo: this.powerInfo,
|
|
|
+ singleTab: this.singleTab,
|
|
|
+ scrollTop: this.scrollTop,
|
|
|
+ gotTab2: this.gotTab2
|
|
|
+ }
|
|
|
+ sessionStorage.setItem(this.sessKey, JSON.stringify(data))
|
|
|
+ },
|
|
|
+ reStoreState: function () {
|
|
|
+ var $data = sessionStorage.getItem(this.sessKey)
|
|
|
+ if ($data) {
|
|
|
+ $data = JSON.parse($data)
|
|
|
+ // 如果恢复的企业名称和当前url企业名称不同,则清除缓存,重新请求
|
|
|
+ if (this.entInfo.id !== $data.entInfo.id) {
|
|
|
+ sessionStorage.removeItem(this.sessKey)
|
|
|
+ return false
|
|
|
}
|
|
|
+ this.tabActiveName = $data.tabActiveName
|
|
|
+ Object.assign(this.conf, $data.conf || {})
|
|
|
+ Object.assign(this.entInfo, $data.entInfo || {})
|
|
|
+ Object.assign(this.entBaseInfo, $data.entBaseInfo || {})
|
|
|
+ Object.assign(this.topProject, $data.topProject || {})
|
|
|
+ Object.assign(this.entPortraitInfo, $data.entPortraitInfo || {})
|
|
|
+ Object.assign(this.powerInfo, $data.powerInfo || {})
|
|
|
+ Object.assign(this.entvisit, $data.entvisit || {})
|
|
|
+ this.singleTab = $data.singleTab
|
|
|
+ this.scrollTop = $data.scrollTop
|
|
|
+ this.gotTab2 = $data.gotTab2
|
|
|
+ sessionStorage.removeItem(this.sessKey)
|
|
|
+ }
|
|
|
+ return !!$data
|
|
|
+ },
|
|
|
+ // 高级分析设置
|
|
|
+ goHighSet () {
|
|
|
+ var url = this.getProjectNewsUrl()
|
|
|
+ var reqSign = url.indexOf('subVipPortrait') === -1 ? 'bigmember' : 'svip'
|
|
|
+ if (this.conf._4) {
|
|
|
+ location.href = '/big/wx/page/free_high_set?header=中标分析高级设置&eid=' + utils.getParam('eId') + '&reqSign=' + reqSign
|
|
|
+ } else {
|
|
|
+ this.$dialog.confirm({
|
|
|
+ className: 'promatch',
|
|
|
+ title: '您暂无使用权限',
|
|
|
+ message: '您未购买此服务,如需使用请联系您的销售人员或客服升级套餐,谢谢!',
|
|
|
+ showCancelButton: false,
|
|
|
+ confirmButtonColor: '#2cb7ca',
|
|
|
+ confirmButtonText: '我知道了'
|
|
|
+ }).then(function () { })
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
var vueComponent = new Vue(vNode)
|
|
|
-$(function () {
|
|
|
+$(function () {
|
|
|
var u = navigator.userAgent;
|
|
|
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
|
- var isPageHide = false;
|
|
|
- window.addEventListener('pageshow', function () {
|
|
|
- if (isPageHide && isiOS) {
|
|
|
- window.location.reload();
|
|
|
- }
|
|
|
- });
|
|
|
- window.addEventListener('pagehide', function () {
|
|
|
- isPageHide = true;
|
|
|
+ var isPageHide = false;
|
|
|
+ window.addEventListener('pageshow', function () {
|
|
|
+ if (isPageHide && isiOS) {
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.addEventListener('pagehide', function () {
|
|
|
+ isPageHide = true;
|
|
|
});
|
|
|
})
|