Commit 9c0c897b by wuwx Committed by 杨北旺

sop分析-完成率

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