Commit 6dfe89c1 by 前端

Merge branch 'v2.2.0' into 'master'

V2.2.0

See merge request !3
2 parents 0c3ef488 9f38feb3
// 总览数据:核心指标、数字化连接、数字化管理(线索服务/会员权益/虎哥E盾)、数字化营销(1.1精品升级/1.3售后众筹)
const getAllOverview = params => {
return window.$HTTP.get('inner/getAllOverview', params)
}
// 核心指标:门店活跃统计
const getCoreActiveMerchant = params => {
return window.$HTTP.get('inner/getCoreActiveMerchant', params)
}
// 核心指标:SAAS门店留存率
const getCoreRetention = params => {
return window.$HTTP.get('inner/getCoreRetention', params)
}
// 数字化链接:成品设备激活趋势
const getLinkFinishedProductTrend = params => {
return window.$HTTP.get('inner/getLinkFinishedProductTrend', params)
}
// 数字化管理(线索服务):设备订阅数量和线索相关性分析
const getManageClueAnalysis = params => {
return window.$HTTP.get('inner/getManageClueAnalysis', {})
}
// 数字化管理(线索服务):按年统计销售金额的合理性
const getManageClueSalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageClueSalesAmountRationality', params)
}
// 数字化管理(线索服务):注册门店趋势 && 活跃门店势 && 月收入趋势 && 销售渠道趋势
const getManageClueTrend = params => {
return window.$HTTP.get('inner/getManageClueTrend', {})
}
// 数字化管理(虎哥E盾):按年统计客户销售金额的合理性
const getManageESalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageESalesAmountRationality', params)
}
// 数字化管理(虎哥E盾):月收入趋势
const getManageETrend = params => {
return window.$HTTP.get('inner/getManageETrend', params)
}
// 数字化管理(会员权益):按年统计客户销售金额的合理性
const getManageMemberSalesAmountRationality = params => {
return window.$HTTP.get('inner/getManageMemberSalesAmountRationality', params)
}
// 数字化管理(会员权益):月收入趋势
const getManageMemberTrend = params => {
return window.$HTTP.get('inner/getManageMemberTrend', params)
}
// 数字化营销(1.3售后众筹): 活动订单分布
const getMarketingCrowdFundingActivityDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingActivityDistr', params)
}
// 数字化营销(1.3售后众筹):活动订单金额分布
const getMarketingCrowdFundingActivityMoneyDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingActivityMoneyDistr', params)
}
// 数字化营销(1.3售后众筹):门店订单分布
const getMarketingCrowdFundingMerDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingMerDistr', params)
}
// 数字化营销(1.3售后众筹):活动趋势 && 订单趋势 && 客单价趋势
const getMarketingCrowdFundingTrend = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingTrend', params)
}
// 数字化营销(1.1精品升级):门店订单金额分布 && 门店订单量分布
const getMarketingDistribution = params => {
return window.$HTTP.get('inner/getMarketingDistribution', params)
}
// 数字化营销(1.1精品升级):注册门店/活跃门店/月订单量收入趋势
const getMarketingTrend = params => {
return window.$HTTP.get('inner/getMarketingTrend', params)
}
// 数字化营销(1.3售后众筹):门店 && 订单 && 活动 && 订单金额 分布
const getMarketingCrowdFundingDistr = params => {
return window.$HTTP.get('inner/getMarketingCrowdFundingDistr', params)
}
export default {
getAllOverview,
getCoreActiveMerchant,
getCoreRetention,
getLinkFinishedProductTrend,
getManageClueAnalysis,
getManageClueSalesAmountRationality,
getManageClueTrend,
getManageESalesAmountRationality,
getManageETrend,
getManageMemberSalesAmountRationality,
getManageMemberTrend,
getMarketingCrowdFundingActivityDistr,
getMarketingCrowdFundingActivityMoneyDistr,
getMarketingCrowdFundingMerDistr,
getMarketingCrowdFundingTrend,
getMarketingDistribution,
getMarketingTrend,
getMarketingCrowdFundingDistr
}
......@@ -65,6 +65,16 @@ const getMerchant = params => {
return window.$HTTP.get('solarfilm/getMerchant', params)
}
// 单店----获取每个门店的门店采购额和入库情况
const getMerchantMer = params => {
return window.$HTTP.get('solarfilm/getMerchantMer', params)
}
// 单店----获取每个门店的服务中心的采购额和入库情况
const getMerchantServiceCenter = params => {
return window.$HTTP.get('solarfilm/getMerchantServiceCenter', params)
}
export default {
getAllGoodsRatio,
getAllOpenBuyTrend,
......@@ -77,5 +87,7 @@ export default {
getUsedWarehousing,
getBugProgress,
getYears,
getMerchant
getMerchant,
getMerchantMer,
getMerchantServiceCenter
}
......@@ -150,3 +150,21 @@ img {
width:13.26vw;
background: #071735;
}
.patch-title {
position: relative;
height: 2.22vh;
color: #fff;
line-height: 2.22vh;
padding-left: 0.83vw;
font-size: 14px;
z-index: 1;
&::before {
content: '';
position: absolute;
left: 0;
width: 7.5vw;
height: 2.22vh;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079FF1 100%);
z-index: -1;
}
}
\ No newline at end of file
<template>
<div class="tab-box">
<div class="tab-item-box" :style="{ width: width + 'vw' }">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" :style="{ width: itemWidth + 'vw' }" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" :style="{ width: (itemWidth) + 'vw','padding-left': paddingWidth + 'vw','padding-right': paddingWidth + 'vw' }" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
{{ item }}
</div>
</div>
......@@ -17,7 +17,8 @@ export default {
default: () => []
},
width: Number,
itemWidth: Number
itemWidth: Number,
paddingWidth: Number
},
data() {
return {
......
......@@ -6,24 +6,66 @@
* @LastEditTime: 2023-08-22 17:31:50
-->
<template>
<div>
内部数据
<Charts></Charts>
<div class="view-content">
<div class="content">
<InternalLeft></InternalLeft>
<InternalRight></InternalRight>
</div>
</div>
</template>
<script>
import InternalLeft from "../../internal/InternalLeft.vue"
import InternalRight from "../../internal/InternalRight.vue"
import {overViewList} from '../../internal/components/constant'
export default {
name: 'ViewInterior',
components: {
InternalLeft,
InternalRight
},
data() {
return {}
return {
overViewData: overViewList
}
},
created() {
this.getAllOverview()
},
mounted() { },
methods: {
async getAllOverview() {
const _data = await this.api.internal.getAllOverview()
const _dataList = _data.data.dataList[0]
console.log(_dataList);
this.overViewData.forEach(item => {
item.value = _dataList[item.valueName]
if (item.bottomValue) item.bottomValue = _dataList[item.bottemName]
if (item.bottomType === 'ratio') {
item.ratioLeftValue = _dataList[item.ratioLeftValueName]
item.ratioRightValue = _dataList[item.ratioRightValueName]
}
})
this.$bus.$emit('innerGetAllOverview', this.overViewData)
}
}
}
</script>
<style lang="scss" scoped>
.view-content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.78vh 24px;
gap: 0 16px;
}
.content {
display: flex;
justify-content: space-between;
// padding: 1.78vh 0 0;
// margin-top: 1.78vh;
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-09-05 14:34:10
* @LastEditors: huyue
* @LastEditTime: 2023-09-07 15:59:31
-->
<template>
<div class="left">
<div class="left-top">
<CoreIndex></CoreIndex>
<DigitalLink></DigitalLink>
</div>
<DigitalMarketing></DigitalMarketing>
</div>
</template>
<script>
import DigitalLink from './components/DigitalLink.vue'
import DigitalMarketing from './components/DigitalMarketing.vue'
import CoreIndex from './components/CoreIndex.vue'
export default {
name: 'InternalLeft',
components: {
DigitalLink,
DigitalMarketing,
CoreIndex
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.left {
width: 47.78vw;
&-top {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
}
</style>
<template>
<div class="right">
<box-title title="数字化管理"></box-title>
<Tab class="tab" :list="tabList" :width="24.12" :paddingWidth="1.11" @changeTab="changeTab"></Tab>
<div class="digital-manager-box-content">
<StatisticsBox :list="digitalMarketingList"></StatisticsBox>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import ViewClue from './components/ViewClue.vue'
import ViewIntersts from './components/ViewIntersts.vue'
import ViewEdun from './components/ViewEdun.vue'
export default {
name: 'InternalRight',
components: {
ViewClue,
ViewIntersts,
ViewEdun
},
data() {
return {
tabList: ['线索服务', '会员权益', '车管(虎哥E盾)'],
activeName: 0,
digitalMarketingList: [],
allDigitalMarketingList: []
}
},
computed: {
tabName() {
let sname
switch (this.activeName) {
case 0:
sname = 'ViewClue'
break
case 1:
sname = 'ViewIntersts'
break
case 2:
sname = 'ViewEdun'
break
}
return sname
}
},
mounted() {
this.$bus.$on('innerGetAllOverview', data => {
this.allDigitalMarketingList = data
this.digitalMarketingList = data.filter(item => item.tag === 'digitalManageClue')
console.log(this.allDigitalMarketingList);
})
},
methods: {
changeTab(data) {
this.activeName = data
let _data = []
switch (data) {
case 0:
_data = this.allDigitalMarketingList.filter(item => item.tag === 'digitalManageClue')
this.digitalMarketingList = _data
break
case 1:
_data = this.allDigitalMarketingList.filter(item => item.tag === 'digitalManageMember')
this.digitalMarketingList = _data
break
case 2:
_data = this.allDigitalMarketingList.filter(item => item.tag === 'digitalManageE')
this.digitalMarketingList = _data
break
}
}
}
}
</script>
<style lang="scss" scoped>
.right {
width: 47.48vw;
height: 89.33vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
/deep/.tab-item-box {
margin: 0 auto;
}
.digital-manager-box-content {
padding: 1.56vh 0.83vw;
/deep/ .statistics {
height: 8vh;
}
}
}
</style>
<!--
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-09-11 14:31:10
-->
<template>
<div>
<div v-show="!isEmpty">
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
<div v-show="isEmpty" class="empty" :style="{ height }">
<Empty></Empty>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import BarOptions from './BarOption'
import utils from '../../../utils/util'
export default {
name: 'BarChart',
props: {
domId: {
type: String,
default: ''
},
// dataList: {
// type: Array,
// default: () => []
// },
tooltipFormatterObj: {
type: Object,
default: () => {
return {
label: '数量',
attrName: 'num'
}
}
},
colorList: {
type: Array
},
height: {
type: String,
default: '15vh'
},
barWidth: String,
isMultiple: {
type: Boolean,
default: false
},
formatYAxis: Boolean,
label: {
type: String,
default: 'statMonth'
},
valueName: {
type: String
}
},
data() {
return {
barOptions: [],
isEmpty: false
}
},
created() {
this.barOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter }, this.colorList, this.isMultiple, this.barWidth, this.formatYAxis)
},
mounted() {
this.barDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${this.tooltipFormatterObj.label ? this.tooltipFormatterObj.label : ''}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.tooltipFormatterObj.attrName])}${this.tooltipFormatterObj.addSymbol || ''}</div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBar(dataList) {
if (!dataList || dataList.length === 0) return (this.isEmpty = true)
if (dataList && dataList.length) {
this.dataList = dataList
this.isEmpty = false
this.barOptions.xAxis.data = dataList.map(item => item[this.label])
this.barOptions.series[0].data = dataList.map(item => item[this.valueName])
this[this.domId].setOption(this.barOptions)
}
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
},
updated() {
this[this.domId].resize()
}
}
</script>
<style lang="scss" scoped>
</style>
/*
* @Description: 柱状图配置
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-09-12 11:04:03
*/
import * as echarts from 'echarts'
function getBarOptions(obj, colorList, isMultiple, barwidth, formatYAxis) {
const barWidth = barwidth || '14'
const multiple = isMultiple || false
// const { tooltipFormatter } = obj
var barLineOption = {
// tooltip: {
// trigger: 'axis',
// borderWidth: 0,
// padding: 0,
// formatter: tooltipFormatter || '',
// confine: true
// },
xAxis: {
data: []
},
barWidth: barWidth,
yAxis: {
name: '',
type: 'value',
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
}
},
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
if (formatYAxis) {
return `${value / 10000}万`
} else {
return value
}
}
}
},
grid: {
left: '0',
right: '4%',
top: '20%',
bottom: '4%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
data: [],
label: {
show: true,
position: 'top',
color: '#fff',
fontSize: 8
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
var colorItem = []
if (multiple) {
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
}
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: multiple ? colorItem[0] : colorList[0]
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: multiple ? colorItem[1] : colorList[1]
},
{
offset: 1, // 指100%处的颜色
color: multiple ? colorItem[2] : colorList[2]
}]
)
}
}
}
]
}
return barLineOption
}
export default getBarOptions
<template>
<div class="core-box">
<box-title title="核心指标"></box-title>
<div class="core-box-content">
<!-- <StatisticsBox :list="coreIndexList"></StatisticsBox> -->
<PullDownSelect class="down-select" :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<inner-tab ref="innerTabCoreRef" class="tab-box" :list="tabList" :width="innerTabWidth" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart ref="coreChartRef" :label="'statYear'" height="28vh" domId="coreChart" :colorList="colorList" :barWidth="'50'" :valueName="valueName"></BarChart>
</div>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
export default {
name: 'CoreIndex',
components: {
PullDownSelect,
BarChart
},
data() {
return {
tabList: ['SaaS+门店总数', '有成交门店数', '活跃门店数'],
coreIndexList: [],
selectList: [
{
name: '门店活跃统计',
val: 'activeMerchant'
},
{
name: 'Saas门店留存率',
val: 'coreRetention'
}
],
activeMerchant: [],
coreRetention: [],
colorList: ['#22D8FF', '#223FA9', '#061422'],
valueName: 'saasMerchantNum',
selectActive: 0,
innerTabWidth: 18.3
}
},
created() {
// 门店活跃统计
this.getCoreActiveMerchant()
// SAAS门店留存率
this.getCoreRetention()
},
mounted() {
// this.$refs.coreChartRef.drawBar()
this.$bus.$on('innerGetAllOverview', data => {
this.coreIndexList = data.filter(item => item.tag === 'coreKeepMerchant')
})
},
methods: {
selectVal(val) {
console.log(val)
this.$refs.innerTabCoreRef.tabActive = 0
switch (val.val) {
case 'activeMerchant':
this.tabList = ['SaaS+门店总数', '有成交门店数', '活跃门店数']
this.selectActive = 0
this.innerTabWidth = 18.3
this.valueName = 'saasMerchantNum'
this.$nextTick(() => {
this.$refs.coreChartRef.drawBar(this.activeMerchant)
})
break
case 'coreRetention':
this.tabList = ['当年留存门店数', '上半年活跃门店数', '门店留存率']
this.selectActive = 1
this.innerTabWidth = 19.9
this.valueName = 'retentionNum'
this.$nextTick(() => {
this.$refs.coreChartRef.drawBar(this.coreRetention)
})
break
}
},
// tab切换
changeTab(val) {
console.log(val)
let _dataList = []
switch (val) {
case 0:
this.valueName = this.selectActive === 0 ? 'saasMerchantNum' : 'retentionNum'
break
case 1:
this.valueName = this.selectActive === 0 ? 'clinchDealMerchantNum' : 'lastyearActive'
break
case 2:
this.valueName = this.selectActive === 0 ? 'activeMerchantNum' : 'retention'
break
}
_dataList = this.selectActive === 0 ? this.activeMerchant : this.coreRetention
this.$nextTick(() => {
this.$refs.coreChartRef.drawBar(_dataList)
})
},
async getCoreActiveMerchant() {
const _data = await this.api.internal.getCoreActiveMerchant()
const _dataList = _data.data.dataList
this.activeMerchant = _dataList
this.$refs.coreChartRef.drawBar(_dataList)
},
async getCoreRetention() {
const _data = await this.api.internal.getCoreRetention()
const _dataList = _data.data.dataList
this.coreRetention = _dataList
}
}
}
</script>
<style lang="scss" scoped>
.core-box {
width: 23.33vw;
height: 40vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&-content {
padding: 1.56vh 0.83vw;
.tab-box {
margin-top: 1.78vh;
}
}
}
</style>
<template>
<div class="link-box">
<box-title title="数字化链接"></box-title>
<div class="link-box-content">
<StatisticsBox :list="digitalLinkList"></StatisticsBox>
<div class="down-content">
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<BarChart ref="linkChartRef" height="22vh" domId="linkChart" :label="'statDate'" :colorList="colorList" :valueName="'num'"></BarChart>
</div>
</div>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
export default {
name: 'DigitalLink',
components: {
PullDownSelect,
BarChart
},
data() {
return {
digitalLinkList: [],
selectList: [
{
name: '成品设备激活趋势',
val: 'finished'
},
{
name: '半成品发货趋势',
val: 'semifinished'
}
],
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
start: '',
end: ''
}
},
created() {
this.end = this.formatDate()
const start = new Date()
start.setTime(start.setMonth(start.getMonth() - 12))
this.start = this.formatDate(start)
this.getLinkFinishedProductTrend()
},
mounted() {
this.$bus.$on('innerGetAllOverview', data => {
this.digitalLinkList = data.filter(item => item.tag === 'digitalLink')
})
},
methods: {
selectVal(val) {
switch (val.val) {
case 'finished':
this.getLinkFinishedProductTrend('finished')
break
case 'semifinished':
this.getLinkFinishedProductTrend('semifinished')
break
}
},
async getLinkFinishedProductTrend(queryItem) {
const params = {
queryItem: queryItem || 'finished', // finished--成品,semifinished--半成品
queryType: 0,
startDate: this.start,
endDate: this.end
}
const _data = await this.api.internal.getLinkFinishedProductTrend(params)
const _dataList = _data.data.dataList
this.$refs.linkChartRef.drawBar(_dataList)
},
// 日期转化
formatDate(val) {
const date = val || new Date()
const year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
const currentdate = year + '-' + month + '-' + day
return currentdate
}
}
}
</script>
<style lang="scss" scoped>
.link-box {
width: 23.33vw;
height: 40vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&-content {
padding: 1.56vh 0.83vw;
/deep/ .statistics {
height: 8vh;
}
.down-content {
margin-top: 1.78vh;
height: 21.5vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
}
</style>
<template>
<div class="digital-marketing-box">
<box-title title="数字化营销"></box-title>
<Tab class="tab" :list="tabList" :width="15.9" :itemWidth="7.92" @changeTab="changeTab"></Tab>
<div class="digital-marketing-box-content">
<StatisticsBox :list="digitalMarketingList"></StatisticsBox>
<div class="digital-marketing-box-content-bottom">
<DigitalMarketingLeft></DigitalMarketingLeft>
<DigitalMarketingRight></DigitalMarketingRight>
</div>
</div>
</div>
</template>
<script>
import DigitalMarketingLeft from './DigitalMarketingLeft.vue'
import DigitalMarketingRight from './DigitalMarketingRight.vue'
// import { digitalMarketingObj } from './constant'
export default {
name: 'DigitalMarketing',
components: {
DigitalMarketingLeft,
DigitalMarketingRight
},
data() {
return {
tabList: ['1.1精品升级', '1.3售后众筹'],
activeName: 0,
// digitalMarketingList: digitalMarketingObj.boutique
allDigitalMarketingList: [],
digitalMarketingList: []
}
},
mounted() {
this.$bus.$on('innerGetAllOverview', data => {
this.allDigitalMarketingList = data
this.digitalMarketingList = data.filter(item => item.tag === 'digitalMarketingUpgrade')
})
},
methods: {
changeTab(data) {
this.activeName = data
console.log(data);
switch (data) {
case 0:
this.digitalMarketingList = this.allDigitalMarketingList.filter(item => item.tag === 'digitalMarketingUpgrade')
break
case 1:
this.digitalMarketingList = this.allDigitalMarketingList.filter(item => item.tag === 'digitalMarketingCrowdFunding')
break
}
this.$bus.$emit('digitalMarketingTabChange', data)
}
}
}
</script>
<style lang="scss" scoped>
.digital-marketing-box {
height: 47.56vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
/deep/.tab-item-box {
margin: 0 auto;
}
&-content {
padding: 1.56vh 0.83vw;
/deep/ .statistics {
height: 8vh;
}
&-bottom {
display: flex;
justify-content: space-between;
margin-top: 1.78vh;
}
}
}
</style>
<template>
<div class="marketing-left">
<PullDownSelect ref="leftDownSelect" :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<inner-tab class="inner-tab" v-if="tabShow" :list="tabList" :width="6.4" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart v-if="chartShow" ref="trendChartRef" domId="trendChart" :label="'statMonth'" height="22vh" :colorList="colorList" :valueName="valueName"></BarChart>
<LineChart v-if="!chartShow" ref="monthIncomeLineChartRef" domId="monthIncomeLineChart" :height="'18vh'" :valName="valName"></LineChart>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import LineChart from './LineCharts.vue'
import PullDownSelect from './PullDownSelect.vue'
import { digitalMarketingLeftSelectList } from './constant'
export default {
name: 'DigitalMarketingLeft',
components: {
PullDownSelect,
BarChart,
LineChart
},
data() {
return {
tabList: ['订单量', '收入'],
selectList: digitalMarketingLeftSelectList[0],
colorList: ['#2AD191', '#00A89E', '#061422'],
valueName: 'registerNum',
tabShow: false,
marketingTrendList: [],
marketingCrowdFundingTrendList: [],
chartShow: true,
valName: 'orderNum',
tabActive: 0
}
},
created() {
this.getMarketingTrend()
this.getMarketingCrowdFundingTrend()
},
mounted() {
// this.$refs.trendChartRef.drawBar()
this.$bus.$on('digitalMarketingTabChange', data => {
// console.log(data)
this.$refs.leftDownSelect.selectType = ''
this.tabActive - data
this.tabShow = false
this.chartShow = true
this.selectList = digitalMarketingLeftSelectList[data]
switch (data) {
case 0:
this.valueName = 'registerNum'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
})
break
case 1:
this.valueName = 'activityNum'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
})
break
}
})
},
methods: {
selectVal(val) {
const actions = {
registerNum: () => {
this.chartShow = true
this.tabShow = false
this.valueName = 'registerNum'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
})
},
activeNum: () => {
this.chartShow = true
this.valueName = 'activeNum'
this.tabShow = false
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
})
},
output: () => {
this.valName = 'orderNum'
this.chartShow = false
this.tabShow = true
this.$nextTick(() => {
this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
})
},
activityNum: () => {
this.chartShow = true
this.valueName = 'activityNum'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
})
},
orderNum: () => {
this.chartShow = true
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
})
},
avgPrice: () => {
this.chartShow = true
this.valueName = 'avgPrice'
this.$nextTick(() => {
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
})
}
}
const action = actions[val.val]
if (action) {
action()
}
},
changeTab(val) {
console.log(val)
switch (val) {
case 0:
if (this.tabActive === 0) {
this.valName = 'orderNum'
console.log(111)
this.$nextTick(() => {
this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
})
}
break
case 1:
if (this.tabActive === 0) {
this.valName = 'output'
this.$nextTick(() => {
this.$refs.monthIncomeLineChartRef.drawLine(this.marketingTrendList)
})
}
break
}
},
async getMarketingTrend() {
const _data = await this.api.internal.getMarketingTrend()
const _dataList = _data.data.dataList
this.marketingTrendList = _dataList
this.$refs.trendChartRef.drawBar(_dataList)
},
async getMarketingCrowdFundingTrend() {
const _data = await this.api.internal.getMarketingCrowdFundingTrend()
const _dataList = _data.data.dataList
this.marketingCrowdFundingTrendList = _dataList
}
}
}
</script>
<style lang="scss" scoped>
.marketing-left {
width: 22.78vw;
height: 25vh;
display: flex;
flex-direction: column;
justify-content: space-between;
.inner-tab {
/deep/.tab-item-box {
margin: 0;
}
}
}
</style>
<template>
<div class="marketing-right">
<PullDownSelect ref="rightDownSelect" v-show="!switchShow" :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<div class="patch-title" v-show="switchShow">活动订单金额分布</div>
<inner-tab ref="innerTabRef" class="inner-tab" :list="tabList" :width="tabWidth" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<!-- 1.3售后众筹显示占比和价格区间切换 -->
<div class="switch-box" v-if="switchShow">
<div class="text">收入占比:{{ ratio }}%</div>
<PriceSwitch :selectList="priceList" @selectPrice="selectPrice"></PriceSwitch>
</div>
<BarChart ref="merchantChartRef" domId="merchantChart" :label="barChartLabel" :height="barchartHeight" :colorList="colorList" :barWidth="'50'" :valueName="valueName"></BarChart>
</div>
</template>
<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
import PriceSwitch from './PriceSwitch.vue'
import { digitalMarketingPriceObj, digitalMarketingRightSelectList } from './constant'
export default {
name: 'DigitalMarketingRight',
components: {
PullDownSelect,
BarChart,
PriceSwitch
},
data() {
return {
tabList: ['门店数', '总金额'],
tabWidth: 7.3,
priceList: digitalMarketingPriceObj.merchantOrderlist,
selectList: digitalMarketingRightSelectList[0],
selectType: '',
marketingDistributionList: [],
colorList: ['#22D8FF', '#223FA9', '#061422'],
barchartHeight: '16vh',
switchShow: false,
valueName: 'outputMerchantNum',
downSelectNum: 0,
ratio: '',
digitalMarketingTab: 0,
barChartLabel: 'statYear',
marketingCrowdFundingDistr: [],
startPrice: '',
endPrice: '',
crowfundDistrType: ''
}
},
created() {
// :门店订单金额分布 && 门店订单量分布
this.getMarketingDistribution()
},
mounted() {
this.$bus.$on('digitalMarketingTabChange', data => {
this.digitalMarketingTab = data
this.tabShow = false
this.selectList = digitalMarketingRightSelectList[data]
switch (data) {
case 0:
this.switchShow = false
this.tabWidth = 7.3
this.tabList = ['门店数', '总金额']
this.valueName = 'outputMerchantNum'
this.barChartLabel = 'statYear'
this.getMarketingDistribution()
break
case 1:
this.switchShow = true
this.tabWidth = 10.8
this.tabList = ['门店数', '订单数', '总金额']
this.valueName = 'num'
this.barChartLabel = 'statDate'
this.getMarketingCrowdFundingDistr('merData')
break
}
})
},
methods: {
selectVal(val) {
this.$refs.innerTabRef.tabActive = 0
switch (val.val) {
case 'outputMerchantNum':
this.tabWidth = 7.3
this.tabList = ['门店数', '总金额']
this.valueName = 'outputMerchantNum'
this.downSelectNum = 0
this.$nextTick(() => {
this.$refs.merchantChartRef.drawBar(this.marketingDistributionList)
})
break
case 'orderMerchantNum':
this.tabList = ['门店数', '总订单数']
this.tabWidth = 8.1
this.valueName = 'orderMerchantNum'
this.downSelectNum = 1
this.$nextTick(() => {
this.$refs.merchantChartRef.drawBar(this.marketingDistributionList)
})
break
}
},
changeTab(val) {
console.log(val)
switch (val) {
case 0:
// 1.1精品升级
if (this.digitalMarketingTab === 0) {
this.valueName = this.downSelectNum === 0 ? 'outputMerchantNum' : 'orderMerchantNum'
this.$refs.merchantChartRef.drawBar(this.marketingDistributionList)
} else {
// 1.3售后众筹
this.crowfundDistrType = 'merData'
this.marketingDistributionList = this.marketingCrowdFundingDistr.merData.trendData
this.ratio = this.marketingCrowdFundingDistr.merData.ratio
}
break
case 1:
// 1.1精品升级
if (this.digitalMarketingTab === 0) {
this.valueName = this.downSelectNum === 0 ? 'outputMoney' : 'orderMoney'
this.$refs.merchantChartRef.drawBar(this.marketingDistributionList)
} else {
// 1.3售后众筹
this.crowfundDistrType = 'orderData'
this.marketingDistributionList = this.marketingCrowdFundingDistr.orderData.trendData
this.ratio = this.marketingCrowdFundingDistr.merData.ratio
}
break
case 2:
// 只有1.3售后众筹
this.crowfundDistrType = 'incomeData'
this.marketingDistributionList = this.marketingCrowdFundingDistr.incomeData.trendData
this.ratio = this.marketingCrowdFundingDistr.merData.ratio
break
}
this.$nextTick(() => {
this.$refs.merchantChartRef.drawBar(this.marketingDistributionList)
})
},
async getMarketingDistribution() {
const _data = await this.api.internal.getMarketingDistribution()
const _dataList = _data.data.dataList
this.marketingDistributionList = _dataList
this.$refs.merchantChartRef.drawBar(_dataList)
},
// 活动订单金额分布
async getMarketingCrowdFundingDistr(queryItem) {
const params = {
startPrice: this.startPrice,
endPrice: this.endPrice
}
const _data = await this.api.internal.getMarketingCrowdFundingDistr(params)
const _queryItem = queryItem || this.crowfundDistrType
const _dataList = _data.data.dataList[0][_queryItem].trendData
this.marketingCrowdFundingDistr = _data.data.dataList[0]
this.marketingDistributionList = _dataList
this.ratio = _data.data.dataList[0][_queryItem].ratio
this.$refs.merchantChartRef.drawBar(_dataList)
},
selectPrice(val) {
if (val.label === '全部') {
this.startPrice = ''
this.endPrice = ''
this.getMarketingCrowdFundingDistr()
return
}
this.startPrice = val.startPrice
this.endPrice = val.endPrice
this.getMarketingCrowdFundingDistr()
}
}
}
</script>
<style lang="scss" scoped>
.marketing-right {
width: 22.78vw;
height: 25vh;
display: flex;
flex-direction: column;
justify-content: space-between;
.inner-tab {
/deep/.tab-item-box {
margin: 0;
}
}
.switch-box {
display: flex;
justify-content: space-between;
.text {
font-weight: 600;
font-size: 10px;
color: #ffffff;
}
}
}
</style>
<template>
<div>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import utils from '../../../utils/util'
import * as echarts from 'echarts'
import getBarLineOptions from './DoubleBarOptions'
export default {
name: 'DoubleBarChart',
props: {
height: {
type: String
},
domId: {
type: String,
default: 'bar-line'
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
barLineOptions: [],
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
// created() {
// this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
// },
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
drawBar(dataList) {
this.barLineOptions = getBarLineOptions({ seriesData: dataList })
this.barLineOptions.xAxis.data = dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = dataList.map(item => item.channel_zx)
this.barLineOptions.series[1].data = dataList.map(item => item.channel_qd)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style scoped lang="scss"></style>
import * as echarts from 'echarts'
import utils from '../../../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
// tooltip: {
// trigger: 'axis',
// borderWidth: 0,
// padding: 0,
// backgroundColor: '#051526',
// formatter: tooltipFormatter || ''
// },
xAxis: {
data: []
},
yAxis: {
name: '',
type: 'value',
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
}
},
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
return `${value / 10000}万`
}
}
},
grid: {
left: '3%',
right: '2%',
top: '20%',
bottom: '6%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
stack: 'one',
data: [],
label: {
show: true,
position: 'top',
color: '#fff',
formatter: params => {
return params.value ? utils.numAddSymbol((params.value / 10000).toFixed(0)) : ''
}
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
const colorList = [
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
// 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0]
}, // 柱图渐变色
{
offset: 1, // 指100%处的颜色
color: colorItem[1]
}
])
}
}
},
{
name: 'bar2',
type: 'bar',
stack: 'one',
min: 100,
label: {
show: true,
position: 'top',
color: '#fff',
formatter: params => {
return params.value ? utils.numAddSymbol((params.value / 10000).toFixed(0)) : ''
}
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
const colorList = [
['#11627A', '#282F7A'],
['#145F4E', '#035972']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
// 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0]
}, // 柱图渐变色
{
offset: 1, // 指100%处的颜色
color: colorItem[1]
}
])
}
}
}
]
}
return barLineOption
}
export default getBarLineOptions
<!--
* @Description: 折线图组件
* @Author: huyue
* @Date: 2023-09-06 15:08:05
* @LastEditors: huyue
* @LastEditTime: 2023-09-07 18:02:59
-->
<template>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</template>
<script type="text/ecmascript-6">
import utils from '../../../utils/util'
import * as echarts from 'echarts'
import getLineOptions from './lineOption.js'
export default {
name: 'LineCharts',
props: {
height: {
type: String
},
// dataList: {
// type: Array,
// default: () => []
// },
domId: {
type: String,
default: 'bar-line'
},
tooltipFormatterObj: {
type: Object,
default: () => {}
},
valName: {
type: String,
default: 'val'
}
},
data() {
return {
dataList: []
}
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = `<div><div style="color: #FFFFFF">${_currentItem.statMonth || _currentItem.statDate}</div><div style="display:flex;align-items:center"><div style="width: 4px;height: 4px;background: #FFC200;border-radius: 4px;margin-right: 4px;"></div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.valName])}</div></div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawLine(dataList) {
this.dataList = dataList
this.barLineOptions = getLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: dataList })
this.barLineOptions.xAxis.data = dataList.map(item => item.statMonth || item.statDate)
this.barLineOptions.series[0].data = dataList.map(item => item[this.valName])
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div class="price-select">
<div class="type-plugin">
<div class="trend-type-box" @click.stop="switchType">
<div class="text">{{ selectType || priceList[0].label }}</div>
<div class="trangle-icon"></div>
</div>
<SelectBox :isShow="isShow" :defaultValue.sync="priceList[0].value" @clickOutside="clickOutside" :dataList.sync="priceList" isObject :boxWidth="boxWidth" @selectVal="selectPrice"></SelectBox>
</div>
</div>
</template>
<script>
export default {
name: 'PriceSwitch',
props: {
selectList: {
type: Array,
default: () => []
},
boxWidth: {
type: String,
default: ''
},
unit: {
type: String,
default: '元'
}
},
data() {
return {
isShow: false,
selectType: '',
priceList: []
}
},
watch: {
selectList: {
handler(newVal) {
console.log(newVal)
// this.priceList = newVal
// this.priceList = []
// newVal.forEach(item => {
// this.priceList.push(item + this.unit)
// })
// if (!this.unit) return (this.priceList = newVal)
if (this.unit) {
this.priceList.unshift({
label: '全部',
value: ''
})
}
this.priceList = this.priceList.concat(newVal)
},
immediate: true
}
},
mounted() {},
methods: {
switchType() {
this.isShow = !this.isShow
},
clickOutside() {
this.isShow = false
},
selectPrice(val) {
this.selectType = val.label
this.$emit('selectPrice', val)
this.switchType()
}
}
}
</script>
<style lang="scss" scoped>
.price-select {
.type-plugin {
position: relative;
}
.trend-type-box {
display: flex;
width: fit-content;
height: 2.22vh;
line-height: 2.22vh;
padding: 0 0.83vw;
box-sizing: border-box;
.text {
font-weight: 600;
font-size: 10px;
color: #ffffff;
margin-right: 0.83vw;
}
.trangle-icon {
width: 0px;
height: 0px;
border: 4px solid transparent;
border-top: 4px solid #fff;
margin-top: 8%;
}
}
/deep/.select-box {
top: 2vh;
padding: 0.2vw 0;
.select-item {
padding: 0 0.5vw;
font-size: 10px;
margin-bottom: 0.5vh;
}
.select-item:last-child {
margin-bottom: 0;
}
}
}
</style>
<template>
<div class="down-select">
<div class="type-plugin">
<div class="trend-type-box" @click.stop="switchType">
<div class="text">{{ selectType || selectList[0].name }}</div>
<div class="trangle-icon"></div>
</div>
<SelectBox
:isShow="isShow"
isObject
:defaultValue.sync="selectList[0]"
@clickOutside="clickOutside"
:dataList.sync="selectList"
:boxWidth="boxWidth"
@selectVal="selectVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
</div>
</div>
</template>
<script>
export default {
name: 'PullDownSelect',
props: {
selectList: {
type: Array,
default: () => []
},
boxWidth: {
type: String,
default: '9.1vw'
}
},
data() {
return {
isShow: false,
selectType: ''
}
},
mounted() {},
methods: {
switchType() {
this.isShow = !this.isShow
},
clickOutside() {
this.isShow = false
},
selectVal(val) {
this.selectType = val.name
this.$emit('selectVal', val)
this.switchType()
}
}
}
</script>
<style lang="scss" scoped>
.down-select {
.type-plugin {
position: relative;
}
.trend-type-box {
display: flex;
width: fit-content;
height: 2.22vh;
line-height: 2.22vh;
padding: 0 0.83vw;
box-sizing: border-box;
background-image: linear-gradient(269deg, #5663ff00 10%, #6578ffd4 49%, #079ff1 100%);
.text {
font-weight: 500;
font-size: 14px;
color: #ffffff;
margin-right: 0.83vw;
}
.trangle-icon {
width: 0px;
height: 0px;
border: 4px solid transparent;
border-top: 4px solid #fff;
margin-top: 6%;
}
}
/deep/.select-box {
top: 2.8vh;
padding: 0.5vw 0;
.select-item {
padding: 0 0.5vw;
}
}
}
</style>
<template>
<div class="clue">
<div class="trend-box">
<div class="patch-title">注册门店趋势</div>
<BarChart ref="signChartRef" domId="signChart" :height="chartHeight" valueName="activeNum" :colorList="colorList"></BarChart>
</div>
<div class="trend-box">
<div class="patch-title">活跃门店趋势</div>
<BarChart ref="dynamicChartRef" domId="dynamicChart" :height="chartHeight" valueName="registerNum" :colorList="greenColorList"></BarChart>
</div>
<div class="trend-box">
<div class="patch-title">月收入趋势</div>
<LineChart ref="monthIncomeChartRef" domId="monthIncomeChart" :height="chartHeight" valName="output"></LineChart>
</div>
<div class="trend-box marketing-trend">
<div class="patch-title">销售渠道趋势</div>
<!-- <BarChart ref="saleChartRef" domId="saleChart" :height="chartHeight" :colorList="colorList" valueName="channel"></BarChart> -->
<DoubleBarChart ref="saleChartRef" domId="purchase" :height="chartHeight" :colorList="colorList" valueName="channel"></DoubleBarChart>
<div class="legend">
<div class="legend-item shop">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
<span>直销</span>
</div>
<div class="legend-item self">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
渠道
</div>
</div>
</div>
<div class="trend-box">
<div class="patch-title">
按年统计客户销售金额的合理性 -
<PriceSwitch class="rationality" unit="" isObject :selectList="selectList" @selectPrice="selectRationality"></PriceSwitch>
</div>
<div class="rationality-text">
收入占比:{{ ratio }}%
<PriceSwitch style="display: inline-block" :selectList="rationalityPriceList" @selectPrice="selectPrice"></PriceSwitch>
</div>
<BarChart ref="rationalityChartRef" domId="rationalityChart" height="13.99vh" label="statDate" :barWidth="'50'" :colorList="greenColorList" valueName="num"></BarChart>
</div>
<div class="trend-box">
<div class="patch-title">设备订阅数量和线索相关性分析</div>
<div class="correlation"><PriceSwitch style="display: inline-block" unit="" boxWidth="6.94vw" :selectList="serviceList" @selectPrice="selectCorrelation"></PriceSwitch></div>
<LineChart ref="correlationChartRef" domId="correlationChart" height="13.99vh" :tooltipFormatterObj="correlationTooltips" :valName="correlationTooltips.attrName"></LineChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import LineChart from './LineCharts.vue'
import PriceSwitch from './PriceSwitch.vue'
import DoubleBarChart from './DoubleBarChart.vue'
import { rationalityList, rationalityPriceList, serviceList } from './constant'
export default {
name: 'InternalRight',
components: {
BarChart,
LineChart,
PriceSwitch,
DoubleBarChart
},
data() {
return {
chartHeight: '20vh',
colorList: ['#22D8FF', '#223FA9', '#061422'],
greenColorList: ['#2AD191', '#0E958D', '#063139'],
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 600
},
{
statMonth: '2023',
actiNum: 800
}
],
correlationTooltips: {
label: '设备数',
attrName: 'deviceNum'
},
selectList: rationalityList,
rationalityPriceList,
serviceList,
ratio: '',
rationality: rationalityList[0].value,
startPrice: '',
endPrice: '',
manageClueSalesAmountRationalityList: []
}
},
mounted() {
this.init()
},
methods: {
init() {
this.getManageClueTrend()
this.getManageClueSalesAmountRationality('merData')
this.getManageClueAnalysis()
},
async getManageClueTrend() {
const _data = await this.api.internal.getManageClueTrend()
const _dataList = _data.data.dataList
this.$refs.signChartRef.drawBar(_dataList)
this.$refs.dynamicChartRef.drawBar(_dataList)
this.$refs.monthIncomeChartRef.drawLine(_dataList)
this.$refs.saleChartRef.drawBar(_dataList)
},
async getManageClueSalesAmountRationality(queryItem) {
const params = {
startPrice: this.startPrice,
endPrice: this.endPrice
}
const _data = await this.api.internal.getManageClueSalesAmountRationality(params)
const _queryItem = queryItem || this.rationality
this.manageClueSalesAmountRationalityList = _data.data.dataList[0]
const _dataList = _data.data.dataList[0][_queryItem].trendData
this.ratio = _data.data.dataList[0][_queryItem].ratio
this.$refs.rationalityChartRef.drawBar(_dataList)
},
async getManageClueAnalysis() {
const _data = await this.api.internal.getManageClueAnalysis()
const _dataList = _data.data.dataList
this.$refs.correlationChartRef.drawLine(_dataList)
},
selectRationality(val) {
console.log(val)
this.rationality = val.value
const _dataList = this.manageClueSalesAmountRationalityList[val.value].trendData
this.ratio = this.manageClueSalesAmountRationalityList[val.value].ratio
this.$refs.rationalityChartRef.drawBar(_dataList)
},
// 只有当是销售数(output)时才会触发此事件
selectPrice(val) {
if (val.label === '全部') {
this.startPrice = ''
this.endPrice = ''
this.getManageClueSalesAmountRationality()
return
}
this.startPrice = val.startPrice
this.endPrice = val.endPrice
this.getManageClueSalesAmountRationality()
},
selectCorrelation(val) {
this.$set(this.correlationTooltips, 'attrName', val.value)
this.getManageClueAnalysis()
}
}
}
</script>
<style lang="scss" scoped>
.clue {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.marketing-trend {
position: relative;
.legend {
font-size: 10px;
display: flex;
position: absolute;
right: 1.39vw;
top: 2.22vh;
&-item {
display: flex;
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
img {
width: 1.32vw;
height: 1vh;
margin-right: 0.28vw;
}
.icon-line {
width: 0.98vw;
height: 0.56vh;
}
.legend-even,
.legend-odd {
display: inline-block;
width: 0.83vw;
height: 1.33vh;
line-height: 1.33vh;
margin-right: 0.28vw;
font-size: 8px;
text-align: center;
}
}
.shop {
.legend-even {
background-image: linear-gradient(180deg, #2ad190 1%, #00b7df 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #22d8ff 0%, #5c56ff 100%);
}
}
.self {
.legend-even {
background-image: linear-gradient(180deg, #145f4e 1%, #035972 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #11627a 0%, #282f7a 100%);
}
}
}
}
.trend-box {
display: inline-block;
height: 23vh;
width: 50%;
&:nth-child(1),
&:nth-child(2) {
margin-top: 1.78vh;
}
}
.rationality {
display: inline-block;
/deep/ {
.type-plugin {
.trend-type-box {
padding-left: 5px;
}
.text {
font-weight: 400;
font-size: 14px;
}
}
}
&-text {
display: flex;
justify-content: space-between;
font-size: 10px;
font-weight: 600;
color: #fff;
margin-top: 1.33vh;
}
}
.correlation {
display: flex;
flex-direction: row-reverse;
margin-top: 1.33vh;
}
</style>
<template>
<div class="edun-box">
<div class="edun-statistic-box">
<div class="patch-title title">按年统计客户销售金额分布的合理性</div>
<inner-tab class="inner-tab" :list="tabList" :width="8.1" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<div class="switch-box">
<div class="text">收入占比:{{ ratio }}%</div>
<PriceSwitch :selectList="priceList" @selectPrice="selectPrice"></PriceSwitch>
</div>
<BarChart ref="edunChartRef" domId="edunChart" :label="'statDate'" :height="'24vh'" :colorList="colorList" :barWidth="'50'" valueName="num"></BarChart>
</div>
<div class="income-box">
<div class="patch-title title">月收入趋势</div>
<LineChart ref="edunLineChartRef" domId="edunLineChart" :height="'30vh'" :valName="'num'"></LineChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import PriceSwitch from './PriceSwitch.vue'
import LineChart from './LineCharts.vue'
import { edunPriceList } from './constant'
export default {
name: 'ViewEdun',
components: {
BarChart,
PriceSwitch,
LineChart
},
data() {
return {
tabList: ['品牌商数', '总金额'],
priceList: edunPriceList,
colorList: ['#22D8FF', '#223FA9', '#061422'],
ratio: 0,
startPrice: '',
endPrice: '',
EDqueryItem: 'brandData',
ESalesAmountRationalitydataList: []
}
},
created() {
// 按年统计客户销售金额的合理性
this.getManageESalesAmountRationality('brandData')
// 月收入趋势
this.getManageETrend()
},
mounted() {
},
methods: {
changeTab(val) {
const queryItems = ['brandData', 'incomeData']
this.EDqueryItem = queryItems[val]
const _dataList = this.ESalesAmountRationalitydataList[this.EDqueryItem].trendData
this.ratio = this.ESalesAmountRationalitydataList[this.EDqueryItem].ratio
this.$refs.edunChartRef.drawBar(_dataList)
},
selectPrice(val) {
if (val.label === '全部') {
this.startPrice = ''
this.endPrice = ''
this.getManageESalesAmountRationality()
return
}
this.startPrice = val.startPrice
this.endPrice = val.endPrice
this.getManageESalesAmountRationality()
},
async getManageESalesAmountRationality(queryItem) {
const params = {
startPrice: this.startPrice,
endPrice: this.endPrice
}
const _data = await this.api.internal.getManageESalesAmountRationality(params)
const _queryItem = queryItem || this.EDqueryItem
this.ESalesAmountRationalitydataList = _data.data.dataList[0]
const _dataList = _data.data.dataList[0][_queryItem].trendData
this.ratio = _data.data.dataList[0][_queryItem].ratio
this.$refs.edunChartRef.drawBar(_dataList)
},
async getManageETrend() {
const _data = await this.api.internal.getManageETrend()
const _dataList = _data.data.dataList
this.$refs.edunLineChartRef.drawLine(_dataList)
}
}
}
</script>
<style lang="scss" scoped>
.edun-box {
.edun-statistic-box {
height: 34vh;
.inner-tab {
margin: 0.92vh 0;
}
.switch-box {
display: flex;
justify-content: space-between;
.text {
font-weight: 600;
font-size: 10px;
color: #ffffff;
}
}
}
.title {
margin-top: 1.78vh;
}
}
</style>
<template>
<div class="equity-box">
<div class="equity-statistic-box">
<div class="patch-title title">按年统计客户销售金额分布的合理性</div>
<inner-tab class="inner-tab" :list="tabList" :width="12.4" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<div class="switch-box">
<div class="text">收入占比:{{ ratio }}%</div>
<PriceSwitch :selectList="priceList" @selectPrice="selectPrice"></PriceSwitch>
</div>
<BarChart ref="equityChartRef" domId="equityChart" :label="'statDate'" :height="'24vh'" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips" valueName="num"></BarChart>
</div>
<div class="income-box">
<div class="patch-title title">月收入趋势</div>
<LineChart ref="equityLineChartRef" domId="equityLineChart" :height="'30vh'" :tooltipFormatterObj="tooltips" :valName="tooltips.attrName"></LineChart>
</div>
</div>
</template>
<script>
import BarChart from './BarChart.vue'
import PriceSwitch from './PriceSwitch.vue'
import LineChart from './LineCharts.vue'
import { equityPriceList } from './constant'
export default {
name: 'Viewequity',
components: {
BarChart,
PriceSwitch,
LineChart
},
data() {
return {
tabList: ['门店数', '会员人数', '销售收入'],
priceList: equityPriceList,
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'num'
},
ratio: 0,
equityItem: 'merData',
startPrice: '',
endPrice: '',
manageMemberSalesAmountList: []
}
},
created() {
// 按年统计客户销售金额的合理性
this.getManageMemberSalesAmountRationality('merData')
// 月收入趋势
this.getManageMemberTrend()
},
mounted() {
},
methods: {
changeTab(val) {
const queryItems = ['merData', 'customerData', 'incomeData']
this.equityItem = queryItems[val]
const _dataList = this.manageMemberSalesAmountList[this.equityItem].trendData
this.ratio = this.manageMemberSalesAmountList[this.equityItem].ratio
this.$refs.equityChartRef.drawBar(_dataList)
},
async getManageMemberSalesAmountRationality(queryItem) {
const params = {
startPrice: this.startPrice,
endPrice: this.endPrice
}
const _data = await this.api.internal.getManageMemberSalesAmountRationality(params)
const _queryItem = queryItem || this.equityItem
this.manageMemberSalesAmountList = _data.data.dataList[0]
const _dataList = _data.data.dataList[0][_queryItem].trendData
this.ratio = _data.data.dataList[0][_queryItem].ratio
this.$refs.equityChartRef.drawBar(_dataList)
},
async getManageMemberTrend() {
const _data = await this.api.internal.getManageMemberTrend()
const _dataList = _data.data.dataList
this.$refs.equityLineChartRef.drawLine(_dataList)
},
selectPrice(price) {
if (price.label === '全部') {
this.startPrice = ''
this.endPrice = ''
this.getManageMemberSalesAmountRationality()
return
}
this.startPrice = price.startPrice
this.endPrice = price.endPrice
this.getManageMemberSalesAmountRationality()
// let _price = price.
}
}
}
</script>
<style lang="scss" scoped>
.equity-box {
.equity-statistic-box {
height: 34vh;
.inner-tab {
margin: 0.92vh 0;
}
.switch-box {
display: flex;
justify-content: space-between;
.text {
font-weight: 600;
font-size: 10px;
color: #ffffff;
}
}
}
.title {
margin-top: 1.78vh;
}
}
</style>
// import utils from '../../utils/util'
function getLineOptions(obj) {
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: tooltipFormatter || ''
},
xAxis: {
data: []
},
yAxis: [
{
// 纵轴标尺固定
type: 'value',
scale: true,
// max: 200,
min: 0,
splitNumber: 4,
boundaryGap: [0.1, 0.1],
splitLine: {
lineStyle: {
color: '#ffffff1a'
}
}
}
],
grid: {
left: '3%',
right: '2%',
top: '25%',
bottom: '6%',
containLabel: true
},
series: [
{
name: 'line',
type: 'line',
data: [],
showSymbol: true, // 是否默认展示圆点
symbol: 'circle', // 设定为实心点
symbolSize: 6, // 设定实心点的大小
itemStyle: {
normal: {
color: '#FFC200', // 改变折线点的颜色
lineStyle: {
color: '#FFC200' // 改变折线颜色
}
}
}
}
]
}
return barLineOption
}
export default getLineOptions
......@@ -234,9 +234,9 @@ export default {
border-bottom: 1px solid #0a2d26;
height: 4.88vh;
}
.clew-num {
color: #FF0000;
}
// .clew-num {
// color: #FF0000;
// }
}
.bg-2 {
background: #280935;
......
......@@ -50,7 +50,7 @@ export default {
name: 'purchaseamount',
hasIcon: '¥',
type: 'number',
width: '5vw'
width: '5.5vw'
}
]
}
......
......@@ -127,12 +127,12 @@ export default {
margin-top: 1.78vh;
&-left,
&-right {
width: 47.78vw;
height: 25.33vh;
width: 31.46vw;
height: 31.56vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
.content-box {
padding: 1.78vh 6.18vw 4.44vh 0;
padding: 3.78vh 1.78vw 4.44vh 1.78vw;
}
.empty {
height: 22vh;
......
......@@ -18,7 +18,7 @@
商城采购占比
</div>
</div>
<BarLineChart ref="purchaseTrend" height="36.45vh" domId="purchaseTrend" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<BarLineChart ref="purchaseTrend" height="29.11vh" domId="purchaseTrend" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
</div>
<div v-else class="empty">
<Empty></Empty>
......@@ -72,10 +72,9 @@ export default {
<style lang="scss" scoped>
.tendency-box {
position: relative;
width: 96.67vw;
height: 39.78vh;
width: 64.03vw;
height: 33.56vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
margin-top: 1.78vh;
.legend {
font-size: 14px;
display: flex;
......
<template>
<div>
<el-table :id="id" :data="tableData" style="width: 100%" :header-cell-style="{ color: '#e8e8e8', fontSize: '11px', height: '3.11vh', background: '#0a214d' }">
<el-table-column prop="merchantname" :label="firstName" width="250"></el-table-column>
<el-table-column prop="amounttotal" label="采购额/元"></el-table-column>
<el-table-column prop="warehousing" label="入库额/元"></el-table-column>
<template slot="empty">
<div class="empty">
<Empty></Empty>
</div>
</template>
</el-table>
</div>
</template>
<script>
export default {
name: 'PurchaseStorageTable',
props: {
tableData: {
type: Array,
default: () => []
},
id: String,
firstName: {
type: String,
default: '服务中心名称'
}
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss">
.el-table {
font-weight: 500;
font-size: 11px;
text-align: center;
height: 26.33vh;
overflow: auto;
background-color: #061422;
thead {
height: 3.11vh;
background: #0a214d;
color: #e8e8e8;
}
tbody tr {
height: 2.56vh;
color: #ffffff;
}
}
.el-table__body-wrapper {
max-height: 52vh;
// overflow-y: scroll;
}
.el-table tr {
background-color: #061422;
}
.el-table .el-table__cell {
padding: 0 !important;
}
.el-table--enable-row-hover .el-table__body tr:hover > td {
background-color: transparent !important;
}
.el-table--enable-row-hover .el-table__body tr:hover {
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%) !important;
font-weight: 500;
color: #ffffff;
}
.pagination-box {
margin-top: 1.78vh;
}
.el-table td.el-table__cell,
.el-table th.el-table__cell.is-leaf {
border-bottom: 1px solid #161c5f;
}
.el-table--border::after,
.el-table--group::after,
.el-table::before {
content: '';
position: absolute;
background-color: transparent;
z-index: 1;
}
.el-scrollbar {
.el-scrollbar__wrap {
margin-bottom: -15px !important;
}
}
.el-table__empty-block {
background-color: #051526;
}
.el-table .cell {
line-height: 1vw;
}
.el-table__empty-text {
line-height: 2.11vh;
}
</style>
<style lang="scss" scoped>
.empty {
margin: 5vh 0;
}
</style>
......@@ -8,10 +8,24 @@
<div class="solar-detail-content">
<view-date :defaultYear="defaultYear" :dataList="yearList" :businessTime="businessTime"></view-date>
<StatisticsBox class="statistic-box" :list="solarDetailList"></StatisticsBox>
<!-- 采购趋势 -->
<MerchantsPurchaseTrends ref="merchantsTrends" :dataList="dataList" :isEmpty="isEmpty"></MerchantsPurchaseTrends>
<!-- 商品占比 -->
<MerchantsPropotion :shopmallData="shopmallData" :selfPickData="selfPickData"></MerchantsPropotion>
<div class="solar-detail-content-bottom">
<div class="solar-detail-left">
<!-- 采购趋势 -->
<MerchantsPurchaseTrends ref="merchantsTrends" :dataList="dataList" :isEmpty="isEmpty"></MerchantsPurchaseTrends>
<!-- 商品占比 -->
<MerchantsPropotion :shopmallData="shopmallData" :selfPickData="selfPickData"></MerchantsPropotion>
</div>
<div class="solar-detail-right">
<div class="service-box">
<box-title title="服务中心-采购及入库情况"></box-title>
<PurchaseStorageTable :tableData="merchantServiceDataList" class="main-table" id="serviceTable"></PurchaseStorageTable>
</div>
<div class="merchant-box">
<box-title title="门店-采购及入库情况"></box-title>
<PurchaseStorageTable firstName="门店名称名称" :tableData="merchantMerDataList" class="main-table" id="merchantTable"></PurchaseStorageTable>
</div>
</div>
</div>
</div>
</template>
</view-container>
......@@ -22,19 +36,23 @@
import { changeMixin } from '@/mixins'
import MerchantsPurchaseTrends from './MerchantsPurchaseTrends.vue'
import MerchantsPropotion from './MerchantsPropotion.vue'
import PurchaseStorageTable from './PurchaseStorageTable.vue'
export default {
name: 'SolarDetail',
mixins: [changeMixin],
components: {
MerchantsPropotion,
MerchantsPurchaseTrends
MerchantsPurchaseTrends,
PurchaseStorageTable
},
data() {
return {
yearList: [{
label: '全部',
value: ''
}],
yearList: [
{
label: '全部',
value: ''
}
],
defaultYear: '',
isEmpty: false,
dataList: [],
......@@ -98,7 +116,9 @@ export default {
shopmallData: [],
// 自采采购数据
selfPickData: [],
businessTime: ''
businessTime: '',
merchantMerDataList: [],
merchantServiceDataList: []
}
},
created() {
......@@ -127,6 +147,8 @@ export default {
this.getMerchantPurchase(merchantid)
this.getMerchantPurchaseTrend(merchantid)
this.getYears(merchantid)
this.getMerchantMer(merchantid)
this.getMerchantServiceCenter(merchantid)
},
// 获取门店的商品采购占比(商城、自采)
getMerchantGoodsRatio(merchantid) {
......@@ -196,10 +218,12 @@ export default {
},
// 获取年份数据参数门店id
async getYears(MerchantId) {
this.yearList = [{
label: '全部',
value: ''
}]
this.yearList = [
{
label: '全部',
value: ''
}
]
const _data = await this.api.solar.getYears({ MerchantId })
const _yearList = _data.data.dataList[0].year.reverse()
_yearList.forEach(item => {
......@@ -209,6 +233,28 @@ export default {
})
})
this.defaultYear = this.yearList[0].value
},
// 获取每个门店的门店采购额和入库情况
getMerchantMer(merchantid) {
this.api.solar.getMerchantMer({ year: this.$store.state.app.solarYear, MerchantId: merchantid }).then(res => {
if (!res.code === '0') {
this.openMessage('获取每个门店的门店采购额和入库情况失败')
return
}
const _dataList = res.data.dataList
this.merchantMerDataList = _dataList
})
},
// 获取每个门店的服务中心的采购额和入库情况
getMerchantServiceCenter(merchantid) {
this.api.solar.getMerchantServiceCenter({ year: this.$store.state.app.solarYear, merchantid: merchantid }).then(res => {
if (!res.code === '0') {
this.openMessage('获取每个门店的服务中心的采购额和入库情况失败')
return
}
const _dataList = res.data.dataList
this.merchantServiceDataList = _dataList
})
}
}
}
......@@ -221,8 +267,26 @@ export default {
box-sizing: border-box;
padding: 1.78vh 24px;
gap: 0 16px;
&-bottom {
margin-top: 1.78vh;
display: flex;
justify-content: space-between;
}
.statistic-box {
margin-top: 1.78vh;
}
}
.service-box,
.merchant-box {
width: 31.53vw;
height: 32.56vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
.merchant-box {
margin-top: 1.78vh;
}
.main-table {
padding: 1.11vh 1.39vw 2.44vh;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!