From 09817ee2a07b1419db230c759c91fbe08eb2ad50 Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Fri, 14 Apr 2023 18:41:05 +0800 Subject: [PATCH] update --- pages/commercialBI/businessPortrait.vue | 273 +++++++-- pages/commercialBI/carPortrait.vue | 12 +- pages/commercialBI/components/analyse.vue | 2 +- .../components/bussiness/businessFormat.vue | 2 +- .../bussiness/consumptionCompare.vue | 4 +- .../components/bussiness/levelTop.vue | 14 +- .../bussiness/timePeriodAnalysis.vue | 12 +- .../bussiness/transactionAnalysis.vue | 2 +- .../components/car/carTypeTime.vue | 3 +- .../commercialBI/components/car/homePlace.vue | 1 + .../components/car/monthTotal.vue | 9 +- .../components/car/percentEntry.vue | 7 +- .../components/car/timeAnalysis.vue | 6 +- .../components/format/bandLevel.vue | 61 +- .../components/format/consumLevel.vue | 14 +- .../components/format/fillingDegree.vue | 38 +- .../components/guest/customerFirst.vue | 34 +- .../components/guest/customerSecond.vue | 26 +- pages/commercialBI/components/headerTop.vue | 2 +- .../components/manager/moneyCompare.vue | 11 +- pages/commercialBI/components/noData.vue | 2 +- pages/commercialBI/formatPortrait.vue | 56 +- pages/commercialBI/guestPortrait.vue | 9 +- pages/commercialBI/managePortrait.vue | 8 +- pages/commercialBI/serviceDetail.vue | 571 ++++++++++++++---- pages/index/index.vue | 85 ++- 26 files changed, 1008 insertions(+), 256 deletions(-) diff --git a/pages/commercialBI/businessPortrait.vue b/pages/commercialBI/businessPortrait.vue index 8d323f4..76f70ec 100644 --- a/pages/commercialBI/businessPortrait.vue +++ b/pages/commercialBI/businessPortrait.vue @@ -5,14 +5,35 @@
-

交易分析

+
+

{{month}}月交易分析

+
+
+ + + {{ single }} + + + +
+
+
-

消费时段分析

+

{{month}}月消费转化对比图

+
+ + +
+ +
+ +
+

{{month}}月消费时段分析

@@ -20,7 +41,7 @@
-

消费水平(Top 5)

+

{{month}}月消费水平

@@ -28,7 +49,15 @@
-

业态交易值占比

+

{{month}}月品牌消费水平

+
+ + +
+ +
+
+

{{month}}月业态交易值占比

@@ -36,15 +65,7 @@
-

消费转化对比图

-
- - -
- -
-
-

商超畅销品

+

{{month}}月商超畅销品

@@ -63,10 +84,12 @@ import BusinessFormat from "./components/bussiness/businessFormat.vue"; import ConsumptionCompare from "./components/bussiness/consumptionCompare.vue"; import BestsellerShop from "./components/bussiness/bestsellerShop.vue"; import NoData from "./components/noData.vue"; +import BandLevel from "./components/format/bandLevel.vue"; export default { name: "businessPortrait", components: { + BandLevel, NoData, BestsellerShop, ConsumptionCompare, @@ -84,14 +107,17 @@ export default { transactionList:[],//交易分析数据 timePeriodList:[],//消费时段分析 levelTopList:[],//消费水平排行 + bandLevelList:[],//品牌消费水平 businessTypeList:[],//业态适配型 compareList:[],//消费转化对比图 bestsellerList:[],//商超畅销品 serviceInfo:{} ,//当前服务区信息 backType:'',//返回的页面类型 - analyseInfo:{ - analysisins_type: 1401 - }, + analyseInfo:{}, + analysisins_type: 1401, + single:'',//显示时间 + endData:'', // 结束时间 + month:'',//显示月份 } }, onLoad(option) { @@ -100,12 +126,19 @@ export default { this.serviceInfo = serviceInfo //跳转的时候带上时间 this.time = option.time + this.endData = new Date() }, onShow(){ let storeTime = uni.getStorageSync('lastDay') if (storeTime){ this.time = storeTime } + this.single = this.$util.getThisMonthHave(this.time) + const date = new Date(this.time) + let month = date.getMonth() + 1 + this.month = month<10?'0' + month:month + console.log('this.time',this.time) + let storeServiceInfo = uni.getStorageSync('currentService') if (storeServiceInfo){ this.serviceInfo = storeServiceInfo @@ -125,7 +158,9 @@ export default { this.getTimePeriodList() //消费水平排行 this.getLevelTopList() - //业态适配型 + //品牌消费水平 + this.getBandLevelList() + //业态交易值占比 this.getBusinessTypeList() //消费转化对比图 this.getCompareList() @@ -133,6 +168,36 @@ export default { this.getBestsellerList() }, methods:{ + onRefresh(){ + //交易分析 + this.getTransactionList() + //消费时段分析 + this.getTimePeriodList() + //消费水平排行 + this.getLevelTopList() + //品牌消费水平 + this.getBandLevelList() + //业态交易值占比 + this.getBusinessTypeList() + //消费转化对比图 + this.getCompareList() + //商超畅销品 + this.getBestsellerList() + this.$forceUpdate() + }, + bindDateChange(e){ + const date = new Date(e.detail.value) + let m = date.getMonth() + 1 + if (m<10){ + m = '0' + m + } + this.month = m + this.single = e.detail.value + let d = this.$util.getThisMonthDay(e.detail.value) + this.endTime = e.detail.value + '-' + d + this.time = e.detail.value + this.onRefresh() + }, async nearestService(){ let seat = uni.getStorageSync('seatInfo'); let req = { @@ -171,23 +236,28 @@ export default { Serverpart_ID:this.serviceInfo.Serverpart_ID } let totalData = await request.$webGet('CommercialApi/Revenue/GetTransactionTimeAnalysis',req) - + console.log('totalData123213',totalData) let res = { - series: [ - { - name: "", - data: totalData.Result_Data.data - } - ] + categories: ["0:00","2:00","4:00","6:00","8:00","10:00","12:00","14:00","16:00","18:00","20:00","22:00","23:00"], + series:[{}] } - // let res={ + // let res = { + // categories: ["2018","2019","2020","2021","2022","2023"], // series: [ // { - // name: "气泡一", - // data: [[2,35,17],[6,18,9],[10,5,5],[14,8,8],[18,9,9],[22,18,9]] + // name: "成交量A", + // data: [35,8,25,37,4,20] + // }, + // { + // name: "成交量B", + // data: [70,40,65,100,44,68] + // }, + // { + // name: "成交量C", + // data: [100,80,95,150,112,132] // } // ] - // } + // }; this.timePeriodList = res }, async getLevelTopList(){ @@ -195,7 +265,7 @@ export default { ProvinceCode:'340000', StatisticsDate:this.time, ServerpartId:this.serviceInfo.Serverpart_ID, - ShowWholeTrade:true + ShowWholeTrade:false } let res = { categories:[], @@ -229,6 +299,36 @@ export default { console.log('res',res) this.levelTopList = res }, + async getBandLevelList(){ + let req = { + ProvinceCode:'340000', + StatisticsDate:this.time, + ServerpartId:this.serviceInfo.Serverpart_ID, + ShowWholeBrand:false + } + let res =[] + let totalData = await request.$webGet('CommercialApi/Revenue/GetBusinessBrandLevel',req) + console.log('品牌消费水平',totalData) + totalData.Result_Data.legend.forEach(item=>{ + res.push({name:item,small:0,normal:0,big:0}) + }) + res.forEach((item,index)=>{ + totalData.Result_Data.ColumnList.forEach((subItem,subIndex)=>{ + if (subItem.name==='低消费'){ + item.small = subItem.data[index] + }else if(subItem.name==='普通消费'){ + item.normal = subItem.data[index] + }else if(subItem.name==='高消费'){ + item.big = subItem.data[index] + } + }) + }) + // let res=[{name:'五芳斋',big:'14.8',normal:'41.7',small:'43.5'}, + // {name:'驿佰购',big:'44.1',normal:'31.7',small:'24.2'}, + // {name:'老娘舅',big:'15.2',normal:'70.1',small:'14.5'}, + // {name:'吉祥馄饨',big:'25.2',normal:'39.9',small:'34.7'}] + this.bandLevelList = res + }, async getBusinessTypeList(){ const req = { ProvinceCode:'340000', @@ -244,7 +344,9 @@ export default { res.push({name:`${item.name} ${item.value}%`,value:Number(item.value),number:Number(item.data)}) all+=Number(item.value) }else if(index===11){ - res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2)),number:Number(item.data)}) + if (all<100){ + res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2)),number:Number(item.data)}) + } } }) let result= { @@ -333,35 +435,75 @@ export default { // } this.compareList = res }, - getBestsellerList(){ + async getBestsellerList(){ + let req = { + statisticsDate:this.time, + provinceCode:'340000', + Serverpart_ID:this.serviceInfo.Serverpart_ID, + SPRegionType_ID:this.serviceInfo.SPRegionType_ID + } + const data = await request.$webGet('CommercialApi/Revenue/GetSalableCommodity',req) + console.log('data222222222222',data) + let dataFirst = [{"name":"热销商品","value":data.Result_Data.SalableCommodity }, + {"name":"","value":100 - data.Result_Data.SalableCommodity}] + let listFirst = [] + let dataSecond = [{"name":"滞销商品","value":data.Result_Data.UnSalableCommodity}, + {"name":"","value":100 - data.Result_Data.UnSalableCommodity}] + let listSecond = [] + data.Result_Data.SalableCommodityList.forEach(item=>{ + listFirst.push({name:item.Commodity_name ,value:item.Proportion }) + }) + data.Result_Data.UnSalableCommodityList .forEach(item=>{ + listSecond.push({name:item.Commodity_name ,value:item.Proportion }) + }) + + let res = [ { - series: [ + series:[ { - data: [{"name":"热销商品","value":39.8}, - {"name":"","value":60.2}], - list:[{name:'红牛',value:29.3}, - {name:'农夫山泉',value:25.6}, - {name:'康师傅红烧牛肉面桶装牛肉面桶装',value:16.5}, - {name:'方便面',value:15.2}, - {name:'其他',value:13.4}] + data:dataFirst, + list:listFirst } ] }, { - series: [ + series:[ { - data: [{"name":"滞销商品","value":21.6}, - {"name":"","value":78.4}], - list:[{name:'水杯',value:29.3}, - {name:'吸油纸',value:25.6}, - {name:'康师傅红烧牛肉面桶装牛肉面桶装',value:16.5}, - {name:'纸巾',value:15.2}, - {name:'其他',value:13.4}] + data:dataSecond, + list:listSecond } ] } ] + // let res = [ + // { + // series: [ + // { + // data: [{"name":"热销商品","value":39.8}, + // {"name":"","value":60.2}], + // list:[{name:'红牛',value:29.3}, + // {name:'农夫山泉',value:25.6}, + // {name:'康师傅红烧牛肉面桶装牛肉面桶装',value:16.5}, + // {name:'方便面',value:15.2}, + // {name:'其他',value:13.4}] + // } + // ] + // }, + // { + // series: [ + // { + // data: [{"name":"滞销商品","value":21.6}, + // {"name":"","value":78.4}], + // list:[{name:'水杯',value:29.3}, + // {name:'吸油纸',value:25.6}, + // {name:'康师傅红烧牛肉面桶装牛肉面桶装',value:16.5}, + // {name:'纸巾',value:15.2}, + // {name:'其他',value:13.4}] + // } + // ] + // } + // ] this.bestsellerList = res } } @@ -393,6 +535,43 @@ export default { margin-left: 4px; } } + .time{ + margin-bottom: 4px; + .thisTime{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 500; + color: #160002; + } + .select{ + margin-left: 8px; + display: inline-block; + .time { + display: flex; + align-items: center; + margin-right: 4px; + .day { + font-size: 32rpx; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #782717; + line-height: 44rpx; + margin-right: 4px; + } + .uni-input { + font-size: 14px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #ae664e; + line-height: 36rpx; + } + .icon { + width: 24px; + height: 16px; + } + } + } + } } } } diff --git a/pages/commercialBI/carPortrait.vue b/pages/commercialBI/carPortrait.vue index 84ebdcf..1e2c53f 100644 --- a/pages/commercialBI/carPortrait.vue +++ b/pages/commercialBI/carPortrait.vue @@ -58,7 +58,7 @@

月度车流累计

- +
@@ -108,7 +108,7 @@

{{thisMonth?thisMonth:'-'}}月入区车型占比

{{allEntry?allEntry:'-'}}% - + (较上月) {{addAllEntry?Math.abs(addAllEntry) + '%':'-' + '%'}} @@ -327,7 +327,7 @@ export default { this.labelList = list //分析的文字 const total = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',reqText) - this.analyseText = total.Result_Data.List[0].ANALYSIS_CONTENT + this.analyseText = total.Result_Data.List[0]?total.Result_Data.List[0].ANALYSIS_CONTENT:'' }, //当前最近的服务区数据 async nearestService(){ @@ -400,7 +400,11 @@ export default { if (monetCountMax { console.log('opts',opts) console.log('index',index) - return item.name + ',客单数量 ' + opts.series[index].number + '笔' + return item.name + ',客单数量 ' + opts.series[index].number + '笔,' + '客单均价 ' } }); uChartsInstance[e.target.id].touchLegend(e); diff --git a/pages/commercialBI/components/bussiness/consumptionCompare.vue b/pages/commercialBI/components/bussiness/consumptionCompare.vue index 9511058..63c7605 100644 --- a/pages/commercialBI/components/bussiness/consumptionCompare.vue +++ b/pages/commercialBI/components/bussiness/consumptionCompare.vue @@ -1,6 +1,6 @@ @@ -35,7 +35,7 @@ export default { uChartsInstance[e.target.id].showToolTip(e, { formatter: (item, category, index, opts) => { console.log('item',item) - if (item.name === 'name'){ + if (item.name === '客单数'){ return item.name + ':'+ item.data + '笔' }else{ return item.name + ':'+ item.data + '辆' diff --git a/pages/commercialBI/components/bussiness/levelTop.vue b/pages/commercialBI/components/bussiness/levelTop.vue index bde457f..aca2c13 100644 --- a/pages/commercialBI/components/bussiness/levelTop.vue +++ b/pages/commercialBI/components/bussiness/levelTop.vue @@ -1,7 +1,7 @@ @@ -31,6 +31,14 @@ export default { } }, methods: { + tap(e){ + uChartsInstance[e.target.id].showToolTip(e,{ + formatter: (item, category, index, opts) =>{ + return item.name + ' '+ item.data + '%'; + } + }); + uChartsInstance[e.target.id].touchLegend(e); + }, // 处理传入的数据 handleCarData(value) { let res = value @@ -93,7 +101,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('levelTop') + // this.canvasToTempImage('levelTop') },2000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/bussiness/timePeriodAnalysis.vue b/pages/commercialBI/components/bussiness/timePeriodAnalysis.vue index e8a4df2..ab3bc5e 100644 --- a/pages/commercialBI/components/bussiness/timePeriodAnalysis.vue +++ b/pages/commercialBI/components/bussiness/timePeriodAnalysis.vue @@ -43,7 +43,7 @@ export default { let phoneInfo = uni.getStorageSync('phoneInfo') this.width = phoneInfo.screenWidth - 32 uChartsInstance[id] = new uCharts({ - type: "bubble", + type: "area", context: ctx, width: _this.width, height: 200, @@ -85,9 +85,13 @@ export default { float: 'center', }, extra: { - bubble: { - border: 1, - opacity: 0.25 + area: { + type: "curve", + opacity: 0.2, + addLine: true, + width: 2, + gradient: true, + activeType: "hollow" } } }); diff --git a/pages/commercialBI/components/bussiness/transactionAnalysis.vue b/pages/commercialBI/components/bussiness/transactionAnalysis.vue index bea57a5..e729102 100644 --- a/pages/commercialBI/components/bussiness/transactionAnalysis.vue +++ b/pages/commercialBI/components/bussiness/transactionAnalysis.vue @@ -7,7 +7,7 @@
-

{{ info.AvgTicketPrice?info.AvgTicketPrice:'-' }}

+

{{ info.MonthAvgTicketPrice?info.MonthAvgTicketPrice:'-' }}

该服务区

diff --git a/pages/commercialBI/components/car/carTypeTime.vue b/pages/commercialBI/components/car/carTypeTime.vue index b1d597a..75d27f0 100644 --- a/pages/commercialBI/components/car/carTypeTime.vue +++ b/pages/commercialBI/components/car/carTypeTime.vue @@ -37,6 +37,7 @@ export default { watch: { data: { handler(value) { + console.log('value',value) this.info = value this.carTypeTimePath='' this.handleCarData(value) @@ -52,7 +53,7 @@ export default { formatter: (item, category, index, opts) =>{ if (this.num===0){ this.num++ - return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆'; + return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆,占比' + item.data + '%'; }else{ this.num=0 return '平均停留' + ":" + item.data + '分钟'; diff --git a/pages/commercialBI/components/car/homePlace.vue b/pages/commercialBI/components/car/homePlace.vue index d5f5942..84b3ee7 100644 --- a/pages/commercialBI/components/car/homePlace.vue +++ b/pages/commercialBI/components/car/homePlace.vue @@ -101,6 +101,7 @@ export default { return item.name + ":" + item.data + '辆'; } }); + uChartsInstance[e.target.id].touchLegend(e); }, // 处理传入的数据 handleCarData(value) { diff --git a/pages/commercialBI/components/car/monthTotal.vue b/pages/commercialBI/components/car/monthTotal.vue index 1a16ba9..3fbe274 100644 --- a/pages/commercialBI/components/car/monthTotal.vue +++ b/pages/commercialBI/components/car/monthTotal.vue @@ -63,7 +63,12 @@ export default { return 5 }else{ let sum = value + value *0.2 - return Number((sum / 5).toFixed(0)) * 5 + if (sum>0 && sum<5){ + return 5 + }else{ + console.log('sum',sum) + return Number((sum / 5).toFixed(0)) * 5 + } } }, drawCharts(id, data,config) { @@ -101,7 +106,7 @@ export default { disabled: false, axisLine: false, titleOffsetY: -5, - titleOffsetX: 15, + titleOffsetX: 25, min: 0, max:config.carMax }, diff --git a/pages/commercialBI/components/car/percentEntry.vue b/pages/commercialBI/components/car/percentEntry.vue index a1ae19a..6300ef8 100644 --- a/pages/commercialBI/components/car/percentEntry.vue +++ b/pages/commercialBI/components/car/percentEntry.vue @@ -37,7 +37,7 @@

{{item.value + '%'}}

- + {{item.addValue?Math.abs(item.addValue) + '%':'-' + '%'}} @@ -98,6 +98,7 @@ export default { }, // 处理传入的数据 handleCarData(value) { + console.log('valuePer',value) let Vehicle_CountAll=0 let SectionFlow_CountAll=0 let minAll = 0 @@ -118,8 +119,8 @@ export default { this.dataList[0].value = (minAll / Vehicle_CountAll*100).toFixed(2) this.dataList[1].value = (middleAll / Vehicle_CountAll*100).toFixed(2) this.dataList[2].value = (bigAll / Vehicle_CountAll*100).toFixed(2) - this.dataList[0].addValue = value[0].MinVehicleEntry_Rate - this.dataList[1].addValue = value[0].MediumVehicleEntry_Rate + this.dataList[0].addValue = value[0].MinVehicleEntry_GrowthRate + this.dataList[1].addValue = value[0].MediumVehicleEntry_GrowthRate this.dataList[2].addValue = value[0].LargeVehicleEntry_GrowthRate let list = [] this.dataList.forEach(item=>{ diff --git a/pages/commercialBI/components/car/timeAnalysis.vue b/pages/commercialBI/components/car/timeAnalysis.vue index a988789..2cc2d3d 100644 --- a/pages/commercialBI/components/car/timeAnalysis.vue +++ b/pages/commercialBI/components/car/timeAnalysis.vue @@ -44,7 +44,11 @@ export default { //点击事件 handleTap(e){ uChartsInstance[e.target.id].touchLegend(e); - uChartsInstance[e.target.id].showToolTip(e); + uChartsInstance[e.target.id].showToolTip(e,{ + formatter: (item, category, index, opts) =>{ + return item.name + ":" + item.data + '分钟' + } + }); }, // 处理传入的数据 handleCarData(value) { diff --git a/pages/commercialBI/components/format/bandLevel.vue b/pages/commercialBI/components/format/bandLevel.vue index 60a0f44..87b4fcc 100644 --- a/pages/commercialBI/components/format/bandLevel.vue +++ b/pages/commercialBI/components/format/bandLevel.vue @@ -3,10 +3,11 @@

{{item.name}}

-
{{item.small<16?'':item.small+'%'}}
-
{{item.normal<16?'':item.normal + '%'}}
-
{{item.big<16?'':item.big + '%'}}
+
{{item.small<16?'':item.small+'%'}}
+
{{item.normal<16?'':item.normal + '%'}}
+
{{item.big<16?'':item.big + '%'}}
+
{{typeText}}{{typeValue}}
@@ -33,7 +34,13 @@ export default { name: "bandLevel", data() { return { - dataList: [] + dataList: [], + isShow: false, + typeText:'', + typeValue:'', + selectName:'', + position:'',//left 或者 right + positionWidth:'',// 定位百分比 } }, props: { @@ -52,7 +59,39 @@ export default { } }, methods: { - + handleClick(e,type,item){ + console.log('index',item) + this.selectName = item.name + let phoneInfo = uni.getStorageSync('phoneInfo') + let width = phoneInfo.screenWidth + let startWidth = width * 0.2 + let endWidth = width * 0.6 + let now = e.detail.x + console.log('now',now) + this.isShow = true + if (nowstartWidth && nowendWidth){ + this.position = 'right' + this.positionWidth = 0 + } + if (type==='small'){ + this.typeText = '低消费' + this.typeValue = item.small + '%' + }else if(type === 'normal'){ + this.typeText = '普通消费' + this.typeValue = item.normal + '%' + }else if(type === 'big'){ + this.typeText = '高消费' + this.typeValue = item.big + '%' + } + console.log('e',e) + console.log('type',type) + } } } @@ -62,6 +101,8 @@ export default { width: 100%; margin-top: 12px; .bandItem{ + width: 100%; + position: relative; margin-bottom: 12px; .title{ font-size: 14px; @@ -70,6 +111,16 @@ export default { color: #160002; line-height: 20px; } + .meng{ + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + top: 0; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + } .progress{ width: 100%; height: 20px; diff --git a/pages/commercialBI/components/format/consumLevel.vue b/pages/commercialBI/components/format/consumLevel.vue index a470379..fc53c54 100644 --- a/pages/commercialBI/components/format/consumLevel.vue +++ b/pages/commercialBI/components/format/consumLevel.vue @@ -1,7 +1,7 @@ @@ -32,6 +32,14 @@ export default { } }, methods: { + tap(e){ + uChartsInstance[e.target.id].showToolTip(e,{ + formatter: (item, category, index, opts) =>{ + return item.name + item.data + '%'; + } + }); + uChartsInstance[e.target.id].touchLegend(e); + }, // 处理传入的数据 handleCarData(value) { let res = value @@ -96,7 +104,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('level') + // this.canvasToTempImage('level') },2000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/format/fillingDegree.vue b/pages/commercialBI/components/format/fillingDegree.vue index 477c031..d28e0dd 100644 --- a/pages/commercialBI/components/format/fillingDegree.vue +++ b/pages/commercialBI/components/format/fillingDegree.vue @@ -1,8 +1,8 @@ @@ -14,8 +14,10 @@ export default { name: "fillingDegree", data() { return { - width:0, - fillDegreePath:'' + width:0, + fillDegreePath:'', + selectIndex: 0, + dataList : [] } }, props: { @@ -34,6 +36,26 @@ export default { } }, methods: { + handleChange(type){ + if (type==='canvas'){ + this.$emit('handleChangeBandLevel',this.selectIndex) + }else{ + this.$emit('handleChangeBandLevel',false) + } + }, + tap(e){ + uChartsInstance[e.target.id].showToolTip(e,{ + formatter: (item, category, index, opts) =>{ + this.selectIndex = opts.series[index].key + this.handleChange('canvas') + console.log('item',item) + console.log('opts',opts) + console.log('index',index) + return item.name; + } + }); + uChartsInstance[e.target.id].touchLegend(e); + }, // 处理传入的数据 handleCarData(value) { let res = value.result @@ -59,7 +81,7 @@ export default { background: "#FFFFFF", color: ["#1E80FF", "#00C2FF","#6B6FFF","#38C275","#F3BC1B","#ED6B5A","#FF9845","#74839D","#ACB9CD","#CAD0DA"], padding: [5, 5, 5, 5], - dataLabel: true, + dataLabel: false, enableScroll: false, title: { name:config.Abundant?'盈足':'不盈足', @@ -68,9 +90,9 @@ export default { }, legend: { show: true, - position: "bottom", + position: "right", lineHeight: 25, - float: 'left' + float: 'center' }, extra: { @@ -87,7 +109,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('fillDegree') + // this.canvasToTempImage('fillDegree') },2000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/guest/customerFirst.vue b/pages/commercialBI/components/guest/customerFirst.vue index 751bd12..68e7082 100644 --- a/pages/commercialBI/components/guest/customerFirst.vue +++ b/pages/commercialBI/components/guest/customerFirst.vue @@ -8,10 +8,18 @@

{{ info.TicketCount?info.TicketCount:'-' }}

-

入区车辆 /笔

+

客单交易 /笔

{{ info.AvgTicketPrice?info.AvgTicketPrice:'-' }}

+

客单均价 /元

+
+
+

{{ info.VehicleCount?info.VehicleCount:'-' }}

+

入区车辆 /辆

+
+
+

{{ info.AvgVehicleAmount ?info.AvgVehicleAmount :'-' }}

单车价值 /元

@@ -31,11 +39,11 @@

客单均价 /元

-

{{ info.TicketAvgCount?info.TicketAvgCount:'-' }}

-

入区车辆 /笔

+

{{ info.MonthVehicleCount?info.MonthVehicleCount:'-' }}

+

入区车辆 /辆

-

{{ info.MonthAvgTicketPrice?info.MonthAvgTicketPrice:'-' }}

+

{{ info.MonthVehicleAmount?info.MonthVehicleAmount:'-' }}

单车价值 /元

@@ -43,13 +51,13 @@
- {{'高消费'}} + 高消费: {{info.transactionLevel.HighConsumption_Count }}笔
- {{'普通消费'}} + 普通消费: {{info.transactionLevel.NormalConsumption_Count }}笔
- {{'低消费'}} + 低消费: {{info.transactionLevel.LowConsumption_Count }}笔
@@ -184,9 +192,8 @@ export default { background: #1E80FF; border-radius: 2px 0 0 2px; .meng{ - width: 70px; + width: 110px; height: 20px; - box-sizing: border-box; line-height: 20px; position: absolute; display: inline-block; @@ -196,6 +203,7 @@ export default { background: rgba(0,0,0,0.6); color:#fff; border-radius: 2px; + text-align: center; } } .normal{ @@ -204,9 +212,8 @@ export default { background: #ACB9CD; border-radius: 2px 0 0 2px; .meng{ - width: 70px; + width: 110px; height: 20px; - box-sizing: border-box; line-height: 20px; position: absolute; display: inline-block; @@ -216,6 +223,7 @@ export default { background: rgba(0,0,0,0.6); color:#fff; border-radius: 2px; + text-align: center; } } .small{ @@ -224,9 +232,8 @@ export default { background: #CAD0DA; border-radius: 2px 0 0 2px; .meng{ - width: 70px; + width: 110px; height: 20px; - box-sizing: border-box; line-height: 20px; position: absolute; display: inline-block; @@ -236,6 +243,7 @@ export default { background: rgba(0,0,0,0.6); color:#fff; border-radius: 2px; + text-align: center; } } } diff --git a/pages/commercialBI/components/guest/customerSecond.vue b/pages/commercialBI/components/guest/customerSecond.vue index b0bae07..f68e457 100644 --- a/pages/commercialBI/components/guest/customerSecond.vue +++ b/pages/commercialBI/components/guest/customerSecond.vue @@ -228,11 +228,15 @@ export default { margin-right: 2px; border-radius: 2px 0 0 2px; .meng{ + width: 90px; + line-height: 24px; + text-align: center; + height: 24px; position: absolute; display: inline-block; padding: 0 5px; z-index: 9; - left: 0;top: -10px; + left: 0;top: -20px; background: rgba(0,0,0,0.6); color:#fff; border-radius: 2px; @@ -255,14 +259,18 @@ export default { background: #00C2FF; border-radius: 0 2px 2px 0 ; .meng{ - position: absolute; - display: inline-block; - padding: 0 5px; - z-index: 9; - right: 0;top: -10px; - background: rgba(0,0,0,0.6); - color:#fff; - border-radius: 2px; + width: 90px; + line-height: 24px; + text-align: center; + height: 24px; + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + left: 0;top: -20px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; } } .woman:after{ diff --git a/pages/commercialBI/components/headerTop.vue b/pages/commercialBI/components/headerTop.vue index 0007306..7461b34 100644 --- a/pages/commercialBI/components/headerTop.vue +++ b/pages/commercialBI/components/headerTop.vue @@ -147,7 +147,7 @@ export default { this.labelList = list //分析的文字 const total = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',reqText) - this.analyseText = total.Result_Data.List[0].ANALYSIS_CONTENT + this.analyseText = total.Result_Data.List[0]?total.Result_Data.List[0].ANALYSIS_CONTENT:'' }, bindPickerChange(){ diff --git a/pages/commercialBI/components/manager/moneyCompare.vue b/pages/commercialBI/components/manager/moneyCompare.vue index 027f83e..bc449b3 100644 --- a/pages/commercialBI/components/manager/moneyCompare.vue +++ b/pages/commercialBI/components/manager/moneyCompare.vue @@ -42,7 +42,16 @@ export default { console.log('dataList',this.dataList) uChartsInstance[e.target.id].showToolTip(e, { formatter: (item, category, index, opts) => { - return item.name + ":" + item.data + '万元' + console.log('item',item) + console.log('opts',opts) + console.log('index',index) + if (this.selectIndex === 0){ + return item.name + ":" + item.data + '万元,' + '环比: ' + }else if(this.selectIndex === 1){ + return item.name + ":" + item.data + '笔' + }else { + return item.name + ":" + item.data + '元' + } // if (this.selectIndex===0){ // if (item.name === '平日平均'){ // return item.name + ":" + this.dataList.normal[0].data[index] + '元'; diff --git a/pages/commercialBI/components/noData.vue b/pages/commercialBI/components/noData.vue index c5a4c7f..2994ca9 100644 --- a/pages/commercialBI/components/noData.vue +++ b/pages/commercialBI/components/noData.vue @@ -2,7 +2,7 @@

抱歉,服务区采集样本过小,无法分析

-

抱歉,第三方数据未传,无法分析

+

抱歉,数据为第三方接口传输,无法进行画像分析

diff --git a/pages/commercialBI/formatPortrait.vue b/pages/commercialBI/formatPortrait.vue index cd3edff..8a8bc08 100644 --- a/pages/commercialBI/formatPortrait.vue +++ b/pages/commercialBI/formatPortrait.vue @@ -7,13 +7,13 @@

业态充盈度

- +
-

品牌消费水平(Top 5)

+

品牌消费水平

@@ -21,7 +21,7 @@
-

业态消费水平(Top 5)

+

业态消费水平

@@ -119,6 +119,47 @@ export default { this.getBrandInfoList() }, methods:{ + // 业态充盈的改变事件 + async handleChangeBandLevel(key){ + console.log('key',key) + let req + if (key===false){ + req = { + ProvinceCode:'340000', + StatisticsDate:this.time, + ServerpartId:this.serviceInfo.Serverpart_ID, + ShowWholeBrand:false + } + }else{ + req = { + ProvinceCode:'340000', + StatisticsDate:this.time, + ServerpartId:this.serviceInfo.Serverpart_ID, + BusinessTradeIds: key, + ShowWholeBrand:false + } + } + let res =[] + let totalData = await request.$webGet('CommercialApi/Revenue/GetBusinessBrandLevel',req) + if (totalData.Result_Data){ + console.log('品牌消费水平',totalData) + totalData.Result_Data.legend.forEach(item=>{ + res.push({name:item,small:0,normal:0,big:0}) + }) + res.forEach((item,index)=>{ + totalData.Result_Data.ColumnList.forEach((subItem,subIndex)=>{ + if (subItem.name==='低消费'){ + item.small = subItem.data[index] + }else if(subItem.name==='普通消费'){ + item.normal = subItem.data[index] + }else if(subItem.name==='高消费'){ + item.big = subItem.data[index] + } + }) + }) + } + this.bandLevelList = res + }, async nearestService(){ let seat = uni.getStorageSync('seatInfo'); let req = { @@ -142,17 +183,19 @@ export default { const req = { ProvinceCode:'340000', StatisticsDate:this.time, - serverpartId:this.serviceInfo.Serverpart_ID + serverpartId:this.serviceInfo.Serverpart_ID, + BusinessTradeIds:-1 } const data = await request.$webGet('CommercialApi/Revenue/GetBusinessTradeRevenue',req) + console.log('data21312312',data) let res = [] let all = 0 data.Result_Data.BusinessTradeRank.forEach((item,index)=>{ if (index<=10){ - res.push({name:`${item.name} ${item.value}%`,value:Number(item.value)}) + res.push({name:`${item.name} ${item.value}%`,value:Number(item.value),key:item.key}) all+=Number(item.value) }else if(index===11){ - res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2))}) + res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2)),key:item.key}) } }) console.log('res21312312',res) @@ -193,6 +236,7 @@ export default { } let res =[] let totalData = await request.$webGet('CommercialApi/Revenue/GetBusinessBrandLevel',req) + console.log('品牌消费水平',totalData) totalData.Result_Data.legend.forEach(item=>{ res.push({name:item,small:0,normal:0,big:0}) }) diff --git a/pages/commercialBI/guestPortrait.vue b/pages/commercialBI/guestPortrait.vue index 82a2eae..538cc17 100644 --- a/pages/commercialBI/guestPortrait.vue +++ b/pages/commercialBI/guestPortrait.vue @@ -26,6 +26,7 @@
+

{{thisMonth?thisMonth:'-'}}月客群特征分析

@@ -78,7 +79,6 @@ export default { data() { return { topBg:'linear-gradient(180deg, #A1D0C1 0%, #B1D9CD 100%);',//顶部组件的悬浮背景色 - labelList:['女性','高消费','喜爱奶茶','浙江','20-30岁','江苏'],//标签 title:'客群画像',//页面标题 bgColor:'180deg, #30C8ED 0%, #0B9353 100%',//标签背景颜色 bgUrl:'https://eshangtech.com/ShopICO/ahyd-BID/commercial/guestPortraitBg.svg',//背景图片路径 @@ -239,7 +239,7 @@ export default { res:[] } const req = { - statisticsType:2, + statisticsType:1, provinceCode:'340000', serverpartId:this.serviceInfo.Serverpart_ID, statisticsMonth:this.$util.getThisMonth(time) @@ -377,7 +377,10 @@ export default { res.push({name:`${item.name} ${item.value}%`,value:Number(item.value)}) all+=Number(item.value) }else if(index===5){ - res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2))}) + console.log('all',all) + if (all<100){ + res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2))}) + } } }) let result = [ diff --git a/pages/commercialBI/managePortrait.vue b/pages/commercialBI/managePortrait.vue index be0a5f6..9841bb0 100644 --- a/pages/commercialBI/managePortrait.vue +++ b/pages/commercialBI/managePortrait.vue @@ -596,9 +596,15 @@ export default { this.trendsList = res }, async getRevenueType(){ + const date = new Date(this.time) + let y = date.getFullYear() + let m = date.getMonth() + 1 + if (m<10){ + m = '0'+ m + } const req = { pushProvinceCode:'340000', - Statistics_StartDate:this.time, + Statistics_StartDate:`${y}-${m}-01`, Statistics_Date:this.time, Serverpart_ID:this.serviceInfo.Serverpart_ID } diff --git a/pages/commercialBI/serviceDetail.vue b/pages/commercialBI/serviceDetail.vue index a929a82..3ff1fda 100644 --- a/pages/commercialBI/serviceDetail.vue +++ b/pages/commercialBI/serviceDetail.vue @@ -3,7 +3,7 @@

{{serviceInfo.name}}服务区自营计划

{{serviceInfo.name}}服务区年度自营计划

-
+
{{ single }} @@ -87,98 +87,127 @@

{{month}}月预算完成度

-
-
- {{item.node.ACCOUNT_CODE}} -
-

{{item.node.BUDGETDETAIL_AMOUNT }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

-

{{item.node.REVENUE_AMOUNT?item.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

- - -

{{item.node.Growth_Rate?Math.abs(item.node.Growth_Rate) + '%':'-' }}

- {{item.node.Growth_Rate>0?'(提升)':item.node.Growth_Rate<0?'(降低)':'-'}} -
-
+
+
-
-

{{subItem.node.ACCOUNT_CODE}}

- -
-

{{subItem.node.BUDGETDETAIL_AMOUNT}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

-

{{subItem.node.REVENUE_AMOUNT?subItem.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

- - - -

{{subItem.node.Growth_Rate?Math.abs(subItem.node.Growth_Rate) + '%':'-'}}

- {{subItem.node.Growth_Rate>0?'(提升)':subItem.node.Growth_Rate<0?'(降低)':''}} -
-
- -
- {{thirdItem.node.ACCOUNT_CODE}} - -
-

{{thirdItem.node.BUDGETDETAIL_AMOUNT}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

-

{{thirdItem.node.REVENUE_AMOUNT?thirdItem.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

- - - -

{{thirdItem.node.Growth_Rate?Math.abs(thirdItem.node.Growth_Rate) + '%':'-'}}

- {{thirdItem.node.Growth_Rate>0?'(提升)':thirdItem.node.Growth_Rate<0?'(降低)':''}} -
-
- - - - - - - - - - - - - -
-
+
+

{{item.node.ACCOUNT_CODE}}

+
+

{{item.node.BUDGETDETAIL_AMOUNT?item.node.BUDGETDETAIL_AMOUNT:''}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

+

{{item.node.REVENUE_AMOUNT?item.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

+ + +

{{item.node.Growth_Rate?Math.abs(item.node.Growth_Rate) + '%':'-'}}

+ {{item.node.Growth_Rate>0?'(提升)':item.node.Growth_Rate<0?'(降低)':''}} +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + {{item.node.ACCOUNT_CODE}} + +
+

{{item.node.BUDGETDETAIL_AMOUNT }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

+

{{item.node.REVENUE_AMOUNT?item.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

+ + +

{{item.node.Growth_Rate?Math.abs(item.node.Growth_Rate) + '%':'-' }}

+ {{item.node.Growth_Rate>0?'(提升)':item.node.Growth_Rate<0?'(降低)':'-'}} +
+
+ +
+ +
+

{{subItem.node.ACCOUNT_CODE}}

+
+

{{subItem.node.BUDGETDETAIL_AMOUNT?subItem.node.BUDGETDETAIL_AMOUNT:''}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

+

{{subItem.node.REVENUE_AMOUNT?subItem.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

+ + +

{{subItem.node.Growth_Rate?Math.abs(subItem.node.Growth_Rate) + '%':'-'}}

+ {{subItem.node.Growth_Rate>0?'(提升)':subItem.node.Growth_Rate<0?'(降低)':''}} +
+
+
+ +

{{subItem.node.ACCOUNT_CODE}}

+ +
+

{{subItem.node.BUDGETDETAIL_AMOUNT?subItem.node.BUDGETDETAIL_AMOUNT:''}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

+

{{subItem.node.REVENUE_AMOUNT?subItem.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

+ + + +

{{subItem.node.Growth_Rate?Math.abs(subItem.node.Growth_Rate) + '%':'-'}}

+ {{subItem.node.Growth_Rate>0?'(提升)':subItem.node.Growth_Rate<0?'(降低)':''}} +
+
+ +
+ {{thirdItem.node.ACCOUNT_CODE}} + +
+

{{thirdItem.node.BUDGETDETAIL_AMOUNT}}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(计划)

+

{{thirdItem.node.REVENUE_AMOUNT?thirdItem.node.REVENUE_AMOUNT:'-' }}{{item.node.ACCOUNT_CODE==='毛利率'?'%':'元'}}(实际)

+ + + +

{{thirdItem.node.Growth_Rate?Math.abs(thirdItem.node.Growth_Rate) + '%':'-'}}

+ {{thirdItem.node.Growth_Rate>0?'(提升)':thirdItem.node.Growth_Rate<0?'(降低)':''}} +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -249,6 +278,7 @@ export default { this.month = '0' + this.month } this.serviceInfo = JSON.parse(option.serviceInfo) + console.log('this.serviceInfo',this.serviceInfo) this.serviceInfo.Budget_Degree =this.$util.fmoney(this.serviceInfo.Budget_Degree) this.getData() }else { @@ -268,12 +298,19 @@ export default { title: `${this.serviceInfo.SERVERPART_NAME || this.serviceInfo.Serverpart_Name}年度计划`, }) } - - let storeTime = uni.getStorageSync('lastDay') - if (storeTime){ - this.time = storeTime + if (this.month){ + const date = new Date() + let y = date.getFullYear() + let time = `${y}-${this.month}` + this.single = this.$util.getThisMonthHave(time) + }else{ + let storeTime = uni.getStorageSync('lastDay') + if (storeTime){ + this.time = storeTime + } + this.single = this.$util.getThisMonthHave(this.time) } - this.single = this.$util.getThisMonthHave(this.time) + let nowTime = new Date() let y = nowTime.getFullYear() let month = nowTime.getMonth() + 1 @@ -319,6 +356,68 @@ export default { this.endTime = e.detail.value + '-' + d console.log('e',e) this.getData(e.detail.value) + //修改顶部服务区数据的方法 + this.getServiceDate(e.detail.value) + if (this.type === 'month'){ + uni.setNavigationBarTitle({ + title: `${this.month}月${this.serviceInfo.SERVERPART_NAME || this.serviceInfo.Serverpart_Name}计划`, + }) + }else{ + uni.setNavigationBarTitle({ + title: `${this.serviceInfo.SERVERPART_NAME || this.serviceInfo.Serverpart_Name}年度计划`, + }) + } + }, + async getServiceDate(time){ + let reqTime + let date = new Date(time) + let currentDate = new Date() + let nowMonth = currentDate.getMonth() + 1 + let y = date.getFullYear() + let m = date.getMonth() + 1 + if (m === nowMonth){ + let nowYear = currentDate.getFullYear() + let nodDay = currentDate.getDate() + if (nowMonth<10){ + nowMonth = '0' + nowMonth + } + if (nodDay<10){ + nodDay = '0' + nodDay + } + reqTime = `${nowYear}-${nowMonth}-${nodDay}` + }else{ + let howDay = this.$util.getThisMonthDay(time) + if (m<10){ + m = '0' + m + } + reqTime = `${y}-${m}-${howDay}` + } + let req = { + Province_Code:'340000', + Statistics_Date:reqTime, + Serverpart_ID:this.serviceInfo.Serverpart_ID, + SPRegionType_ID:this.serviceInfo.SPRegionType_ID + } + const data = await request.$webGet('CommercialApi/Revenue/GetRevenueBudget',req) + + let service = { + Budget_Amount:this.$util.fmoney(data.Result_Data.BudgetMonth_Amount), + Budget_Degree:data.Result_Data.MonthBudget_Degree, + Growth_Rate:data.Result_Data.MonthGrowth_Rate, + Revenue_Amount:this.$util.fmoney(data.Result_Data.RevenueMonth_Amount), + Serverpart_ID:this.serviceInfo.Serverpart_ID, + Serverpart_Name:this.serviceInfo.Serverpart_Name + } + let num = service.Serverpart_Name.indexOf('服务区') + console.log(num) + if (num!==-1){ + service.name = service.Serverpart_Name.slice(0,num) + service.unit = service.Serverpart_Name.slice(num,100) + }else{ + service.name = service.Serverpart_Name + } + this.serviceInfo = service + console.log('service',service) }, async getYearData(){ let storeServiceInfo = uni.getStorageSync('currentService') @@ -347,7 +446,9 @@ export default { let y = date.getFullYear() let m = this.month let req = {} - if (nowMonth === m ){ + console.log('nowMonth',nowMonth) + console.log('m',m) + if (nowMonth === Number(m) ){ req = { BUDGETPROJECT_YEAR: y, STATISTICS_MONTH:`${y}${m}`, @@ -355,13 +456,21 @@ export default { ACCOUNT_CODE:'6001,6401,6402', STATISTICS_DATE: time } + console.log('req',req) }else{ - let reqDate = new Date(changeTime) - let y = reqDate.getFullYear() - let m = reqDate.getMonth() + 1 - if (m<10){ - m = '0' + m + let reqDate + let m + if (changeTime){ + reqDate = new Date(changeTime) + m = reqDate.getMonth() + 1 + if (m<10){ + m = '0' + m + } + }else{ + reqDate = new Date() + m = this.month } + let y = reqDate.getFullYear() req = { BUDGETPROJECT_YEAR: y, STATISTICS_MONTH: `${y}${m}`, @@ -375,9 +484,13 @@ export default { this.dataList.forEach(item=>{ if (item.children){ item.children = this.editData(item.children) + if (item.node.ShowRevenue_Amount){ + item.node.BUDGETDETAIL_AMOUNT = item.node.BUDGETDETAIL_AMOUNT ? this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT):'' + item.node.REVENUE_AMOUNT = this.$util.fmoney(item.node.REVENUE_AMOUNT) + } }else{ if (item.node.BUDGETDETAIL_AMOUNT){ - item.node.BUDGETDETAIL_AMOUNT = this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT) + item.node.BUDGETDETAIL_AMOUNT = item.node.BUDGETDETAIL_AMOUNT ? this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT):'' item.node.REVENUE_AMOUNT = this.$util.fmoney(item.node.REVENUE_AMOUNT) }else{ item.node.BUDGETDETAIL_AMOUNT = '-' @@ -391,9 +504,13 @@ export default { value.forEach(item=>{ if (item.children){ item.children = this.editData(item.children) + if (item.node.ShowRevenue_Amount){ + item.node.BUDGETDETAIL_AMOUNT = item.node.BUDGETDETAIL_AMOUNT ? this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT) :'' + item.node.REVENUE_AMOUNT = this.$util.fmoney(item.node.REVENUE_AMOUNT) + } }else{ if (item.node.BUDGETDETAIL_AMOUNT){ - item.node.BUDGETDETAIL_AMOUNT = this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT) + item.node.BUDGETDETAIL_AMOUNT = item.node.BUDGETDETAIL_AMOUNT ? this.$util.fmoney(item.node.BUDGETDETAIL_AMOUNT) :'' item.node.REVENUE_AMOUNT = this.$util.fmoney(item.node.REVENUE_AMOUNT) }else{ item.node.BUDGETDETAIL_AMOUNT = '-' @@ -645,15 +762,113 @@ export default { } .firstBox{ margin-top: 8px; + .valueBox{ + display: inline-block; + text-align: right; .firstTitle{ - display: inline-block; - width: 180px; - font-size: 16px; + display: inline-block; + width: 180px; + font-size: 16px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + text-align: left; + } + .addBox{ + display: flex; + align-items: center; + justify-content: flex-end; + .addIcon { + width: 16px; + height: 16px; + margin-right: 2px; + } + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + .value{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + color: #160002; + line-height: 22px; + padding-left: 10px; + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + } + .firstTitle{ + display: inline-block; + width: 180px; + font-size: 16px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + } + .boxTop{ + display: flex; + justify-content: space-between; + .firstTitle{ + display: inline-block; + width: 180px; + font-size: 16px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + } + .amount{ + display: inline-block; + text-align: right; + .addBox{ + display: flex; + align-items: center; + justify-content: flex-end; + .addIcon { + width: 16px; + height: 16px; + margin-right: 2px; + } + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + .value{ + font-size: 14px; font-family: PingFangSC-Semibold, PingFang SC; - font-weight: 600; color: #160002; line-height: 22px; + padding-left: 10px; + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } } + } + .valueBox{ display: inline-block; text-align: right; @@ -693,30 +908,146 @@ export default { } .subBox{ margin-top: 4px; + .valueBox{ + display: inline-block; + text-align: right; .subTitle{ - font-size: 14px; - font-family: PingFangSC-Semibold, PingFang SC; - font-weight: 600; - color: #160002; - line-height: 22px; - padding-left: 10px; - display: inline-block; - width: 120px; + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + padding-left: 10px; + display: inline-block; + width: 120px; + text-align: left; } + .addBox{ + display: flex; + align-items: center; + justify-content: flex-end; + .addIcon { + width: 16px; + height: 16px; + margin-right: 2px; + } + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + .value{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + color: #160002; + line-height: 22px; + padding-left: 10px; + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + } + .subTitle{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + padding-left: 10px; + display: inline-block; + width: 120px; + } + .boxTop{ + display: flex; + justify-content: space-between; + .subTitle{ + font-size: 14px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + padding-left: 10px; + display: inline-block; + width: 120px; + } + + } + .thirdBox{ display: flex; justify-content: space-between; margin-bottom: 8px; + .thirdTitle{ + font-size: 12px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + padding-left: 30px; + display: inline-block; + width: 130px; + } + .boxTop{ + display: flex; + justify-content: space-between; .thirdTitle{ - font-size: 12px; + font-size: 12px; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 22px; + padding-left: 30px; + display: inline-block; + width: 130px; + } + .amount{ + display: inline-block; + text-align: right; + .addBox{ + display: flex; + align-items: center; + justify-content: flex-end; + .addIcon { + width: 16px; + height: 16px; + margin-right: 2px; + } + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } + .value{ + font-size: 14px; font-family: PingFangSC-Semibold, PingFang SC; - font-weight: 600; color: #160002; line-height: 22px; - padding-left: 30px; - display: inline-block; - width: 130px; + padding-left: 10px; + .type{ + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #a69e9f; + line-height: 18px; + white-space: nowrap; + } + } } + } + .valueBox{ display: inline-block; text-align: right; diff --git a/pages/index/index.vue b/pages/index/index.vue index cca5bb6..8d9ff64 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -19,7 +19,7 @@

对客营收

- {{plan.RevenueMonth_Amount?plan.RevenueMonth_Amount:'-'}}({{thisMonth?thisMonth:'-'}}月累计) + {{monthAmountAdd?monthAmountAdd:'-'}}({{thisMonth?thisMonth:'-'}}月累计)
@@ -403,6 +403,7 @@ export default { { name: '经营业态', value: 2 }, { name: '区域经营', value: 3 }], selectTab:1, // 选项卡的指针 + monthAmountAdd:'',//月累计 mobileData :{}, // 移动支付分账接口返回的数据 single:'', // 时间选择器选择的时间 monthAdd:'',//月每天的相对增加 @@ -432,9 +433,11 @@ export default { option:{},//onLoad里面的option isShow:false, //投诉建议是否显示 isShowTitle:0,//投诉建议条数 + isShowId:0,//投诉id plan:{},//月度和年度接口的返回参数 一起的 ShareShopCountYes:0,//昨日的店铺数 yesterdayAllPay:0,//前一天的营收总额 + noChangeLastDay: lastDay, wechatPushSalesList: null, // 甘肃单品排行数据 seat:{},//用户经纬度信息 nearServiceInfo:{ @@ -446,7 +449,8 @@ export default { yearNoticeText:'', thisMonth:0,//拿到当前月份 isSuccess:false,//首页这些接口是否全部调用成功 - isReturn : true + isReturn : true, + isSuggestion:false,//可不可以看意见 } }, watch:{ @@ -458,8 +462,33 @@ export default { if (userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']===1){ this.isReturn = false } + if (userInfo.userData.AuthorityInfo['e2fb458b-d1bd-48fa-805e-fc93dc71efb7'] === 1 || userInfo.userData.AuthorityInfo['ea2fc404-d924-4c88-98de-1f4d96137745'] === 1){ + this.getSuggestion() + } + this.seat = uni.getStorageSync('seatInfo') + if (!this.seat){ + //获取用户的经纬度位置存在stroge里面 + wx.getFuzzyLocation({ + type:'gcj02', + altitude:true, + success: (res) =>{ + let seatInfo = { + latitude:res.latitude, + longitude:res.longitude + } + uni.setStorageSync('seatInfo', seatInfo); + this.seat = seatInfo + } + }) + }else{ + //拿到最近服务区的数据 + this.nearestService() + } if (!this.isReturn){ + console.log('watch') this.getData(this.option) + this.handleNoticeMonth() + this.handleNoticeYear() } }, deep:true @@ -536,17 +565,18 @@ export default { this.isReturn = false } if (!this.isReturn){ + let userInfo = uni.getStorageSync('vuex') + userInfo = JSON.parse(userInfo) + console.log('userInfo',userInfo.userData.AuthorityInfo) // 判断是否有投诉建议的悬浮框弹出 - for(let key in this.toDoMsg){ - if (key === 'd405ae13-3388-41c0-a5f6-d11194d0a943' && this.toDoMsg['d405ae13-3388-41c0-a5f6-d11194d0a943']){ - this.isShow = true - this.isShowTitle = this.toDoMsg['d405ae13-3388-41c0-a5f6-d11194d0a943'] - } + if (userInfo.userData.AuthorityInfo['e2fb458b-d1bd-48fa-805e-fc93dc71efb7'] === 1 || userInfo.userData.AuthorityInfo['ea2fc404-d924-4c88-98de-1f4d96137745'] === 1){ + this.getSuggestion() } //拿到option的值 this.option = option // 获取数据的方法 if (this.user.Membership_Id){ + console.log('onLoad') this.getData(option) } // 判断缓存中是否有位置信息 没有的话 向用户请求 拿到用户当前位置 @@ -601,6 +631,21 @@ export default { }, methods:{ ...mapActions(['memberLogin','getLoginCode']), + async getSuggestion(){ + let req = { + ModuleGuids:'e2fb458b-d1bd-48fa-805e-fc93dc71efb7,ea2fc404-d924-4c88-98de-1f4d96137745', + ProvinceCode:'340000' + } + const data = await request.$webGet('CommercialApi/Suggestion/GetMemberUnreadData',req) + if (data.Result_Data.data){ + if (data.Result_Data.data!=='0'){ + this.isShow = true + this.isShowTitle = data.Result_Data.data + this.isShowId = data.Result_Data.key + } + } + console.log('data111111111111',data) + }, // async handleNoticeMonth(){ let date = new Date(this.lastDay) @@ -620,10 +665,12 @@ export default { PageSize:10 } const data = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',req) - this.monthNoticeText = data.Result_Data.List[0].ANALYSIS_CONTENT + this.monthNoticeText = data.Result_Data.List[0]?data.Result_Data.List[0].ANALYSIS_CONTENT:'' }, async handleNoticeYear(){ + console.log('handleNoticeYear',this.lastDay) let date = new Date(this.lastDay) + console.log(2222) let y = date.getFullYear() let m = date.getMonth() + 1 if(m<10){ @@ -640,7 +687,9 @@ export default { PageSize:10 } const totalData = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',reqYear) - this.yearNoticeText = totalData.Result_Data.List[0].ANALYSIS_CONTENT + if (totalData.Result_Data.List[0]){ + this.yearNoticeText = totalData.Result_Data.List[0].ANALYSIS_CONTENT + } console.log('this.yearNoticeText ',this.yearNoticeText ) }, async nearestService(){ @@ -651,7 +700,7 @@ export default { latitude:seat.latitude, } const data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList',req) - console.log('data',data) + console.log('data1',data) let res = { SERVERPART_NAME:data.Result_Data.List[0].SERVERPART_NAME,//服务区 SPREGIONTYPE_NAME:data.Result_Data.List[0].SPREGIONTYPE_NAME,//片区 @@ -765,7 +814,12 @@ export default { this.$util.toNextRoute('redirectTo', '/pages/register/register') }, handleSearch(){ - this.$util.toNextRoute('navigateTo', '/pages/suggestion/suggestion') + let req = { + SuggestionIds:this.isShowId + } + request.$webGet('CommercialApi/Suggestion/RecordReadingLog',req).then(()=>{ + this.$util.toNextRoute('navigateTo', '/pages/suggestion/suggestion') + }) }, // 改变时间触发的方法 ,改变页面的内容数据 onRefresh(){ @@ -911,11 +965,12 @@ export default { ShowCompareRate: true } request.$webGet('CommercialApi/Revenue/GetSummaryRevenue',allPriceData).then(res=>{ + console.log('res222222',res) flag3 = true // 赋值给data中的这个对象 在请求完之后会进行统一的数据处理 let result = res.Result_Data for(let key in result){ - if (key!=='RevenuePushModel' && key!=='GrowthRate'){ + if (key!=='RevenuePushModel' && key!=='GrowthRate' && key!=='MonthRevenueAmount'){ let all = 0 // 先算出全部的总额数量 用来计算百分比 result[key].forEach(item=>{ @@ -931,7 +986,7 @@ export default { }) } } - + this.monthAmountAdd = this.$util.fmoney(result.MonthRevenueAmount) this.modelProgress = result.BusinessTypeList this.regionProgress = result.BusinessTradeList this.areaProgress = result.SPRegionList @@ -967,12 +1022,12 @@ export default { bindDateChange(e){ let isOnRefresh = false let startTime = new Date(this.startDate).getTime() - let endTime = new Date(this.lastDay).getTime() - 8 * 3600 * 1000 //结束时间戳 + let endTime = new Date(this.noChangeLastDay).getTime() - 8 * 3600 * 1000 //结束时间戳 const date = new Date(e.detail.value).getTime() - 8 * 3600 * 1000 let startDate = new Date(this.startDate) let startMonth = startDate.getMonth() + 1 let startDay = startDate.getDate() - let endDate = new Date(this.lastDay) + let endDate = new Date(this.noChangeLastDay) let endMonth = endDate.getMonth() + 1 let endDay = endDate.getDate() console.log('this.startDate',this.startDate)