From 99ce5e823364aadb8534667367cdb434f322aa62 Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Thu, 13 Apr 2023 20:55:51 +0800 Subject: [PATCH] update --- pages.json | 6 + pages/commercialBI/businessPortrait.vue | 57 +- pages/commercialBI/carPortrait.vue | 36 +- .../components/bussiness/businessFormat.vue | 24 +- .../bussiness/consumptionCompare.vue | 30 +- .../components/car/carTypeTime.vue | 22 +- .../components/car/monthTotal.vue | 24 +- .../components/guest/customerFirst.vue | 83 +- .../components/guest/customerSecond.vue | 2 +- .../components/manager/moneyCompare.vue | 40 +- .../components/manager/revenueAnalysis.vue | 21 +- pages/commercialBI/guestPortrait.vue | 4 +- pages/commercialBI/managePortrait.vue | 79 +- pages/commercialBI/planDetail.vue | 18 +- pages/commercialBI/serviceDetail.vue | 944 ++++++++++++++++++ pages/index/index.vue | 218 ++-- pages/map/index.vue | 5 +- 17 files changed, 1426 insertions(+), 187 deletions(-) create mode 100644 pages/commercialBI/serviceDetail.vue diff --git a/pages.json b/pages.json index 9d11088..bbd30a5 100644 --- a/pages.json +++ b/pages.json @@ -131,6 +131,12 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "serviceDetail", + "style": { + "navigationBarTitleText": "" + } } ] }, diff --git a/pages/commercialBI/businessPortrait.vue b/pages/commercialBI/businessPortrait.vue index a86444a..8d323f4 100644 --- a/pages/commercialBI/businessPortrait.vue +++ b/pages/commercialBI/businessPortrait.vue @@ -28,7 +28,7 @@
-

业态适配型

+

业态交易值占比

@@ -233,17 +233,18 @@ 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) + const data = await request.$webGet('CommercialApi/Revenue/GetBusinessTradeRevenue',req) 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),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))}) + res.push({name:`其他${(100-all).toFixed(2)}%`,value:Number((100 - all).toFixed(2)),number:Number(item.data)}) } }) let result= { @@ -263,32 +264,41 @@ export default { Serverpart_ID:this.serviceInfo.Serverpart_ID } const data = await request.$webGet('CommercialApi/Revenue/GetTransactionConvert',req) - + console.log('data123123',data) let customerOrder = [] let customerMax = 0 let carLit = [] let carLitMax = 0 - data.Result_Data.TransactionList.data.forEach(item=>{ - let index = item[0] - if (index === 0 ||index === 4 ||index === 8 ||index === 12 ||index === 16||index === 20||index === 23){ - if (customerMax0){ + data.Result_Data.TransactionList.data.forEach((item,index)=>{ + if (index % 2 === 1 && index!==data.Result_Data.TransactionList.data.length-1){ + + }else{ + if (customerMax{ - let index = item[0] - if (index === 0 ||index === 4 ||index === 8 ||index === 12 ||index === 16||index === 20||index === 23){ - if (carLitMax0){ + data.Result_Data.BayonetList.data.forEach((item,index)=>{ + if (index % 2 === 1 && index!==data.Result_Data.BayonetList.data.length-1){ + + }else{ + if (carLitMax
-

入区车流分析

+

昨日入区车流

{{time}}
@@ -55,7 +55,7 @@
-

{{thisMonth?thisMonth:'-'}}月入区车辆累计

+

月度车流累计

@@ -87,7 +87,7 @@
-

{{thisMonth?thisMonth:'-'}}月车辆类型占比-停留时间(日均)

+

{{thisMonth?thisMonth:'-'}}月车型停留分析/日均

@@ -95,7 +95,7 @@
-

{{thisMonth?thisMonth:'-'}}月车车辆类型-停留时间(日均)

+

{{thisMonth?thisMonth:'-'}}月车型停留分布图/日均

@@ -105,10 +105,11 @@
-

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

+

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

{{allEntry?allEntry:'-'}}% + (较上月) {{addAllEntry?Math.abs(addAllEntry) + '%':'-' + '%'}} @@ -387,12 +388,20 @@ export default { const data = await request.$webGet('CommercialApi/BigData/GetMonthAnalysis',req) let monthList = [] let carCount = [] + let carCountMax = 0 let moneyCount = [] + let monetCountMax = 0 let info = [] data.Result_Data.List.forEach(item=>{ monthList.push(item.Statistics_Month + '月') - carCount.push(Number((item.Vehicle_Count / 10000).toFixed(0))) - moneyCount.push(Number((item.RevenueAmount / 10000).toFixed(0))) + if (carCountMax{ let stayTime = [] + let stayTimeMax = 0 let carType = [] let valueList = [] let typeAll = 0 item.StayTimesList.forEach(subItem=>{ + if (stayTimeMax{ @@ -503,7 +516,8 @@ export default { series.push({ index:1, - name:'停留时间',data:stayTime + name:'停留时间',data:stayTime, + max:stayTimeMax }) series.push({ index:0, @@ -885,7 +899,7 @@ export default { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: #c97e64; + color: #a69e9f; line-height: 20px; } } diff --git a/pages/commercialBI/components/bussiness/businessFormat.vue b/pages/commercialBI/components/bussiness/businessFormat.vue index 964d326..b42f4e2 100644 --- a/pages/commercialBI/components/bussiness/businessFormat.vue +++ b/pages/commercialBI/components/bussiness/businessFormat.vue @@ -1,7 +1,7 @@ @@ -31,6 +31,16 @@ export default { } }, methods: { + tap(e){ + uChartsInstance[e.target.id].showToolTip(e, { + formatter: (item, category, index, opts) => { + console.log('opts',opts) + console.log('index',index) + return item.name + ',客单数量 ' + opts.series[index].number + '笔' + } + }); + uChartsInstance[e.target.id].touchLegend(e); + }, // 处理传入的数据 handleCarData(value) { let res = value @@ -51,9 +61,9 @@ export default { rotate: false, rotateLock: false, background: "#FFFFFF", - color: ["#1E80FF", "#00C2FF","#6B6FFF","#38C275","#F3BC1B","#ED6B5A","#FF9845","#74839D","#ACB9CD","#CAD0DA"], + color: ["#00C2FF","#6B6FFF","#38C275","#1E80FF", "#F3BC1B","#ED6B5A","#FF9845","#74839D","#ACB9CD","#CAD0DA"], padding: [5, 5, 5, 5], - dataLabel: true, + dataLabel: false, enableScroll: false, title: { name: '刚需型', @@ -67,9 +77,9 @@ export default { }, legend: { show: true, - position: "bottom", + position: "right", lineHeight: 25, - float: 'left' + float: 'center' }, extra: { @@ -86,7 +96,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('businessFormat') + // this.canvasToTempImage('businessFormat') },2000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/bussiness/consumptionCompare.vue b/pages/commercialBI/components/bussiness/consumptionCompare.vue index 5435055..9511058 100644 --- a/pages/commercialBI/components/bussiness/consumptionCompare.vue +++ b/pages/commercialBI/components/bussiness/consumptionCompare.vue @@ -1,7 +1,7 @@ @@ -31,6 +31,20 @@ export default { } }, methods: { + tap(e){ + uChartsInstance[e.target.id].showToolTip(e, { + formatter: (item, category, index, opts) => { + console.log('item',item) + if (item.name === 'name'){ + return item.name + ':'+ item.data + '笔' + }else{ + return item.name + ':'+ item.data + '辆' + } + + } + }); + uChartsInstance[e.target.id].touchLegend(e); + }, // 处理传入的数据 handleCarData(value) { console.log('value',value) @@ -71,8 +85,12 @@ export default { disableGrid: true, axisLineColor:"#F2F2F5", formatter: (val)=>{ - if (val==='0:00' || val==='4:00'|| val==='8:00'|| val==='12:00'|| val==='16:00'|| val==='20:00'|| val==='24:00'){ - return val + if (val==='0:00' || val==='4:00'|| val==='8:00'|| val==='12:00'|| val==='16:00'|| val==='20:00'|| val==='23:00'){ + if (val === '23:00'){ + return '24:00' + }else{ + return val + } }else{ return '' } @@ -99,7 +117,7 @@ export default { max:_this.getNumber(config.carLitMax), position: 'right', titleOffsetY: -5, - titleOffsetX: 5, + titleOffsetX: -15, axisLineColor:"#F2F2F5" }, ] @@ -123,7 +141,7 @@ export default { } }); setTimeout( ()=>{ - this.canvasToTempImage('consumption') + // this.canvasToTempImage('consumption') },2000) }, canvasToTempImage(id){ diff --git a/pages/commercialBI/components/car/carTypeTime.vue b/pages/commercialBI/components/car/carTypeTime.vue index 852e5e3..b1d597a 100644 --- a/pages/commercialBI/components/car/carTypeTime.vue +++ b/pages/commercialBI/components/car/carTypeTime.vue @@ -52,10 +52,10 @@ export default { formatter: (item, category, index, opts) =>{ if (this.num===0){ this.num++ - return item.name + ":" + opts.series[0].valueList[index] + '辆'; + return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆'; }else{ this.num=0 - return item.name + ":" + item.data + '分'; + return '平均停留' + ":" + item.data + '分钟'; } } }); @@ -67,9 +67,21 @@ export default { categories: value.categories, series: value.series } - this.drawCharts('carTypeTime', res) + console.log('value21312',value) + let config = { + max:this.getSplitNumber(value.series[1].max) + } + this.drawCharts('carTypeTime', res,config) }, - drawCharts(id, data) { + getSplitNumber(value){ + if (value === 0){ + return 5 + }else{ + let sum = value + value *0.2 + return Number((sum / 5).toFixed(0)) * 5 + } + }, + drawCharts(id, data,config) { const ctx = uni.createCanvasContext(id, this); let phoneInfo = uni.getStorageSync('phoneInfo') this.width = phoneInfo.screenWidth-16 @@ -114,7 +126,7 @@ export default { { title:'单位: 分钟', min: 0, - max: 150, + max: config.max, position: 'right', titleOffsetY: -5, titleOffsetX: 5, diff --git a/pages/commercialBI/components/car/monthTotal.vue b/pages/commercialBI/components/car/monthTotal.vue index 2f7cd04..1a16ba9 100644 --- a/pages/commercialBI/components/car/monthTotal.vue +++ b/pages/commercialBI/components/car/monthTotal.vue @@ -23,6 +23,7 @@ export default { watch: { data: { handler(value) { + console.log('monthValue',value) this.handleCarData(value) }, immediate:true, @@ -35,10 +36,10 @@ export default { formatter: (item, category, index, opts) => { let text = '' if (item.name === '车流量'){ - text = `入区 ${opts.series[0].info[index].allCarCount} 辆, 入区率 ${opts.series[0].info[index].rate} %` + text = `入区 ${opts.series[0].info[index].allCarCount?opts.series[0].info[index].allCarCount:''} 辆, 入区率 ${opts.series[0].info[index].rate?opts.series[0].info[index].rate:''} %` return text }else{ - return `金额 ${opts.series[0].info[index].money} 元, 单车价值 ${((opts.series[0].info[index].money) / opts.series[0].info[index].allCarCount).toFixed(2)} 元` + return `金额 ${opts.series[0].info[index].money?opts.series[0].info[index].money:''} 元, 单车消费 ${opts.series[0].info[index].allCarCount?((opts.series[0].info[index].money) / opts.series[0].info[index].allCarCount).toFixed(2):''} 元` } } @@ -50,9 +51,22 @@ export default { categories: value.categories, series: value.series } - this.drawCharts('monthTotal', res) + let config={ + carMax:this.getSplitNumber(value.series[0].max), + moneyMax:this.getSplitNumber(value.series[1].max) + } + console.log('config',config) + this.drawCharts('monthTotal', res, config) }, - drawCharts(id, data) { + getSplitNumber(value){ + if (value === 0){ + return 5 + }else{ + let sum = value + value *0.2 + return Number((sum / 5).toFixed(0)) * 5 + } + }, + drawCharts(id, data,config) { const ctx = uni.createCanvasContext(id, this); let phoneInfo = uni.getStorageSync('phoneInfo') let width = phoneInfo.screenWidth-32 @@ -89,6 +103,7 @@ export default { titleOffsetY: -5, titleOffsetX: 15, min: 0, + max:config.carMax }, { position: "right", @@ -98,6 +113,7 @@ export default { titleOffsetY: -5, titleOffsetX: -15, min: 0, + max:config.moneyMax }] }, legend: { diff --git a/pages/commercialBI/components/guest/customerFirst.vue b/pages/commercialBI/components/guest/customerFirst.vue index e10b640..751bd12 100644 --- a/pages/commercialBI/components/guest/customerFirst.vue +++ b/pages/commercialBI/components/guest/customerFirst.vue @@ -8,11 +8,11 @@

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

-

客单交易 /笔

+

入区车辆 /笔

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

-

客单均价 /元

+

单车价值 /元

@@ -30,13 +30,27 @@

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

客单均价 /元

+
+

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

+

入区车辆 /笔

+
+
+

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

+

单车价值 /元

+
-
-
-
+
+ {{'高消费'}} +
+
+ {{'普通消费'}} +
+
+ {{'低消费'}} +
高消费 {{info.transactionLevel.HighConsumption_Rate?info.transactionLevel.HighConsumption_Rate:'-'}}% @@ -60,7 +74,8 @@ export default { NormalConsumption_Rate:0, LowConsumption_Rate:0 } - } + }, + genderList:[false,false,false] } }, props: { @@ -77,6 +92,17 @@ export default { } } }, + methods:{ + handleShow(num){ + console.log(1111) + let list = [] + this.genderList.forEach(()=>{ + list.push(false) + }) + this.genderList = list + this.genderList[num] = true + } + } } @@ -109,10 +135,13 @@ export default { margin-top: 12px; width: 100%; display: flex; + flex-flow: wrap; box-sizing: border-box; .item{ width:50%; padding-left: 26px; + box-sizing: border-box; + margin-bottom: 12px; .price{ font-size: 16px; font-family: DINAlternate-Bold, DINAlternate; @@ -154,18 +183,60 @@ export default { height: 100%; background: #1E80FF; border-radius: 2px 0 0 2px; + .meng{ + width: 70px; + height: 20px; + box-sizing: border-box; + line-height: 20px; + 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; + } } .normal{ position: absolute; height: 100%; background: #ACB9CD; border-radius: 2px 0 0 2px; + .meng{ + width: 70px; + height: 20px; + box-sizing: border-box; + line-height: 20px; + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + right: 0;top: -20px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + } } .small{ position: absolute; height: 100%; background: #CAD0DA; border-radius: 2px 0 0 2px; + .meng{ + width: 70px; + height: 20px; + box-sizing: border-box; + line-height: 20px; + position: absolute; + display: inline-block; + padding: 0 5px; + z-index: 9; + right: 0;top: -20px; + background: rgba(0,0,0,0.6); + color:#fff; + border-radius: 2px; + } } } .type{ diff --git a/pages/commercialBI/components/guest/customerSecond.vue b/pages/commercialBI/components/guest/customerSecond.vue index a73495f..b0bae07 100644 --- a/pages/commercialBI/components/guest/customerSecond.vue +++ b/pages/commercialBI/components/guest/customerSecond.vue @@ -43,7 +43,7 @@ export default { woman:0, width:0,//手机宽度 customerSecondPath:'',//路径 - genderList:[false,false], + genderList:[false,false], } }, props: { diff --git a/pages/commercialBI/components/manager/moneyCompare.vue b/pages/commercialBI/components/manager/moneyCompare.vue index e61b2a7..027f83e 100644 --- a/pages/commercialBI/components/manager/moneyCompare.vue +++ b/pages/commercialBI/components/manager/moneyCompare.vue @@ -13,7 +13,9 @@ export default { data() { return { width:0, - comparePath:'' + comparePath:'', + dataList: [], + selectIndex:0 } }, props: { @@ -27,6 +29,8 @@ export default { handler(value) { console.log('营收对比value',value) this.comparePath = '' + this.dataList = value + this.selectIndex = value.type this.handleCarData(value) }, immediate: true, @@ -35,9 +39,21 @@ export default { }, methods: { tap(e){ + console.log('dataList',this.dataList) uChartsInstance[e.target.id].showToolTip(e, { formatter: (item, category, index, opts) => { - return item.name + ":" + item.data; + return item.name + ":" + item.data + '万元' + // if (this.selectIndex===0){ + // if (item.name === '平日平均'){ + // return item.name + ":" + this.dataList.normal[0].data[index] + '元'; + // }else if(item.name === '周末平均'){ + // return item.name + ":" + this.dataList.normal[1].data[index] + '元'; + // }else if(item.name === '节假日平均'){ + // return item.name + ":" + this.dataList.normal[2].data[index] + '元'; + // } + // } else{ + // return item.name + ":" + item.data + // } } }); uChartsInstance[e.target.id].touchLegend(e); @@ -45,9 +61,21 @@ export default { // 处理传入的数据 handleCarData(value) { let res = value - this.drawCharts('compare', res) + let config = { + max:this.getSplitNumber(value.max) + } + console.log('value2222222',value) + this.drawCharts('compare', res,config) }, - drawCharts(id, data) { + getSplitNumber(value){ + if (value === 0){ + return 5 + }else{ + let sum = value + value *0.2 + return Number((sum / 4).toFixed(0)) * 4 + } + }, + drawCharts(id, data,config) { const ctx = uni.createCanvasContext(id, this); let _this = this let phoneInfo = uni.getStorageSync('phoneInfo') @@ -90,7 +118,9 @@ export default { fontSize:12, axisLineColor:'#F2F2F5' } - ] + ], + min:0, + max:config.max }, extra: { column: { diff --git a/pages/commercialBI/components/manager/revenueAnalysis.vue b/pages/commercialBI/components/manager/revenueAnalysis.vue index a6073f0..3df8777 100644 --- a/pages/commercialBI/components/manager/revenueAnalysis.vue +++ b/pages/commercialBI/components/manager/revenueAnalysis.vue @@ -3,29 +3,29 @@
-

合同盈亏/元

-

-1,743,567,98

+

合同总金额/万元

+

{{dataInfo.ContractProfitLoss}}

店铺数量/个

-

28

+

{{dataInfo.ShopCount}}

-

2022日均坪效/元

-

2786.00

+

欠款金额/万元

+

{{dataInfo.SalesPerSquareMeter}}

-

半年内到期门店/个

-

6

+

半年到期合同/个

+

{{dataInfo.ExpiredShopCount}}

@@ -36,18 +36,19 @@ export default { name: "revenueAnalysis", data() { return { + dataInfo:{} } }, props: { data: { - type: Array, - default: () => [] + type: Object, + default: () => {} } }, watch: { data: { handler(value) { - this.handleCarData(value) + this.dataInfo = value } } }, diff --git a/pages/commercialBI/guestPortrait.vue b/pages/commercialBI/guestPortrait.vue index 6068ec7..82a2eae 100644 --- a/pages/commercialBI/guestPortrait.vue +++ b/pages/commercialBI/guestPortrait.vue @@ -26,7 +26,7 @@
-

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

+

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

@@ -51,7 +51,7 @@
-

{{thisMonth?thisMonth:'-'}}月业态消费偏好

+

{{thisMonth?thisMonth:'-'}}月业态客单偏好

diff --git a/pages/commercialBI/managePortrait.vue b/pages/commercialBI/managePortrait.vue index 8e871e0..be0a5f6 100644 --- a/pages/commercialBI/managePortrait.vue +++ b/pages/commercialBI/managePortrait.vue @@ -37,8 +37,8 @@
-

{{selectTab===0?'营收对比':selectTab===1?'客单对比':selectTab===2?'均价对比':''}}

- 单位: 元 +

{{selectTab===0?'营收特征分析':selectTab===1?'客单对比':selectTab===2?'均价对比':''}}

+ 单位: 万元 单位: 笔 单位: 元
@@ -49,7 +49,7 @@
-

营收趋势

+

营收同比分析

单位: 万元
@@ -60,7 +60,7 @@
-

营收占比

+

{{month}}月营收类型比例

@@ -88,7 +88,7 @@
{{monthNoticeText}}
- + @@ -137,7 +137,7 @@
{{yearNoticeText}}
- + @@ -223,9 +223,10 @@ export default { analyseInfo:{ analysisins_type: 1301 }, - monthNoticeText:'', - yearNoticeText:'', - lastDay:'' + monthNoticeText:'', + yearNoticeText:'', + lastDay:'', + month:'' } }, onLoad(option) { @@ -241,6 +242,12 @@ export default { if (storeTime){ this.time = storeTime } + let date = new Date(this.time) + let m = date.getMonth() + 1 + if (m<10){ + m = '0' + m + } + this.month = m let storeServiceInfo = uni.getStorageSync('currentService') if (storeServiceInfo){ this.serviceInfo = storeServiceInfo @@ -273,6 +280,53 @@ export default { this.handleNoticeYear() }, methods:{ + // 拿到服务区详情页需要的数据 然后带着跳转过去 + handleGoServiceInfo(type){ + let serviceInfo = this.serviceInfo + + let num = serviceInfo.SERVERPART_NAME.indexOf('服务区') + console.log(num) + if (num!==-1){ + serviceInfo.name = serviceInfo.SERVERPART_NAME.slice(0,num) + serviceInfo.unit = serviceInfo.SERVERPART_NAME.slice(num,100) + }else{ + serviceInfo.name = serviceInfo.SERVERPART_NAME + } + console.log('this.plan',this.plan) + if (type==='month'){ + let service = { + Budget_Amount:this.plan.BudgetMonth_Amount, + Budget_Degree:this.plan.MonthBudget_Degree, + Growth_Rate:this.plan.MonthGrowth_Rate, + Revenue_Amount:this.plan.RevenueMonth_Amount, + Serverpart_ID:serviceInfo.Serverpart_ID, + Serverpart_Name:serviceInfo.SERVERPART_NAME, + name:serviceInfo.name, + unit:serviceInfo.unit + } + const date = new Date(this.time) + let month = date.getMonth() + 1 + console.log('service',service) + uni.navigateTo({ + url:`/pages/commercialBI/serviceDetail?serviceInfo=${JSON.stringify(service)}&month=${month}&type=month` + }) + }else{ + let service = { + Budget_Amount:this.plan.BudgetYear_Amount, + Budget_Degree:this.plan.YearBudget_Degree, + Growth_Rate:this.yearAdd, + Revenue_Amount:this.plan.RevenueYear_Amount, + Serverpart_ID:serviceInfo.Serverpart_ID, + Serverpart_Name:serviceInfo.SERVERPART_NAME, + name:serviceInfo.name, + unit:serviceInfo.unit + } + uni.navigateTo({ + url:`/pages/commercialBI/serviceDetail?serviceInfo=${JSON.stringify(service)}&type=year` + }) + } + + }, async handleNoticeMonth(){ let date = new Date(this.lastDay) let y = date.getFullYear() @@ -394,6 +448,7 @@ export default { } const data = await request.$webGet('CommercialApi/Revenue/GetRevenueCompare',req) let RevenueAmount = [] //营收金额 + let normalAmount = [] //不除以10000的金额 let RevenueMax = 0 let TicketCountList = [] // 客单量 let TicketMax = 0 @@ -401,13 +456,16 @@ export default { let AvgTicketMax = 0 data.Result_Data.RevenueAmountList.forEach(item=>{ let list = [] + let listNormal = [] item.data.forEach(subItem=>{ - let number = (subItem[1] ).toFixed(0) + let number = (subItem[1] / 10000 ).toFixed(2) if (number>RevenueMax){ RevenueMax = number } list.push(number) + listNormal.push(subItem[1]) }) + normalAmount.push({name:item.name,data:listNormal}) RevenueAmount.push({name:item.name,data:list}) }) data.Result_Data.TicketCountList.forEach(item=>{ @@ -440,6 +498,7 @@ export default { list:{ categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"], series: RevenueAmount, + normal:normalAmount, max:RevenueMax, type:0 }, diff --git a/pages/commercialBI/planDetail.vue b/pages/commercialBI/planDetail.vue index aaf8bf4..e2878fa 100644 --- a/pages/commercialBI/planDetail.vue +++ b/pages/commercialBI/planDetail.vue @@ -121,7 +121,7 @@
-
+

{{item.name}}{{item.unit}}

@@ -189,7 +189,6 @@ export default { // 拿到传入的月份 this.month = Number(option.month) // 取全局的时间 - console.log('this.lastDay',this.lastDay) let date = new Date(this.lastDay) let y = date.getFullYear() let m = date.getMonth() + 1 @@ -200,12 +199,10 @@ export default { if (d<10){ d = '0' + d } - console.log('d',d) // 判断如果是当前月份的话 就拿到当前时间,不是当前月份的话 就拿那个月的最后一天 if (option.month){ if (Number(m) === Number(option.month)){ this.date = `${y}-${m}-${d}` - console.log('this.date',this.date) }else{ let month if (this.month<10){ @@ -215,13 +212,10 @@ export default { } //月份不是当前月 let mayDate = `${y}-${month}` - console.log('mayDate',mayDate) let addDay = this.$util.getThisMonthDay(mayDate) - console.log('addDay',addDay) this.date = `${mayDate}-${addDay}` } } - console.log('this.date',this.date) // 直接把上一个页面点进的片区属性全部拿来 if (option.item){ this.item = JSON.parse(option.item) @@ -256,6 +250,12 @@ export default { } }, methods:{ + // 跳转到服务区详情 + handleToServiceDetail(item){ + uni.navigateTo({ + url:`/pages/commercialBI/serviceDetail?serviceInfo=${JSON.stringify(item)}&month=${this.month?this.month:''}&type=month&select=true` + }) + }, async getDateSecond(){ let req = { StatisticsDate:this.date, @@ -266,7 +266,6 @@ export default { const data = await request.$webGet('CommercialApi/Revenue/GetProvinceRevenueBudget',req) data.Result_Data.RegionBudgetList.forEach(item=>{ let num = item.Serverpart_Name.indexOf('服务区') - console.log(num) if (num!==-1){ item.name = item.Serverpart_Name.slice(0,num) item.unit = item.Serverpart_Name.slice(num,100) @@ -317,7 +316,6 @@ export default { PageSize:10 } } - console.log('req222',req) const data = await request.$webPost('CommercialApi/Analysis/GetANALYSISINSList',req) this.monthText = data.Result_Data.List[0].ANALYSIS_CONTENT this.itemText = data.Result_Data.List[0].ANALYSIS_CONTENT @@ -341,11 +339,9 @@ export default { ProvinceCode:'340000', StatisticsType:1 } - console.log('req111',req) const data = await request.$webGet('CommercialApi/Revenue/GetProvinceRevenueBudget',req) data.Result_Data.RegionBudgetList.forEach(item=>{ let num = item.Serverpart_Name.indexOf('片区') - console.log(num) if (num!==-1){ item.name = item.Serverpart_Name.slice(0,num) item.unit = item.Serverpart_Name.slice(num,100) diff --git a/pages/commercialBI/serviceDetail.vue b/pages/commercialBI/serviceDetail.vue new file mode 100644 index 0000000..a929a82 --- /dev/null +++ b/pages/commercialBI/serviceDetail.vue @@ -0,0 +1,944 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index ae23526..cca5bb6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -395,9 +395,9 @@ export default { { imgUrl: '/static/images/index/business_icon.svg', path: '/pages/commercialBI/managePortrait', name: '经营画像' }, { imgUrl: '/static/images/index/trade.svg', path: '/pages/commercialBI/businessPortrait', name: '交易画像' }, { imgUrl: '/static/images/index/brand.svg', path: '/pages/commercialBI/formatPortrait', name: '业态品牌' },], - detailTypeList:[{ name: '分润门店', unit: '/个', value: '-',yesterValue:'-', add: '-', imgIcon: '/static/images/index/store.svg' }, + detailTypeList:[{ name: '分润门店', unit: '/个', value: '-',yesterValue:'-', add: '', imgIcon: '/static/images/index/store.svg' }, { name: '驿达分润', unit: '/元', value: '-',yesterValue:'-', imgIcon: '/static/images/index/yidaFenrun.svg' }, - { name: '订单配送', unit: '/单', value: '-',yesterValue:'-', add: '-', imgIcon: '/static/images/index/orderDelivery.svg' }, + { name: '订单配送', unit: '/单', value: '-',yesterValue:'-', add: '', imgIcon: '/static/images/index/orderDelivery.svg' }, { name: '采购金额', unit: '/元', value: '-',yesterValue:'-', imgIcon: '/static/images/index/purchaseAmount.svg' },], propOfRevenList:[ { name: '经营模式', value: 1 }, { name: '经营业态', value: 2 }, @@ -446,12 +446,21 @@ export default { yearNoticeText:'', thisMonth:0,//拿到当前月份 isSuccess:false,//首页这些接口是否全部调用成功 + isReturn : true } }, watch:{ user:{ handler:function (value){ - this.getData(this.option) + let userInfo = uni.getStorageSync('vuex') + userInfo = JSON.parse(userInfo) + console.log(userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']) + if (userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']===1){ + this.isReturn = false + } + if (!this.isReturn){ + this.getData(this.option) + } }, deep:true }, @@ -481,82 +490,101 @@ export default { ...mapGetters({'user':'getUser'}) }, onLoad(option){ - // 处理页面显示的时间 - this.single = timestampToTime((new Date(this.lastDay).getTime())) - // 获取手机参数对页面进行适配 主要是用于拿到胶囊的位置 - let systemInfo = uni.getSystemInfoSync() - this.statusBarHeight = Number(systemInfo.statusBarHeight) - this.menu = uni.getMenuButtonBoundingClientRect() - // 获取最近有效日期的时间,以昨天为主 - const date = new Date(this.lastDay) - this.thisDay = getThisDay(date.getDay()) - this.thisMonth = this.$util.getThisTimeMonth(this.lastDay) - // 把时间存起来给全部页面都能拿到 - uni.setStorageSync('lastDay',this.lastDay) - // 判断是否有投诉建议的悬浮框弹出 - 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'] - } - } - //拿到option的值 - this.option = option - // 获取数据的方法 - if (this.user.Membership_Id){ - this.getData(option) - } - // 判断缓存中是否有位置信息 没有的话 向用户请求 拿到用户当前位置 - // 拿到当前位置之后去请求离当前位置最近的服务区 作为第一次进入小程序自动选中的服务区 - // 在用户选择服务区之后就会有当前服务区 - this.seat = uni.getStorageSync('seatInfo') - console.log('this.seat',this.seat) - 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() - } - //问号显示的内容 月份的数据请求 和 年份的数据请求 - this.handleNoticeMonth() - this.handleNoticeYear() + // 处理页面显示的时间 + this.single = timestampToTime((new Date(this.lastDay).getTime())) + // 获取手机参数对页面进行适配 主要是用于拿到胶囊的位置 + let systemInfo = uni.getSystemInfoSync() + this.statusBarHeight = Number(systemInfo.statusBarHeight) + this.menu = uni.getMenuButtonBoundingClientRect() + // 获取最近有效日期的时间,以昨天为主 + console.log('this.lastDay',this.lastDay) + const date = new Date(this.lastDay) //设置日期选择器的开始时间和结束时间 - let y = date.getFullYear() - let m = date.getMonth() + 1 - let d = date.getDate() - let howDay - if (d - 8 <0){ - let k = 8 - d - m = m - 1 - const time = `${y}-${m}` - howDay = this.$util.getThisMonthDay(time) - this.startDate = `${y}-${m}-${howDay - k}` - }else{ - this.startDate = `${y}-${m}-${d - 8}` + let y = date.getFullYear() + let m = date.getMonth() + 1 + let d = date.getDate() + let howDay + let day + if (d - 8 <0){ + let k = 8 - d + m = m - 1 + const time = `${y}-${m}` + howDay = this.$util.getThisMonthDay(time) + if (m<10){ + m = '0' + m } - this.endData = new Date() - - setTimeout(()=>{ - if (!this.isSuccess){ - uni.showToast({ - title: '加载失败,请下拉刷新重新加载', - icon: 'none', - duration: 3000 - }) - } - },10000) + this.startDate = `${y}-${m}-${howDay - k}` + }else{ + if (m<10){ + m = '0' + m + } + if (d - 8 <10){ + day = d - 8 + day = '0' + day + } + this.startDate = `${y}-${m}-${day}` + } + this.endData = new Date() + this.thisDay = getThisDay(date.getDay()) + this.thisMonth = this.$util.getThisTimeMonth(this.lastDay) + // 把时间存起来给全部页面都能拿到 + uni.setStorageSync('lastDay',this.lastDay) + let userInfo = uni.getStorageSync('vuex') + userInfo = JSON.parse(userInfo) + console.log(userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']) + if (userInfo.userData.AuthorityInfo['89a1f248-2113-4d57-84b1-c2e6edb9e8ee']===1){ + this.isReturn = false + } + if (!this.isReturn){ + // 判断是否有投诉建议的悬浮框弹出 + 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'] + } + } + //拿到option的值 + this.option = option + // 获取数据的方法 + if (this.user.Membership_Id){ + this.getData(option) + } + // 判断缓存中是否有位置信息 没有的话 向用户请求 拿到用户当前位置 + // 拿到当前位置之后去请求离当前位置最近的服务区 作为第一次进入小程序自动选中的服务区 + // 在用户选择服务区之后就会有当前服务区 + 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() + } + //问号显示的内容 月份的数据请求 和 年份的数据请求 + this.handleNoticeMonth() + this.handleNoticeYear() + console.log('date',date) + setTimeout(()=>{ + if (!this.isSuccess){ + uni.showToast({ + title: '加载失败,请下拉刷新重新加载', + icon: 'none', + duration: 3000 + }) + } + },10000) + } }, onShow(){ // 隐藏掉小程序本身自带的 tabbar 让自定义的tabbar出现 @@ -648,13 +676,34 @@ export default { this.showNoticeYear = false }, handlePlanPageGo(type){ - this.$util.toNextRoute('navigateTo', `/pages/commercialBI/planMonth?lastDay=${this.lastDay}&type=${type}`) + if (!this.isReturn){ + this.$util.toNextRoute('navigateTo', `/pages/commercialBI/planMonth?lastDay=${this.lastDay}&type=${type}`) + }else{ + uni.showToast({ + title: '暂无权限请联系管理员', + icon: 'none' + }) + } }, handlePage(){ - this.$util.toNextRoute('navigateTo', `/pages/everdayRenven/index?time=${this.lastDay}`) + if (!this.isReturn){ + this.$util.toNextRoute('navigateTo', `/pages/everdayRenven/index?time=${this.lastDay}`) + }else{ + uni.showToast({ + title: '暂无权限请联系管理员', + icon: 'none' + }) + } }, handleGoTab(item){ - this.$util.toNextRoute('navigateTo', `${item.path}?time=${this.lastDay}&serviceInfo=${JSON.stringify(this.nearServiceInfo)}`) + if (!this.isReturn){ + this.$util.toNextRoute('navigateTo', `${item.path}?time=${this.lastDay}&serviceInfo=${JSON.stringify(this.nearServiceInfo)}`) + } else{ + uni.showToast({ + title: '暂无权限请联系管理员', + icon: 'none' + }) + } }, getData(option){ //老代码 @@ -926,6 +975,10 @@ export default { let endDate = new Date(this.lastDay) let endMonth = endDate.getMonth() + 1 let endDay = endDate.getDate() + console.log('this.startDate',this.startDate) + console.log('date',date) + console.log('endTime',endTime) + console.log('startTime',startTime) if (date > endTime || date < startTime){ isOnRefresh = false }else{ @@ -938,9 +991,10 @@ export default { this.thisDay = getThisDay(new Date(e.detail.value).getDay()) this.onRefresh() }else{ - uni.showToast({ - title: `数据看板仅支持查看${startMonth}.${startDay}-${endMonth}.${endDay}的数据`, + uni.showModal({ + title: `数据看板仅支持查看${startMonth}.${startDay}-${endMonth}.${endDay}的数据,更多数据请登陆商业综合平台查看`, icon:'none', + showCancel: false, duration:3000 }); } diff --git a/pages/map/index.vue b/pages/map/index.vue index a0290ed..76af35a 100644 --- a/pages/map/index.vue +++ b/pages/map/index.vue @@ -307,10 +307,7 @@ export default { // iconPath: 'https://eshangtech.com/ShopICO/ahyd-BID/service/health.svg', id: value.Serverpart_ID, latitude: value.latitude, - longitude: value.longitude, - callout: { - display: 'ALWAYS' - } + longitude: value.longitude }) // } this.markers = markers