From 2a491b9775e5d5370a95fbb48be18e5852494c7e Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Thu, 3 Aug 2023 19:12:44 +0800 Subject: [PATCH] update --- pages/commercialBI/carPortrait.vue | 1 + .../bussiness/transactionAnalysis.vue | 32 +++---- pages/commercialBI/managePortrait.vue | 33 ++++---- pages/commercialBI/specialCase.vue | 34 ++++++-- pages/everdayRenven/AnhuiIndex.vue | 11 ++- .../components/ServiceRevenuePie.vue | 16 ++-- pages/examine/index.vue | 58 ++++++++----- pages/index/index.vue | 84 ++++++++++++++----- static/images/examine/add.svg | 16 ++++ static/images/examine/reduce.svg | 16 ++++ static/images/examine/warning.svg | 11 +++ 11 files changed, 223 insertions(+), 89 deletions(-) create mode 100644 static/images/examine/add.svg create mode 100644 static/images/examine/reduce.svg create mode 100644 static/images/examine/warning.svg diff --git a/pages/commercialBI/carPortrait.vue b/pages/commercialBI/carPortrait.vue index 37eb0de..ffa8958 100644 --- a/pages/commercialBI/carPortrait.vue +++ b/pages/commercialBI/carPortrait.vue @@ -401,6 +401,7 @@ export default { if (storeTime){ this.time = storeTime } + console.log(' this.time', this.time) this.single = this.$util.getThisMonthHave(this.time) this.searchText = this.time const date = new Date(this.time) diff --git a/pages/commercialBI/components/bussiness/transactionAnalysis.vue b/pages/commercialBI/components/bussiness/transactionAnalysis.vue index 1096d53..a83224b 100644 --- a/pages/commercialBI/components/bussiness/transactionAnalysis.vue +++ b/pages/commercialBI/components/bussiness/transactionAnalysis.vue @@ -16,22 +16,22 @@ -
-
- -

消费转化率/%

-
-
-
-

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

-

该服务区

-
-
-

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

-

省级平均

-
-
-
+ + + + + + + + + + + + + + + + diff --git a/pages/commercialBI/managePortrait.vue b/pages/commercialBI/managePortrait.vue index baf4707..e31229e 100644 --- a/pages/commercialBI/managePortrait.vue +++ b/pages/commercialBI/managePortrait.vue @@ -105,8 +105,8 @@ 比计划: - -

{{monthAdd?Math.abs(monthAdd) + '%':'-'}}

+ +

{{monthAdd?monthAdd + '%':'-'}}

@@ -154,8 +154,8 @@ 比计划:
- -

{{yearAdd?Math.abs(yearAdd) + '%':''}}

+ +

{{yearAdd?yearAdd + '%':''}}

@@ -463,7 +463,7 @@ export default { ServerpartId:this.serviceInfo.Serverpart_ID || '' } const data = await request.$webGet('CommercialApi/Revenue/GetRevenueCompare',req) - let RevenueAmount = [] //营收金额 + let RevenueAmount = [] //营收金额 除以10000的金额 let normalAmount = [] //不除以10000的金额 let compareWordDay = [] //对比工作日 let RevenueMax = 0 @@ -513,6 +513,7 @@ export default { }) AvgTicketAmountList.push({name:item.name,data:list,qoqAdd:qoqAddList,holiday: item.value}) }) + // 因为有三个选项卡 把三种情况要展示的内容 放在一个对象里面 三个对象放一个数组里面 点击选项卡切换显示的对象就可以了 this.revenueAll = [ { data:this.$util.fmoney(data.Result_Data.RevenueAmount), @@ -569,6 +570,7 @@ export default { async getTrendsList(){ let date = new Date(this.time) let y = date.getFullYear() + // 查今年去年两年的数据 let req = { ProvinceCode:'340000', StatisticsDate:y, @@ -656,16 +658,17 @@ export default { this.plan.percentageMonth = (res.Result_Data.RevenueMonth_Amount / res.Result_Data.BudgetMonth_Amount*100).toFixed(2) // this.plan.percentageMonth = 80 this.plan.percentageYear = (res.Result_Data.RevenueYear_Amount / res.Result_Data.BudgetYear_Amount*100).toFixed(2) - let date = new Date(this.time) - let nowDay = date.getDate() - let day = this.$util.getThisMonthDay(this.time) - //一天应该的增长率 - let oneDay = 100/day - // 到了当天的应该有的百分比 - let thisDayShould= oneDay*nowDay - this.monthAdd = (this.plan.percentageMonth - thisDayShould).toFixed(2) - this.yearAdd = (((res.Result_Data.RevenueYear_Amount - res.Result_Data.RevenueYear_PlanAmount)/res.Result_Data.BudgetYear_Amount)*100).toFixed(2) - //处理数据 + // let date = new Date(this.time) + // let nowDay = date.getDate() + // let day = this.$util.getThisMonthDay(this.time) + // //一天应该的增长率 + // let oneDay = 100/day + // // 到了当天的应该有的百分比 + // let thisDayShould= oneDay*nowDay + // 由于显示的时候 正负号由图片表示 所以要区绝对值展现在页面上 + this.monthAdd = Math.abs(this.plan.MonthGrowth_Rate) + this.yearAdd = Math.abs(this.plan.YearGrowth_Rate) + //处理数据 保留小数 this.plan.RevenueMonth_Amount = this.$util.fmoney(res.Result_Data.RevenueMonth_Amount) this.plan.BudgetMonth_Amount = this.$util.fmoney(res.Result_Data.BudgetMonth_Amount) this.plan.RevenueYear_Amount = this.$util.fmoney(res.Result_Data.RevenueYear_Amount) diff --git a/pages/commercialBI/specialCase.vue b/pages/commercialBI/specialCase.vue index 52e5eea..d19dd96 100644 --- a/pages/commercialBI/specialCase.vue +++ b/pages/commercialBI/specialCase.vue @@ -15,9 +15,10 @@
-
+
实时分析
- 注: 1个小时入区流量比5月同一时间流量增幅150%以上且每小时入区车辆超过100辆 + +
{{showDay}} @@ -39,8 +40,8 @@
-
- {{index + 1}} +
+ {{index + 1}}
{{item.name}} @@ -51,7 +52,7 @@ /辆
- + {{item.VEHICLE_RATE}}%
@@ -168,10 +169,22 @@ export default { this.statusBarHeight = Number(systemInfo.statusBarHeight) this.menu = uni.getMenuButtonBoundingClientRect() - let storeTime = uni.getStorageSync('lastDay') - if (storeTime){ - this.time = storeTime + // let storeTime = uni.getStorageSync('lastDay') + // if (storeTime){ + // this.time = storeTime + // } + const currentDate = new Date() + // 拿到当前小时的前一小时 + let y = currentDate.getFullYear() + let nowM = currentDate.getMonth() + 1 + if (nowM<10){ + nowM = '0'+nowM } + let nowD = currentDate.getDate() + if (nowD<10){ + nowD = '0'+nowD + } + this.time = `${y}-${nowM}-${nowD}` this.searchText = this.time // this.searchText = '2023-06-21' const date = new Date(this.time) @@ -184,7 +197,10 @@ export default { this.showDay = d const nowDate = new Date() let h = nowDate.getHours() - this.startTime = h - 1 + this.startTime = h-1 + if (this.startTime===0){ + this.searchText = `${y}-${nowM}-${nowD-1}` + } // this.startTime = 19 //传入的时间用在最上面的选择器上 this.handleTab(1) diff --git a/pages/everdayRenven/AnhuiIndex.vue b/pages/everdayRenven/AnhuiIndex.vue index b5b0c89..f3c6a01 100644 --- a/pages/everdayRenven/AnhuiIndex.vue +++ b/pages/everdayRenven/AnhuiIndex.vue @@ -664,9 +664,16 @@ export default { } else { // 默认 if (this.PushAuthority.length > 0) { + console.log('11111') this.theRequest = this.defaultMsg() || {} - this.theRequest.time = this.lastDay - this.theRequest.month = this.$util.cutDate(this.lastDay, 'YYYYMM') + let storeTime = uni.getStorageSync('lastDay') + if (storeTime){ + this.theRequest.time = storeTime + this.theRequest.month = this.$util.cutDate(storeTime, 'YYYYMM') + }else{ + this.theRequest.time = this.lastDay + this.theRequest.month = this.$util.cutDate(this.lastDay, 'YYYYMM') + } this.initData() } else { uni.hideLoading() diff --git a/pages/everdayRenven/components/ServiceRevenuePie.vue b/pages/everdayRenven/components/ServiceRevenuePie.vue index 7225a27..bbe8acf 100644 --- a/pages/everdayRenven/components/ServiceRevenuePie.vue +++ b/pages/everdayRenven/components/ServiceRevenuePie.vue @@ -49,7 +49,7 @@ lineStyle:{ color: '#D1D1D1' }, - + }, data: [ ...this.data[0] @@ -67,18 +67,18 @@ label: { show:false, }, - + color: this.data[1].length> 7 ? ['#FFC3CD','#F4A4B2','#FE6582','#FFE7C0','#FEDA9D','#FEC057','#F9C8A0','#FAB176','#ffa25b','#E1C9F7','#CDA6F1', '#E0E2F6','#C5CDF9','#9AA6EF','#D8ECEA','#8FE5B2','#70D599','#ADE5EE'] : ['#70D599', '#FFE7C0', '#ADE5EE','#C5CDF9','#e0e3f7', '#AFB7E6', '#F3B1C9' ], - + data: [ ...this.data[1] ] } ] } - + } } } @@ -88,7 +88,7 @@ let _this =this // console.log('图表初始化完毕') // console.log('chart实例', this.ec) - + chart.on('click',function(params){ if(params.componentIndex==0){ _this.$emit('selectCate',params.dataIndex+1) @@ -96,7 +96,7 @@ // console.log(params) }) }, - + }, } @@ -106,10 +106,10 @@ background-color: #fff; } */ .uni-ec-canvas{ - width: 750rpx; + width: 690rpx; height: 526rpx; margin-top: 40rpx; display:block; } - + diff --git a/pages/examine/index.vue b/pages/examine/index.vue index fce1675..71ed82e 100644 --- a/pages/examine/index.vue +++ b/pages/examine/index.vue @@ -107,7 +107,8 @@ {{subItem.REGION_NAME}}区 ({{subItem.SERVERPARTList.length}}) - + + @@ -203,7 +204,7 @@ {{item.label}} - + {{item.PATROL_POSITION}} @@ -233,26 +234,26 @@ 整改结果 - - - - - - 情况及问题 - - - - 整改期限 - - - - 整改结果 - - + + + + + + + + + + + + + + + + - + @@ -446,7 +447,7 @@ export default { subItem.showChild = true }) // 反转给的考核列表 让时间从小到大 - item.DetailList.reverse() + // item.DetailList.reverse() }) // 页面上展示的数组 this.popupServiceShowList = this.popupServiceList[0] @@ -727,6 +728,23 @@ export default { Serverpart_ID:'',// 服务区内码,多个服务区用","隔开 }) this.inspectionList = res.Result_Data + + this.inspectionList.forEach(item=>{ + item.list.forEach(subItem=>{ + let i = 0 + subItem.SERVERPARTList.forEach(thirdItem=>{ + if (thirdItem.COMPLETE_STATE===0){ + i++ + } + }) + if (i>0){ + subItem.warning=false + }else{ + subItem.warning=true + } + }) + }) + console.log('inspectionList',this.inspectionList) uni.hideLoading() }, diff --git a/pages/index/index.vue b/pages/index/index.vue index d9e2855..f3c81c0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -16,7 +16,7 @@
-

门店上传{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{allShopCount?allShopCount:'-'}}

+

门店上传{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{showTableData.TotalShopCount?showTableData.TotalShopCount:'-'}}

@@ -66,10 +66,10 @@

优惠金额/元

-

{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{allShopCount?allShopCount:'-'}}

+

{{showTableData.Revenue_Upload?showTableData.Revenue_Upload:'-'}}/{{showTableData.TotalShopCount?showTableData.TotalShopCount:'-'}}

门店上传 -
!
+
!
@@ -150,8 +150,8 @@
-
- {{index + 1}} +
+ {{index + 1}}
{{item.name}} @@ -162,7 +162,7 @@ /辆
- + {{item.VEHICLE_RATE}}%
@@ -750,7 +750,7 @@
{{index + 1<10 ? '0' + (index + 1):index + 1}}
-
{{item.Serverpart_Name}}{{item.ShopName}}
+
{{item.Serverpart_Name}}{{item.ServerpartShop_Name}}
@@ -1320,7 +1320,7 @@ export default { //月度计划、年度计划 this.monthYearPlan() //拿到未上传门点列表 - this.getUnUpLoadList() + // this.getUnUpLoadList() // 拿到车流数据 this.handleGetTrafficList() // 预警信息 有值会显示车流预警 @@ -1343,7 +1343,7 @@ export default { //月度计划、年度计划 this.monthYearPlan() //拿到未上传门点列表 - this.getUnUpLoadList() + // this.getUnUpLoadList() // 拿到车流数据 this.handleGetTrafficList() // 是否显示预警信息 @@ -1365,9 +1365,18 @@ export default { const date = new Date() // 拿到当前小时的前一小时 let h = date.getHours() - 1 + let y = date.getFullYear() + let m = date.getMonth() + 1 + if (m<10){ + m = '0'+m + } + let d = date.getDate() + if (d<10){ + d = '0'+d + } const req= { // this.single - StatisticsDate: this.single, + StatisticsDate: `${y}-${m}-${d}`, StatisticsHour:h, StatisticsType:1, ShowCount:20 @@ -1487,6 +1496,7 @@ export default { const lastData = await request.$webGet('CommercialApi/Revenue/GetSummaryRevenue',allPriceData) flag3 = true let result = lastData.Result_Data + // 接口返回的数据中有三个数组的结构 排除掉不是数组的几项 对数组进行操作 for(let key in result){ if (key!=='RevenuePushModel' && key!=='GrowthRate' && key!=='MonthRevenueAmount' && key!=='YearRevenueAmount'){ let all = 0 @@ -1658,6 +1668,7 @@ export default { // // }) console.log(55555) + // 只有当前面的接口通了 才能一起处理数据的方法 if (flag2 && flag3 ){ // uni.hideLoading() this.todayAmount() @@ -1696,7 +1707,27 @@ export default { let endMonth = endDate.getMonth() + 1 let endDay = endDate.getDate() // 判断是否是在限制的时间内 - if (date > endTime || date < startTime){ + // isOnRefresh 是判断有没有限制条件的关键参数 + // if (date > endTime || date < startTime){ + // isOnRefresh = false + // }else{ + // isOnRefresh = true + // } + + const nowDate = new Date() + let y = nowDate.getFullYear() + let m = nowDate.getMonth() +1 + if (m<10){ + m= '0'+m + } + let d = nowDate.getDate() + if (d<10){ + d= '0'+d + } + let nowDay = new Date(`${y}-${m}-${d}`).getTime()- 8 * 3600 * 1000 + console.log('11111',nowDay) + console.log('22222',date) + if (nowDay<=date){ isOnRefresh = false }else{ isOnRefresh = true @@ -1710,7 +1741,8 @@ export default { this.onRefresh(true) }else{ uni.showModal({ - title: `数据看板仅支持查看${startMonth}.${startDay}-${endMonth}.${endDay}的数据,更多数据请登陆商业综合平台查看`, + title: `数据看板仅支持查看${endMonth}.${endDay+1}之前的数据,更多数据请登陆商业综合平台查看`, + // title: `数据看板仅支持查看${startMonth}.${startDay}-${endMonth}.${endDay}的数据,更多数据请登陆商业综合平台查看`, icon:'none', showCancel: false, duration:3000 @@ -1755,7 +1787,7 @@ export default { setTimeout(()=>{ // 由于页面大部分的内容采用渲染的格式 这样的方法是最快的对原数据进行赋值 对照data里面的几个主要的数组看就能看明白 // 门店上传的前后数字计算来决定样式 - if(this.showTableData.Revenue_Upload >= this.allShopCount){ + if(this.showTableData.Revenue_Upload >= this.showTableData.TotalShopCount){ this.isBig = false }else{ this.isBig = true @@ -1767,13 +1799,27 @@ export default { // 商品均价 this.showTableData.countave = (Number(this.showTableData.CashPay) / Number(this.showTableData.TotalCount)).toFixed(2) // 处理所有数据 变成有千分号和小数点的数据 + console.log('this.showTableData',this.showTableData) + + let list =[] + this.showTableData.UnUpLoadShopList.forEach(item=>{ + if (item.Revenue_Upload === 0 || !item.Revenue_Upload){ + list.push(item) + } + }) + this.bodyList = list + for (let key in this.showTableData){ - if (key==='uploadState' || key==='Revenue_Upload'){ - this.showTableData[key] = this.showTableData[key] - }else if(key ==='TicketCount'){ - this.showTableData[key] = this.$util.noDecimal(this.showTableData[key],0) - }else{ - this.showTableData[key] = this.$util.fmoney(this.showTableData[key], 2) + if (this.showTableData[key]){ + // 在有值的前提下 + // 是第一个if里面的参数 不会被处理 是第二个if里面的参数 会被处理千分号 但是没有小数点 不在第一第二个if里面的字段会被处理 保留两位小数 + if (key==='uploadState' || key==='Revenue_Upload' || key==='TotalShopCount' || key==='UnUpLoadShopList'){ + this.showTableData[key] = this.showTableData[key] + }else if(key ==='TicketCount'){ + this.showTableData[key] = this.$util.noDecimal(this.showTableData[key],0) + }else{ + this.showTableData[key] = this.$util.fmoney(this.showTableData[key], 2) + } } } uni.hideLoading() diff --git a/static/images/examine/add.svg b/static/images/examine/add.svg new file mode 100644 index 0000000..146afa0 --- /dev/null +++ b/static/images/examine/add.svg @@ -0,0 +1,16 @@ + + + 计划图标/上升@2x + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/examine/reduce.svg b/static/images/examine/reduce.svg new file mode 100644 index 0000000..15a16a8 --- /dev/null +++ b/static/images/examine/reduce.svg @@ -0,0 +1,16 @@ + + + 计划图标/上升@2x + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/examine/warning.svg b/static/images/examine/warning.svg new file mode 100644 index 0000000..e4bc666 --- /dev/null +++ b/static/images/examine/warning.svg @@ -0,0 +1,11 @@ + + + 图标/更多备份_9@2x + + + + + + + + \ No newline at end of file