Commit 7343b481 by wuwx Committed by 杨北旺

sop分析-完成率,触达率

1 parent 9c0c897b
...@@ -33,6 +33,17 @@ const getSopBaseInfoApi = params => { ...@@ -33,6 +33,17 @@ const getSopBaseInfoApi = params => {
}) })
} }
//sop分析-触达率-筛选框
const getEventListApi = params => {
params.method = 'scrm.api.sop.sopEvent.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop分析-触达率列表 // sop分析-触达率列表
const getSopCustomerStatisticsListApi = params => { const getSopCustomerStatisticsListApi = params => {
params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage' params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage'
...@@ -100,4 +111,4 @@ const getSopInfoDetailApi = params => { ...@@ -100,4 +111,4 @@ const getSopInfoDetailApi = params => {
}) })
} }
export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, insertOrUpdateSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi } export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, insertOrUpdateSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi }
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
pageSize: 999999 pageSize: 999999
} }
this.$apis.sop.getSopInfoListApi(params).then(res => { this.$apis.sop.getSopInfoListApi(params).then(res => {
console.log(res) // console.log(res)
this.sopList = res.list this.sopList = res.list
this.dealListData() this.dealListData()
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption' import { pieOption } from './pieOption'
export default { export default {
name: 'completeList', name: 'completeList',
...@@ -63,7 +62,7 @@ export default { ...@@ -63,7 +62,7 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '营销事件', label: '营销事件',
prop: 'name' prop: 'sopName'
}, },
{ {
label: '营销渠道', label: '营销渠道',
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="container"> <div class="container">
<div class="title m-b-20"> <div class="title m-b-20">
SOP名称: SOP名称:
<span>这是某次营销sop</span> <span>{{ sopInfo.sopName }}</span>
</div> </div>
<div> <div>
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
客户总数 客户总数
<img src="@/assets/sop/customer-total.png" /> <img src="@/assets/sop/customer-total.png" />
</div> </div>
<p class="analysis-num">20</p> <p class="analysis-num">{{ sopInfo.customerCount || '-'}}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
已触达客户数 已触达客户数
<img src="@/assets/sop/touch-customer.png" /> <img src="@/assets/sop/touch-customer.png" />
</div> </div>
<p class="analysis-num">12</p> <p class="analysis-num">{{ selectedEventInfo.eventStatistics ? selectedEventInfo.eventStatistics.reachCustomerCount : '-' }}</p>
</div> </div>
<div class="analysis-block"> <div class="analysis-block">
<div class="analysis-title-block m-b-20"> <div class="analysis-title-block m-b-20">
触达率 触达率
</div> </div>
<p class="analysis-num">60%</p> <p class="analysis-num">{{ sopInfo.touchPercent + '%' }}</p>
<div id="completePie" class="chart-pie"></div> <div id="completePie" class="chart-pie"></div>
</div> </div>
</div> </div>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<p class="m-b-10">客户触达明细</p> <p class="m-b-10">客户触达明细</p>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="touchListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton> <GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton> <GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
...@@ -66,16 +66,24 @@ export default { ...@@ -66,16 +66,24 @@ export default {
size: 'small', size: 'small',
url: url, url: url,
searchForm: { searchForm: {
sopName: '' sopId: '',
eventId: ''
},
sopInfo: {},
selectedEventInfo: {
eventStatistics: {}
}, },
// tableSearchForm: {},
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
label: '营销事件', label: '营销事件',
name: 'sopName', name: 'eventId',
type: 'select', type: 'select',
width: '415px' width: '415px',
optionList: [],
optionId: 'id',
optionLabel: 'confName',
optionsName: 'sopEventList'
} }
], ],
// 表格 // 表格
...@@ -110,16 +118,7 @@ export default { ...@@ -110,16 +118,7 @@ export default {
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: { baseData: {
commentStatusList: [ sopEventList: []
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
} }
} }
}, },
...@@ -132,25 +131,47 @@ export default { ...@@ -132,25 +131,47 @@ export default {
}, },
mounted() { mounted() {
this.drawPie() this.getBaseData()
this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams() { getBaseInfo() {
var params = JSON.parse(JSON.stringify(this.searchForm)) this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
if (this.searchForm.createDate.length) { this.sopInfo = res
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' this.sopInfo.touchPercent = Math.round((this.selectedEventInfo.eventStatistics.reachCustomerCount / this.sopInfo.customerCount) * 100).toFixed(0)
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' })
},
getBaseData() {
var params = {
sopId: this.sopId,
pageNum: 1,
pageSize: 999999
} }
delete params.createDate var pushChannelTypeList = {
return params 1: '企业微信',
2: '短信',
3: '微信朋友圈'
}
this.$apis.sop.getEventListApi(params).then(res => {
this.baseData.sopEventList = res.list
console.log(res)
this.baseData.sopEventList.forEach(item => {
item.confName = item.eventStartDate + (item.repeatFlag == 'Y' ? '-' + item.eventEndDate : '') + ' ' + item.eventTime + ' ' + pushChannelTypeList[item.pushChannelType]
})
this.getOptionsList('searchFormData', false)
this.searchForm.eventId = this.baseData.sopEventList[0].id
this.selectedEventInfo = this.baseData.sopEventList[0]
this.getBaseInfo()
this.drawPie()
this.$refs.touchListRef.refreshTable()
})
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise((resolve, reject) => {
this.searchForm.sopId = this.sopId this.searchForm.sopId = this.sopId
// this.tableSearchForm = this.getParams() this.baseData.sopEventList.length ? resolve() : reject()
resolve()
}) })
}, },
...@@ -168,7 +189,7 @@ export default { ...@@ -168,7 +189,7 @@ export default {
}) })
if (res.code == '0') { if (res.code == '0') {
fn && fn() fn && fn()
this.handleSearch() // this.handleSearch()
} }
}) })
} }
...@@ -176,13 +197,6 @@ export default { ...@@ -176,13 +197,6 @@ export default {
}) })
}, },
handleExport() {
var params = this.getParams()
this.$apis.giftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
handleDelete(row) { handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id }) this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
}, },
...@@ -237,7 +251,7 @@ export default { ...@@ -237,7 +251,7 @@ export default {
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun() this.$refs.touchListRef.data.length ? (this.$refs.touchListRef.tableHeightValues = '') : this.$refs.touchListRef.setTableHeightFun()
}, },
drawPie() { drawPie() {
...@@ -245,15 +259,16 @@ export default { ...@@ -245,15 +259,16 @@ export default {
let myChart = echarts.init(chartDom) let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(pieOption)) let option = JSON.parse(JSON.stringify(pieOption))
// option.series[0].name = item.sopName console.log(this.selectedEventInfo)
option.series[0].data = [ option.series[0].data = [
{ {
value: 60, value: this.selectedEventInfo.eventStatistics.reachCustomerCount,
name: '已触发的营销事件' name: '已触达的客户数'
}, },
{ {
value: 40, value: this.sopInfo.customerCount - this.selectedEventInfo.eventStatistics.reachCustomerCount,
name: '未触发的营销事件' name: '未触达的客户数'
} }
] ]
...@@ -262,9 +277,9 @@ export default { ...@@ -262,9 +277,9 @@ export default {
option && myChart.setOption(option) option && myChart.setOption(option)
}, },
handleSearch() { // handleSearch() {
this.$refs.giftListRef.refreshTable() // this.$refs.touchListRef.refreshTable()
} // }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!