643 lines
28 KiB
Vue
643 lines
28 KiB
Vue
<template>
|
||
<div class="main">
|
||
<header-top :bgUrl="bgUrl" :menu="menu" :bgColor="bgColor" :title="title" :labelList="labelList" :topBg="topBg"/>
|
||
|
||
<div class="charts">
|
||
<div class="chartsItem">
|
||
<p class="title">营收分析</p>
|
||
<revenue-analysis :data="revenueList"/>
|
||
</div>
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title">合同保底</p>
|
||
<contract-guarantee :data="contractList"/>
|
||
</div>
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title">客流客单交易</p>
|
||
<contract-guarantee :data="orderTransaction"/>
|
||
</div>
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title">同比分析</p>
|
||
<view class="tab" >
|
||
<view v-for="(item,index) in tabList" :key="index" :class="selectTab===item.value?'tabItem tabItemActive':'tabItem'" @click="handleChangeTab(item.value)">{{item.name}}</view>
|
||
</view>
|
||
<div class="subItem">
|
||
<p class="title">营收同比</p>
|
||
<div class="money">
|
||
<div class="top">
|
||
<image class="icon" src="/static/images/commercial/blueMoney.svg"></image>
|
||
<p class="sumMoney">413,168.00</p>
|
||
</div>
|
||
<div class="bottom">
|
||
<image class="icon" src="/static/images/commercial/addArrow.svg"></image>
|
||
<p class="add">+43.00%</p>
|
||
<p class="text">(相比去年同日)</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="subItem">
|
||
<p class="title" style="margin-top: 20px">营收对比</p>
|
||
<money-compare :data="moneyCompareList"/>
|
||
</div>
|
||
<div class="subItem ">
|
||
<p class="title" style="margin-top: 20px">营收趋势</p>
|
||
<revenue-trends :data="trendsList"/>
|
||
<analyse/>
|
||
</div>
|
||
</div>
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title" >营收占比</p>
|
||
<div class="progress">
|
||
<div class="top">
|
||
<div class="left">
|
||
<text class="title">自营</text>
|
||
<text class="value" style="margin-left: 4px">{{revenueType.own}}%</text>
|
||
</div>
|
||
<div class="right">
|
||
<text class="value">{{revenueType.ectocyst}}%</text>
|
||
<text class="title" style="margin-left: 4px">外包</text>
|
||
</div>
|
||
</div>
|
||
<div class="bottom">
|
||
<div class="first" :style="{width:revenueType.own+'%'}"></div>
|
||
<div class="second" :style="{width:revenueType.ectocyst+'%'}"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title" >本月自营计划</p>
|
||
<view class="box">
|
||
<view class="top">
|
||
<view class="big">
|
||
<image class="icon" src="https://eshangtech.com/ShopICO/ahyd-BID/index/thisMonth.svg"></image>
|
||
</view>
|
||
<view class="text">
|
||
<view class="textTop">
|
||
<view class="left">
|
||
<p class="number">{{plan.percentageMonth?plan.percentageMonth + '%':'-'}}</p>
|
||
<p v-if="plan.percentageMonth>=100" class="desc"><image class="success" src="/static/images/index/successMonth.svg"></image></p>
|
||
</view>
|
||
<view class="right">
|
||
<text class="comparePlan">比计划: </text>
|
||
<view class="box2">
|
||
<image class="addIcon" :src="Number(monthAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
|
||
<p class="text">{{monthAdd?monthAdd + '%':'-'}}</p>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<div class="progressPlan">
|
||
<div class="trans" :style="{width:plan.percentageMonth + '%'}"></div>
|
||
<!-- <div class=pro :style="{width:(100 - plan.percentageMonth)+ '%'}"></div>-->
|
||
<!-- <view class="trans" :style="{width: plan.percentageMonth + '%'}"></view>-->
|
||
<!-- <image class="img" src="https://eshangtech.com/ShopICO/ahyd-BID/index/progress_orange.png"></image>-->
|
||
<!-- <div class=pro :style="{width:(100 - plan.percentageMonth)+ '%'}"></div>-->
|
||
</div>
|
||
</view>
|
||
</view>
|
||
<view class="bottom">
|
||
<view class="success" style="margin-right: 39px">
|
||
<p class="text">本月已完成<text class="unit">/元</text></p>
|
||
<p class="money">{{plan.RevenueMonth_Amount?plan.RevenueMonth_Amount:'-'}}</p>
|
||
</view>
|
||
<view class="success">
|
||
<p class="text">本月计划<text class="unit">/元</text></p>
|
||
<p class="money">{{plan.BudgetMonth_Amount?plan.BudgetMonth_Amount:'-'}}</p>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</div>
|
||
<div class="chartsItem" style="margin-top: 32px">
|
||
<p class="title" >年度自营计划</p>
|
||
<view class="box">
|
||
<view class="top">
|
||
<view class="big">
|
||
<image class="icon" src="https://eshangtech.com/ShopICO/ahyd-BID/index/planYear.svg"></image>
|
||
</view>
|
||
<view class="text">
|
||
<view class="textTop">
|
||
<view class="left">
|
||
<p class="number">{{plan.percentageYear?plan.percentageYear + '%':'-'}}</p>
|
||
<p v-if="plan.percentageYear>=100" class="desc" style="color: #4E68FF"><image class="success" src="/static/images/index/yearSuccess.svg"></image></p>
|
||
</view>
|
||
<view class="right">
|
||
<text class="comparePlan">比计划: </text>
|
||
<div class="box2">
|
||
<image class="addIcon" :src="Number(yearAdd)>0?'https://eshangtech.com/ShopICO/ahyd-BID/index/addIcon.svg':'https://eshangtech.com/ShopICO/ahyd-BID/index/reduce.svg'"></image>
|
||
<p class="text">{{yearAdd?yearAdd + '%':''}}</p>
|
||
</div>
|
||
</view>
|
||
</view>
|
||
<div class="progressPlan">
|
||
<div class="transYear" :style="{width:plan.percentageYear + '%'}"></div>
|
||
<!-- <image class="img" :style="{width: plan.percentageYear + '%'}" src="https://eshangtech.com/ShopICO/ahyd-BID/index/progress_blue.png"></image>-->
|
||
<!-- <div class=pro :style="{width:(100 - plan.percentageYear)+ '%'}"></div>-->
|
||
</div>
|
||
</view>
|
||
</view>
|
||
<view class="bottom">
|
||
<view class="success" style="margin-right: 39px">
|
||
<p class="text">年度已完成<text class="unit">/元</text></p>
|
||
<p class="money">{{plan.RevenueYear_Amount?plan.RevenueYear_Amount:'-'}}</p>
|
||
</view>
|
||
<view class="success">
|
||
<p class="text">年度计划<text class="unit">/元</text></p>
|
||
<p class="money">{{plan.BudgetYear_Amount?plan.BudgetYear_Amount:'-'}}</p>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import headerTop from "./components/headerTop.vue";
|
||
import RevenueAnalysis from "./components/manager/revenueAnalysis.vue";
|
||
import ContractGuarantee from "./components/manager/contractGuarantee.vue";
|
||
import MoneyCompare from "./components/manager/moneyCompare.vue";
|
||
import analyse from "./components/analyse.vue";
|
||
import RevenueTrends from "./components/manager/revenueTrends.vue";
|
||
import request from '@/util/index.js'
|
||
|
||
export default {
|
||
name: "businessPortrait",
|
||
components: {RevenueTrends, MoneyCompare, ContractGuarantee, RevenueAnalysis, headerTop,analyse},
|
||
data() {
|
||
return {
|
||
topBg:'linear-gradient(180deg, #D9CCEF 0%, #DED3F2 100%);',
|
||
labelList:['女性','高消费','喜爱奶茶','浙江','20-30岁','江苏'],//标签
|
||
tabList:[{name:'营收金额',value:0},{name:'客单量',value:1},{name:'客单均价',value:2}],//选项卡列表
|
||
selectTab:0,//当前选中
|
||
title:'经营画像',//页面标题
|
||
bgColor: '180deg, #996CFF 0%, #5D43F8 100%',
|
||
bgUrl: 'https://eshangtech.com/ShopICO/ahyd-BID/commercial/managePortraitBg.svg',//背景图片路径
|
||
time: '',//跳转携带的时间
|
||
menu: {},//手机配置信息
|
||
revenueList:[],//营收分析
|
||
contractList:{},//合同保底
|
||
orderTransaction:{},//客流客单交易
|
||
moneyCompareList:[],//营收对比
|
||
trendsList:[],//营收趋势
|
||
revenueType:{},//营收占比
|
||
plan:{},//月度和年度接口的返回参数 一起的
|
||
monthAdd:'',//月每天的相对增加
|
||
yearAdd:'', // 年度计划增加的百分比
|
||
}
|
||
},
|
||
onLoad(option) {
|
||
//跳转的时候带上时间
|
||
this.time = option.time
|
||
// 获取手机参数对页面进行适配
|
||
let systemInfo = uni.getSystemInfoSync()
|
||
// 把获取到的手机参数保存
|
||
uni.setStorageSync('phoneInfo', systemInfo)
|
||
this.statusBarHeight = Number(systemInfo.statusBarHeight)
|
||
this.menu = uni.getMenuButtonBoundingClientRect()
|
||
//营收分析
|
||
this.getRevenueList()
|
||
//合同保底
|
||
this.getContractList()
|
||
//客流客单交易
|
||
this.getOrderTransaction()
|
||
//营收对比
|
||
this.getMoneyCompareList()
|
||
//营收趋势
|
||
this.getTrendsList()
|
||
//营收占比
|
||
this.getRevenueType()
|
||
//月度计划、年度计划
|
||
this.monthYearPlan()
|
||
},
|
||
methods:{
|
||
getRevenueList(){
|
||
let res = []
|
||
this.revenueList = res
|
||
},
|
||
getContractList(){
|
||
let res = {
|
||
title: '完成率',
|
||
value: 67.1
|
||
}
|
||
this.contractList = res
|
||
},
|
||
getOrderTransaction(){
|
||
let res = {
|
||
title: '转化率',
|
||
value: 50.5
|
||
}
|
||
this.orderTransaction = res
|
||
},
|
||
//选项卡改变
|
||
handleChangeTab(value){
|
||
this.selectTab = value
|
||
},
|
||
getMoneyCompareList(){
|
||
let res = {
|
||
categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
|
||
series: [
|
||
{
|
||
name: "平日平均",
|
||
data: [7,10,8,5,8,8,9,8,5,6,7,7]
|
||
},
|
||
{
|
||
name: "周末平均",
|
||
data: [5,8,8,7,6,6,6,8,7,7,6,7]
|
||
},
|
||
{
|
||
name: "节假日平均",
|
||
data: [5,10,4,4,7,8,6,5,5,6,10,7]
|
||
}
|
||
]
|
||
}
|
||
this.moneyCompareList = res
|
||
},
|
||
getTrendsList(){
|
||
let res={
|
||
categories: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
|
||
series:[{
|
||
name: "",
|
||
data: [3,4,5,4.8,5,4.2,4.5,5,5.5,5.7,8,9]
|
||
}]
|
||
}
|
||
this.trendsList = res
|
||
},
|
||
getRevenueType(){
|
||
let res={
|
||
own:'64.8',
|
||
ectocyst:'35.2'
|
||
}
|
||
this.revenueType = res
|
||
},
|
||
monthYearPlan(){
|
||
const monthDate= {
|
||
Province_Code:'340000',
|
||
Statistics_Date:this.time
|
||
}
|
||
request.$webGet('CommercialApi/Revenue/GetRevenueBudget',monthDate).then(res=>{
|
||
// 赋值给data中的这个对象 在请求完之后会进行统一的数据处理
|
||
this.plan = res.Result_Data
|
||
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)
|
||
//处理数据
|
||
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)
|
||
this.plan.BudgetYear_Amount = this.$util.fmoney(res.Result_Data.BudgetYear_Amount)
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.main {
|
||
width: 100vw;
|
||
min-height: 100vh;
|
||
.charts{
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
padding: 28px 16px 24px;
|
||
background: #fff;
|
||
.chartsItem{
|
||
.title{
|
||
font-size: 17px;
|
||
font-family: PingFangSC-Semibold, PingFang SC;
|
||
font-weight: 600;
|
||
color: #160002;
|
||
line-height: 24px;
|
||
.unit{
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #786B6C;
|
||
line-height: 20px;
|
||
margin-left: 4px;
|
||
}
|
||
}
|
||
.progress{
|
||
width:calc(100vw - 32px);
|
||
margin-top: 12px;
|
||
.top{
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
.left,.right{
|
||
display: flex;
|
||
align-items: center;
|
||
.title{
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #160002;
|
||
}
|
||
.value{
|
||
font-size: 18px;
|
||
font-family: DINAlternate-Bold, DINAlternate;
|
||
font-weight: bold;
|
||
color: #160002;
|
||
}
|
||
}
|
||
}
|
||
.bottom{
|
||
width: 100%;
|
||
height: 14px;
|
||
position: relative;
|
||
.first{
|
||
height: 100%;
|
||
position: absolute;
|
||
left: 0;top: 0;
|
||
background: #1E80FF;
|
||
border-radius: 2px 0 0 2px;
|
||
}
|
||
.first:after{
|
||
position: absolute;
|
||
content:'';
|
||
right: 0;top: 0;
|
||
background: #fff;
|
||
width: 1px;
|
||
height: 100%;
|
||
z-index:111;
|
||
}
|
||
.second{
|
||
height: 100%;
|
||
position: absolute;
|
||
right: 0;top: 0;
|
||
background: #00C2FF;
|
||
border-radius: 0 2px 2px 0 ;
|
||
}
|
||
.second:before{
|
||
position: absolute;
|
||
content:'';
|
||
left: 0;top: 0;
|
||
background: #fff;
|
||
width: 1px;
|
||
height: 100%;
|
||
z-index:111;
|
||
}
|
||
}
|
||
}
|
||
.box {
|
||
width: 100%;
|
||
padding: 12px 16px;
|
||
box-sizing: border-box;
|
||
border-radius: 8px;
|
||
background: #f5f2f2;
|
||
margin-top: 12px;
|
||
.top {
|
||
width: 100%;
|
||
display: flex;
|
||
.big {
|
||
width: 40px;
|
||
height: 40px;
|
||
background: #ffffff;
|
||
border-radius: 8px;
|
||
border: 1px solid #ebebeb;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
margin-right: 8px;
|
||
.icon {
|
||
width: 20px;
|
||
height: 20px;
|
||
}
|
||
}
|
||
.text {
|
||
width: calc(100% - 60px);
|
||
padding: 2px 0;
|
||
.textTop{
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
.left{
|
||
display: flex;
|
||
align-items: center;
|
||
.number {
|
||
font-size: 36rpx;
|
||
font-family: DINAlternate-Bold, DINAlternate;
|
||
font-weight: bold;
|
||
color: #150002;
|
||
line-height: 40rpx;
|
||
}
|
||
.desc{
|
||
display: flex;
|
||
align-items: center;
|
||
margin-left: 8px;
|
||
font-size: 14px;
|
||
color: #FF7043;
|
||
.success{
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 4px;
|
||
}
|
||
}
|
||
}
|
||
.right{
|
||
flex: 1;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
align-items: center;
|
||
.comparePlan{
|
||
font-size: 24rpx;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #a69e9f;
|
||
line-height: 36rpx;
|
||
white-space: nowrap;
|
||
}
|
||
.box2{
|
||
display: flex;
|
||
align-items: center;
|
||
.text{
|
||
font-size: 14px;
|
||
font-family: DINAlternate-Bold, DINAlternate;
|
||
color: #150002;
|
||
font-weight: bold;
|
||
|
||
line-height: 40rpx;
|
||
}
|
||
.addIcon {
|
||
width: 16px;
|
||
height: 16px;
|
||
margin-right: 2px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.progressPlan{
|
||
width: 100%;
|
||
height: 8px;
|
||
border-radius: 5px;
|
||
background: #fff;
|
||
margin-top: 8px;
|
||
position: relative;
|
||
overflow: hidden;
|
||
.trans{
|
||
height: 8px;
|
||
position: absolute;
|
||
left: 0;top: 0;
|
||
border-top-right-radius: 4px;
|
||
border-bottom-right-radius: 4px;
|
||
background: url("https://eshangtech.com/ShopICO/ahyd-BID/index/progress_orange.png")no-repeat 100% 100%;
|
||
}
|
||
.transYear{
|
||
height: 8px;
|
||
position: absolute;
|
||
left: 0;top: 0;
|
||
border-top-right-radius: 4px;
|
||
border-bottom-right-radius: 4px;
|
||
background: url("https://eshangtech.com/ShopICO/ahyd-BID/index/progress_blue.png")no-repeat 100% 100%;
|
||
}
|
||
//.img{
|
||
// width: 100%;
|
||
// height: 100%;
|
||
// position: absolute;
|
||
// top: 0;
|
||
// left: 0;
|
||
// z-index:1;
|
||
//}
|
||
//.pro{
|
||
// height: 100%;
|
||
// position: absolute;
|
||
// top: 0;right: 0;
|
||
// background: #fff;
|
||
// z-index:2;
|
||
//}
|
||
|
||
}
|
||
}
|
||
}
|
||
.bottom {
|
||
display: flex;
|
||
margin-top: 16px;
|
||
padding-left: 48px;
|
||
.success {
|
||
.text {
|
||
font-size: 28rpx;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #786b6c;
|
||
line-height: 40rpx;
|
||
margin-bottom: 2px;
|
||
.unit {
|
||
font-size: 28rpx;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #a69e9f;
|
||
line-height: 40rpx;
|
||
margin-left: 2px;
|
||
}
|
||
}
|
||
.money {
|
||
font-size: 28rpx;
|
||
font-family: DINAlternate-Bold, DINAlternate;
|
||
font-weight: 600;
|
||
color: #160002;
|
||
line-height: 40rpx;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.tab{
|
||
width: 100%;
|
||
height: 38px;
|
||
background: #F2F1F1;
|
||
border-radius: 4px;
|
||
box-sizing: border-box;
|
||
padding:4px;
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 12px;
|
||
margin-top: 12px;
|
||
.tabItem{
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
width: calc(100% / 3);
|
||
height: 30px;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #786B6C;
|
||
}
|
||
.tabItemActive{
|
||
color: #160002;
|
||
background: #FFFFFF;
|
||
}
|
||
}
|
||
.subItem{
|
||
width:100%;
|
||
.title{
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Semibold, PingFang SC;
|
||
font-weight: 600;
|
||
color: #160002;
|
||
line-height: 20px;
|
||
margin-bottom: 8px;
|
||
}
|
||
.money{
|
||
width:calc(100% - 32px);
|
||
padding: 18px 16px;
|
||
background: #F7F7F7;
|
||
border-radius: 4px;
|
||
.top{
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 4px;
|
||
.icon{
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 8px;
|
||
}
|
||
.sumMoney{
|
||
font-size: 20px;
|
||
font-family: DINAlternate-Bold, DINAlternate;
|
||
font-weight: bold;
|
||
color: #341D00;
|
||
line-height: 24px;
|
||
}
|
||
}
|
||
.bottom{
|
||
display: flex;
|
||
align-items: center;
|
||
margin-left: 24px;
|
||
.icon{
|
||
width: 14px;
|
||
height: 14px;
|
||
margin-right: 4px;
|
||
}
|
||
.add{
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #FA5151;
|
||
line-height: 20px;
|
||
margin-right: 4px;
|
||
}
|
||
.text{
|
||
font-size: 14px;
|
||
font-family: PingFangSC-Regular, PingFang SC;
|
||
font-weight: 400;
|
||
color: #A69E9F;
|
||
line-height: 20px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</style>
|