Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
084ced0a
Commit
084ced0a
authored
Mar 30, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: ai营销-数据统计
parent
b0da70ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
29 deletions
+64
-29
index.js
src/utils/index.js
+15
-0
ai-data.vue
src/views/ai/ai-data-report/ai-data.vue
+49
-29
No files found.
src/utils/index.js
View file @
084ced0a
...
...
@@ -368,3 +368,18 @@ export const getTimesByReq = (str, type = 1) => {
}
return
d
.
getTime
();
};
/**
* @description 给数字添加千位分隔符
* @param {Number} num 需要转换的数据
* @returns {String} 添加千位分隔符后的数字
*/
export
const
numFormat
=
function
(
num
)
{
if
(
typeof
num
!=
'number'
)
{
console
.
error
(
'numFormat Arguments TypeError: Arguments type is not number'
);
return
'--'
;
}
return
num
.
toString
().
replace
(
/
\d
+/
,
n
=>
{
// 先提取整数部分
return
n
.
replace
(
/
(\d)(?=(\d{3})
+$
)
/g
,
'$1,'
);
});
};
src/views/ai/ai-data-report/ai-data.vue
View file @
084ced0a
...
...
@@ -25,6 +25,7 @@
</
template
>
<
script
>
import
{
numFormat
}
from
'@/utils/index.js'
;
import
{
getOutBound
}
from
'@/service/api/aiApi.js'
;
import
TargetGroup
from
'./target-group.vue'
;
export
default
{
...
...
@@ -40,81 +41,94 @@ export default {
return
{
activityId
:
''
,
planId
:
''
,
// type number:数字、time:时间、amount:金额、rate:百分比
originTargetList
:
[
[
{
label
:
'营销人数'
,
tips
:
'根据每天外呼人数累加'
,
value
:
''
,
key
:
'marketingNumber'
key
:
'marketingNumber'
,
type
:
'number'
},
{
label
:
'已外呼数'
,
value
:
''
,
key
:
'outboundNumber'
key
:
'outboundNumber'
,
type
:
'number'
}
],
[
{
label
:
'总接通数'
,
value
:
''
,
key
:
'totalConnectionNumber'
key
:
'totalConnectionNumber'
,
type
:
'number'
},
{
label
:
'电话接通率'
,
tips
:
'电话接通率:表示任务中接通号码的占比<br/>计算公式为:接通的电话通数/已经外呼的电话通数'
,
value
:
''
,
key
:
'telephoneConnectionRate'
key
:
'telephoneConnectionRate'
,
type
:
'rate'
}
],
[
{
label
:
'A/B类客户意向'
,
value
:
''
,
key
:
'customerIntentionsNumber'
key
:
'customerIntentionsNumber'
,
type
:
'number'
},
{
label
:
'接通意向率'
,
tips
:
'接通意向率:表示所有已接通的通话中意向客户占比,其中A类和B类客户为意向客户<br/>计算公式为:A/B类客户意向数/已接通的电话数'
,
value
:
''
,
key
:
'connectionIntentionRate'
key
:
'connectionIntentionRate'
,
type
:
'rate'
}
],
[
{
label
:
'总挂机数'
,
value
:
''
,
key
:
'totalHangUps'
key
:
'totalHangUps'
,
type
:
'number'
},
{
label
:
'挂机率'
,
tips
:
'挂机率表示接通后5s之内挂断的电话<br/>计算公式为:总挂机数/接通的电话通数'
,
value
:
''
,
key
:
'hangUpRate'
key
:
'hangUpRate'
,
type
:
'rate'
}
],
[
{
label
:
'短信发送总数'
,
value
:
''
,
key
:
'sentMessagesNumber'
key
:
'sentMessagesNumber'
,
type
:
'number'
},
{
label
:
'发送成功数'
,
value
:
''
,
key
:
'sentSuccessfullyNumber'
key
:
'sentSuccessfullyNumber'
,
type
:
'number'
}
],
[
{
label
:
'总通话时长'
,
value
:
''
,
key
:
'totalCallDuration'
key
:
'totalCallDuration'
,
type
:
'time'
},
{
label
:
'平均通话时长'
,
value
:
''
,
key
:
'averageCallDuration'
key
:
'averageCallDuration'
,
type
:
'time'
}
],
[
...
...
@@ -123,7 +137,8 @@ export default {
tips
:
'不包含短信发送失败退回金额'
,
value
:
''
,
unit
:
'元'
,
key
:
'activityCost'
key
:
'activityCost'
,
type
:
'amount'
}
]
],
...
...
@@ -135,9 +150,29 @@ export default {
return
this
.
originTargetList
.
map
(
el
=>
{
return
el
.
filter
(
item
=>
{
const
value
=
this
.
targetData
[
item
.
key
];
switch
(
item
.
type
)
{
case
'number'
:
item
.
value
=
typeof
value
==
'number'
?
numFormat
(
value
)
:
'--'
;
break
;
case
'time'
:
item
.
value
=
'--'
;
if
(
typeof
value
==
'number'
)
{
const
h
=
Math
.
floor
(
value
/
3600
);
const
m
=
Math
.
floor
((
value
%
3600
)
/
60
);
const
s
=
value
%
60
;
item
.
value
=
`
${
h
}
:
${
m
}
:
${
s
}
`
;
}
break
;
case
'amount'
:
item
.
value
=
typeof
value
==
'number'
?
numFormat
(
value
)
:
'--'
;
break
;
case
'rate'
:
item
.
value
=
typeof
value
==
'string'
?
value
:
'--'
;
break
;
}
// 活动不发送挂机短信时,数据指标不展示短信发送总数的字段
// 活动未开启活动分析时,数据指标不展示活动费用
item
.
value
=
this
.
targetData
[
item
.
key
]
==
null
?
'--'
:
this
.
targetData
[
item
.
key
];
return
!
((
this
.
aiDataShow
.
analyseFlag
==
0
&&
item
.
key
==
'sentMessagesNumber'
)
||
(
this
.
aiDataShow
.
smsFlag
==
0
&&
item
.
key
==
'activityCost'
));
});
})
...
...
@@ -152,21 +187,6 @@ export default {
methods
:
{
getOutBound
()
{
getOutBound
({
activityId
:
this
.
activityId
,
planId
:
this
.
planId
}).
then
(
res
=>
{
res
.
result
=
{
marketingNumber
:
1
,
outboundNumber
:
2
,
totalConnectionNumber
:
3
,
telephoneConnectionRate
:
4
,
customerIntentionsNumber
:
5
,
connectionIntentionRate
:
6
,
totalHangUps
:
7
,
hangUpRate
:
8
,
sentMessagesNumber
:
9
,
sentSuccessfullyNumber
:
10
,
totalCallDuration
:
11
,
averageCallDuration
:
12
,
activityCost
:
13
};
this
.
targetData
=
res
.
result
;
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment