Commit 9c0c897b by wuwx Committed by 杨北旺

sop分析-完成率

1 parent e13e8b27
......@@ -22,6 +22,17 @@ const getSopInfoListApi = params => {
})
}
// sop基本信息
const getSopBaseInfoApi = params => {
params.method = 'scrm.api.sop.sopInfo.getBaseBySopId'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop分析-触达率列表
const getSopCustomerStatisticsListApi = params => {
params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage'
......@@ -89,4 +100,4 @@ const getSopInfoDetailApi = params => {
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, insertOrUpdateSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi }
export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, parseEventCountApi, insertOrUpdateSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi }
......@@ -25,7 +25,7 @@ export default {
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 1
hasQw: 0
},
eventObj: {
addOrEdit: 'add',
......
......@@ -135,6 +135,7 @@ export default {
getList() {
var params = {
sopStatus: 2,
pageNum: 1,
pageSize: 999999
}
......
......@@ -4,29 +4,29 @@
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
<span>{{ sopInfo.sopName }}</span>
</div>
<div class="analysis-box flex-default">
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
营销时间总数
营销事件总数
<img src="@/assets/sop/sop-event.png" />
</div>
<p class="analysis-num">20</p>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.eventCount : '-' }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已完成事件数
<img src="@/assets/sop/completed-event.png" />
</div>
<p class="analysis-num">12</p>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.finishEventCount : '-' }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
完成率
</div>
<p class="analysis-num">60%</p>
<p class="analysis-num">{{ sopInfo.completedPercent + '%' }}</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
......@@ -52,6 +52,9 @@ export default {
return {
size: 'small',
url: url,
sopInfo: {
sopStatistics: {}
},
searchForm: {},
// 表格
getListApi: this.$apis.sop.getListApi,
......@@ -83,19 +86,7 @@ export default {
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
......@@ -107,31 +98,31 @@ export default {
},
mounted() {
this.drawPie()
this.getBaseInfo()
},
methods: {
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
// this.$confirm(txt, title, {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// callback: action => {
// if (action == 'confirm') {
// this.$apis[apiModule][apiName](apiParams).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// fn && fn()
// this.handleSearch()
// }
// })
// }
// }
// })
// },
beforeSearchFn() {
return new Promise(resolve => {
......@@ -145,6 +136,14 @@ export default {
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res
this.sopInfo.completedPercent = Math.round((this.sopInfo.sopStatistics.finishEventCount / this.sopInfo.sopStatistics.eventCount) * 100).toFixed(0)
this.drawPie()
})
},
drawPie() {
let chartDom = document.getElementById('completePie')
let myChart = echarts.init(chartDom)
......@@ -153,23 +152,21 @@ export default {
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
value: this.sopInfo.sopStatistics.finishEventCount,
name: '已触发的营销事件'
},
{
value: 40,
value: this.sopInfo.sopStatistics.eventCount - this.sopInfo.sopStatistics.finishEventCount,
name: '未触发的营销事件'
}
]
console.log(option)
option && myChart.setOption(option)
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
}
// handleSearch() {
// this.$refs.giftListRef.refreshTable()
// }
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!