Commit 3fb8524b by 杨明

bug修复

1 parent 06b31edc
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-14 14:07:44
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-19 10:53:17
* @LastEditTime: 2023-10-08 16:49:07
* @FilePath: \scrm-micro-home\src\components\lineChart\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -48,11 +48,13 @@ export default {
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
window.addEventListener('resize', this[this.domId].resize)
},
beforeCreate() {
window.removeEventListener('resize', this[this.domId].resize)
},
methods: {
chartBindEvent() {
console.log(8888)
console.log(this[this.domId])
this[this.domId].setOption(this.lineOptions)
}
}
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-14 14:08:14
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-27 13:58:43
* @LastEditTime: 2023-10-08 16:23:48
* @FilePath: \scrm-micro-home\src\components\options.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -78,7 +78,7 @@ function getLineOddOptions(obj) {
const { color, lineList } = obj
console.log(obj)
// const statDate = dataList.map(item => item.statDate)
const dataList = lineList.map(item => item.orderCount)
const dataList = lineList.map(item => item.saleAmount)
const dataX = lineList.map(item => item.aggregateTime)
// 定义颜色渐变
var gradientColors1 = [
......@@ -103,12 +103,12 @@ function getLineOddOptions(obj) {
]
const num = dataList.map((item, index) => {
return {
value: item,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, index % 2 == 0 ? gradientColors1 : gradientColors2) // 设置渐变色
}
}
value: item
// itemStyle: {
// normal: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, index % 2 == 0 ? gradientColors1 : gradientColors2) // 设置渐变色
// }
// }
}
})
var options = {
......@@ -122,10 +122,29 @@ function getLineOddOptions(obj) {
},
data: dataX
},
tooltip: {
trigger: 'axis', // 设置触发类型为坐标轴轴线触发
axisPointer: {
type: 'line' // 设置指示器类型为直线
},
formatter: function(params) {
const value = params[0].value
return `销售额<br><b>¥${value}</b>`
}
},
grid: {
bottom: '10%',
top: '8%'
},
// 其他配置项...
dataZoom: [
{
type: 'slider', // 显示滑动条
xAxisIndex: 0, // 指定水平拖动的 x 轴索引
start: 0, // 初始的数据窗口范围的起始位置
end: 100 // 初始的数据窗口范围的结束位置
}
],
yAxis: {
type: 'value'
},
......@@ -138,13 +157,9 @@ function getLineOddOptions(obj) {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, gradientColors) // 设置渐变色
// }
// },
type: 'bar',
label: {
show: true,
position: 'top',
formatter: '{c}', // 显示数据值
fontSize: '10px',
color: '#666666'
type: 'line',
areaStyle: {
color: 'rgba(211, 208, 255, 1)' // 设置面积颜色和透明度
}
}
]
......@@ -168,10 +183,25 @@ function getPieOptions(obj) {
center: ['50%', '53%'],
radius: ['80%', '60%'],
label: {
show: false // 不显示标签
show: false, // 不显示标签
position: 'center'
},
emphasis: {
scale: false // 不放大扇区
scale: false, // 不放大扇区,
label: {
show: true,
formatter: ['销售额', '{c|{c}}'].join('\n'),
rich: {
b: {
fontSize: 12,
lineHeight: 24
},
c: {
fontSize: 24,
lineHeight: 36
}
}
}
},
labelLine: {
show: false // 不显示标签引导线
......
......@@ -181,6 +181,23 @@ util.limitPrice = (newValue, oldValue, intergerDigit, pointDigit, minValue, maxV
return newValue ? oldValue : ''
}
}
/**
* 正则表过式:数字三位加逗号,保留两位小数
* @param {Number} num 数据
* @param {Number} pointNum 小数点位数
*/
util.formatNumber = function(num, pointNum = 2) {
if ((!num && num !== 0) || num == '-') return '--'
let arr = (typeof num == 'string' ? parseFloat(num) : num).toFixed(pointNum).split('.')
// 方式一
let regExp = arr[0].replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
// 方式二
let regExp1 = arr[0].replace(/(?=(?!\b)(\d{3})+$)/g, '$&,')
return arr[1] === undefined ? regExp : `${regExp}.${arr[1]}`.replace(/(?<=\.\d*)0+$|\.0*$/, '')
}
util.isShowBtn = function(value, permissions) {
let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-14 10:26:24
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-27 15:17:10
* @LastEditTime: 2023-10-08 16:35:06
* @FilePath: \scrm-micro-home\src\views\home\components\AddValue.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -22,6 +22,7 @@
</template>
<script>
import analysisLine from './AnalysisLine'
import util from '@/utils/util'
export default {
components: {
analysisLine
......@@ -30,10 +31,11 @@ export default {
return {
chartList: [
{
title: '精改业务-精品升级',
title: '轻改业务-精品升级',
backgroundColor: 'linear-gradient(179deg, #F5F7FF 1%, #F9FBFF 100%)',
color: ['#A29EFF', '#5850FF'],
url: '/appreciation/inSale/upgrade',
isShow: () => util.isShowBtn('/inSale/upgrade', null),
value: 0,
lineList: []
},
......@@ -41,7 +43,8 @@ export default {
title: '轻改业务-售后众筹',
backgroundColor: 'linear-gradient(179deg, #EFF8FF 1%, #F4FAFF 1%, #F6FCFF 100%)',
color: ['#83D8FF', '#0087FA'],
url: '/appreciation/publicity/crowdfund',
url: '/store/orderManage/index?order=4',
isShow: () => util.isShowBtn('/orderManage/index', null),
value: 154.9,
lineList: []
},
......@@ -50,6 +53,7 @@ export default {
backgroundColor: 'linear-gradient(179deg, #FFF8F0 1%, #FFFCF9 100%)',
color: ['#FFCF8D', '#FF8D0A'],
url: '/appreciation/beforeSale/checkSet',
isShow: () => util.isShowBtn('/beforeSale/checkSet', null),
value: 101.5,
lineList: []
}
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-14 11:21:38
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-27 15:17:59
* @LastEditTime: 2023-10-08 14:14:10
* @FilePath: \scrm-micro-home\src\views\home\components\AnalysisLine.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -12,7 +12,8 @@
<div class="analysis-border-num flex">
累计增量产值
<span>{{ analysisData.value }}</span>
<span class="jump-btn" @click="jumpDetail">查看明细</span>
<span class="jump-btn" @click="jumpDetail" v-if="analysisData.isShow()">查看明细</span>
<span class="jump-btn" v-else>暂无权限</span>
</div>
<div class="analysis-border-line">
<slot />
......
<template>
<div class="analysis-main" v-if="journeyList.lengh == 2">
<div class="analysis-main" v-if="journeyList.length">
<div class="analysis-head">
客户旅程分析
</div>
......@@ -119,30 +119,39 @@ export default {
}
})
const enable = journeyList.find(item => item.instStatus == 1) //已启用
const unenable = journeyList.find(item => item.instStatus == -1) //未启用
const customerList = await Promise.all([this.$apis.journey.getCustomersList({ sopJourneyId: enable.instId, pageSize: 10000, pageNumber: 1 }), this.$apis.journey.getCustomersList({ sopJourneyId: unenable.instId })])
const nodes = await Promise.all([this.$apis.journey.getInstIdDetail({ instId: enable.instId }), this.$apis.journey.getInstIdDetail({ instId: unenable.instId })])
enable.journeyItem.forEach(i => {
customerList[0].list.forEach(v => {
if (i.label == v.sopJourneyStage) {
i.customerList.push(v)
}
})
nodes[0].nodes.forEach(v => {
if (i.label == (v.nodeParam && JSON.parse(v.nodeParam).stage)) {
i.nodes.push(v)
}
const journeyList1 = journeyList.filter(item => item.instStatus == 1) //已启用
const journeyList2 = journeyList.filter(item => item.instStatus == -1) //未启用
let [enable, unenable] = [...journeyList1, ...journeyList2]
const customerList = await Promise.all([this.$apis.journey.getCustomersList({ sopJourneyId: enable.instId, pageSize: 10000, pageNumber: 1 }), unenable ? this.$apis.journey.getCustomersList({ sopJourneyId: unenable.instId }) : {}])
const nodes = await Promise.all([this.$apis.journey.getInstIdDetail({ instId: enable.instId }), unenable ? this.$apis.journey.getInstIdDetail({ instId: unenable.instId }) : {}])
if (enable)
enable.journeyItem.forEach(i => {
customerList[0].list.forEach(v => {
if (i.label == v.sopJourneyStage) {
i.customerList.push(v)
}
})
nodes[0].nodes.forEach(v => {
if (i.label == (v.nodeParam && JSON.parse(v.nodeParam).stage)) {
i.nodes.push(v)
}
})
})
})
unenable.journeyItem.forEach(i => {
nodes[1].nodes.forEach(v => {
if (i.label == (v.nodeParam && JSON.parse(v.nodeParam).stage)) {
i.nodes.push(v)
}
if (unenable)
unenable.journeyItem.forEach(i => {
customerList[0].list.forEach(v => {
if (i.label == v.sopJourneyStage) {
i.customerList.push(v)
}
})
nodes[1].nodes.forEach(v => {
if (i.label == (v.nodeParam && JSON.parse(v.nodeParam).stage)) {
i.nodes.push(v)
}
})
})
})
this.journeyList = [enable, unenable]
this.journeyList = [enable, unenable].filter(item => item)
console.log(this.journeyList)
},
//状态值映射
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-14 10:26:58
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-27 13:53:58
* @LastEditTime: 2023-10-08 15:44:44
* @FilePath: \scrm-micro-home\src\views\home\components\MicroStore.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -16,7 +16,7 @@
<div class="analysis-bar-left">
<div class="analysis-bar-wrap">
<div class="warp-desc">总销售额</div>
<div class="warp-num">{{ orderDetail.totalSaleAmount }}</div>
<div class="warp-num">{{ orderDetail.totalSaleAmount | formatNumber }}</div>
<div class="warp-price">
本月销售额
<span>{{ orderDetail.totalSaleAmount }}</span>
......@@ -25,7 +25,7 @@
</div>
<div class="analysis-bar-wrap">
<div class="warp-desc">总订单数</div>
<div class="warp-num">{{ orderDetail.totalOrderCount }}</div>
<div class="warp-num">{{ orderDetail.totalOrderCount | formatNumber }}</div>
<div class="warp-price">
本月订单数
<span>{{ orderDetail.orderCount }}</span>
......@@ -38,8 +38,8 @@
<div class="chart-title">销售额趋势</div>
<div class="chart-time">
<el-radio-group v-model="dateValue" size="small">
<el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="year">全年</el-radio-button>
<el-radio-button label="day">本月</el-radio-button>
<el-radio-button label="month">全年</el-radio-button>
</el-radio-group>
<el-date-picker class="chart-time-picker" @change="dateChange" v-model="timeValue" size="small" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</div>
......@@ -64,7 +64,7 @@
<img src="@/assets/img/home/pie-arrow.png" />
</div>
<div class="chart-item-3">占比 {{ item.radio }}%</div>
<div class="chart-item-4">销售额 ¥{{ item.saleAmount }}</div>
<div class="chart-item-4">销售额 ¥{{ item.saleAmount | formatNumber }}</div>
<div class="chart-item-4">订单数:{{ item.orderCount }}</div>
</div>
</div>
......@@ -79,7 +79,7 @@ import * as dayjs from 'dayjs'
export default {
data() {
return {
dateValue: 1,
dateValue: null,
lineList: {
title: '精改业务-精品升级',
backgroundColor: 'linear-gradient(179deg, #F5F7FF 1%, #F9FBFF 100%);',
......@@ -98,6 +98,11 @@ export default {
]
}
},
filters: {
formatNumber(val) {
return util.formatNumber(val)
}
},
watch: {
dateValue(val) {
if (val) {
......@@ -117,13 +122,16 @@ export default {
endTime: dayjs(date[1]).format('YYYY-MM-DD') + ' 23:59:59'
})
},
dateChange(val) {
dateChange(val, isReset = true) {
const params = {
startTime: dayjs(val[0]).format('YYYY-MM-DD') + ' 00:00:00',
endTime: dayjs(val[1]).format('YYYY-MM-DD') + ' 23:59:59'
endTime: dayjs(val[1]).format('YYYY-MM-DD') + ' 23:59:59',
aggregateType: this.dateValue
}
this.getLineList(params)
if (isReset) this.dateValue = null
},
//选择本月/本年
storeData(name) {
let startTime, endTime
let now = new Date()
......@@ -131,23 +139,22 @@ export default {
let nowYear = now.getFullYear()
this.currentTime = name
switch (name) {
case 'month':
case 'day':
startTime = new Date(nowYear, nowMonth, 1)
endTime = new Date()
// endTime = new Date(nowYear, nowMonth + 1, 0)
break
case 'year':
case 'month':
startTime = new Date(nowYear, 0, 1)
endTime = new Date()
// endTime = new Date(nowYear, 11, 31)
break
}
this.timeValue = [startTime, endTime]
this.dateChange(this.timeValue)
this.dateChange(this.timeValue, false)
},
getLineList(params) {
this.$apis.home.analysisOrder(params).then(res => {
console.log(res, 9999999)
this.orderDetail = res || {}
this.lineList.lineList = res.trendData || []
const pieData = res.pieData || []
......
......@@ -97,7 +97,7 @@
<span>个</span>
</div>
<div class="step-title-h3 text-center">客户旅程数</div>
<div class="step-operation" @click="jumpUrl('/marketing/customerTransform/index')">
<div class="step-operation" @click="jumpUrl('/scene/journeyConfig/index')">
<label>旅程配置</label>
</div>
</div>
......@@ -108,7 +108,7 @@
<div class="step-icon"><img src="@/assets/img/home/step5_i.png" alt="" /></div>
<div class="step-title-h2">sop自动化营销</div>
<div class="step-module">
<div class="step-module-item">群发助手</div>
<div class="step-module-item">客户群发</div>
<div class="step-module-item">客户朋友圈</div>
<div class="step-module-item">AI外呼</div>
<div class="step-module-item">短信</div>
......@@ -173,7 +173,7 @@ export default {
}
})
.then(res => {
const { bizLabelCount, rcLabelCount, traLabelCount } = res
const { bizLabelCount = 0, rcLabelCount = 0, traLabelCount = 0 } = res || {}
this.labelCount = bizLabelCount + rcLabelCount + traLabelCount
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!