Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2baec748
authored
Jun 12, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码
1 parent
b01bb7f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
115 deletions
src/views/sop/editSop/baseInfo.vue
src/views/sop/editSop/components/GoupchatPreview/index.vue
src/views/sop/sopAnalysis/touchList.vue
src/views/sop/viewSop.vue
src/views/sop/editSop/baseInfo.vue
View file @
2baec74
This diff is collapsed.
Click to expand it.
src/views/sop/editSop/components/GoupchatPreview/index.vue
View file @
2baec74
...
@@ -2,90 +2,70 @@
...
@@ -2,90 +2,70 @@
<div
class=
"img-bg"
>
<div
class=
"img-bg"
>
<div
class=
"preview-content"
>
<div
class=
"preview-content"
>
<div
class=
"preview-time"
>
{{
currentTime
}}
</div>
<div
class=
"preview-time"
>
{{
currentTime
}}
</div>
<div
<template
v-if=
"previewList.length==1"
>
:class=
"
{'preview-info':true,'isMargin':(previewList
&&
previewList[2]
&&
previewList[2].attType == 6
&&
item.attType ==6) || previewList
&&
previewList[1]
&&
previewList[0].attType == 7
&&
previewList[1].attType ==6
&&
item.attType ==6}"
<div
v-for="item in previewList" :key="item.id">
:class=
"
{'preview-info':true,'isMargin':(previewList
&&
previewList[2]
&&
previewList[2].attType == 6
&&
item.attType ==6) || previewList
&&
previewList[1]
&&
previewList[0].attType == 7
&&
previewList[1].attType ==6
&&
item.attType ==6}"
<img
class=
"avatar"
src=
"@/assets/guestCustom/default-customer.png"
v-for="item in previewList" :key="item.id">
v-if=
"!(hasSixType && hasSevenType) || item.attType !== 7"
alt
/>
<img
class=
"avatar"
<template
v-if=
"item.attType == 1"
>
src=
"@/assets/guestCustom/default-customer.png"
<div
class=
"preview-text text"
v-html=
"item.attContent"
></div>
alt
/>
</
template
>
<template
v-if=
"item.attType == 1"
>
<
template
v-else-if=
"hasSixType || hasSevenType"
>
<div
class=
"preview-text text"
v-html=
"textContent"
></div>
<temlate
v-if=
"hasSixType && hasSevenType"
>
</
template
>
<template
v-if=
"item.attType == 6"
>
<
template
v-if=
"item.attType == 6 || item.attType == 4 || item.attType == 7"
>
<div
class=
"preview-pdf"
>
<div
class=
"preview-text text"
>
https//dwz.cn/Fk9vs7ri
</div>
<div
class=
"pdf-title"
>
{{
item
.
attContent
.
fileName
}}
</div>
</
template
>
<div
class=
"preview-link"
>
<
template
v-else-if=
"item.attType == 2"
>
<img
src=
"@/assets/guestCustom/preview-link.png"
alt=
""
/>
<el-image
style=
"width: 100px"
:src=
"item.attContent"
fit=
"contain"
></el-image>
</div>
</
template
>
</div>
<
template
v-else-if=
"item.attType == 3"
>
</
template
>
<div
class=
"video-panel"
:key=
"itm"
>
</temlate>
<video
id=
"video"
width=
"95"
>
<
template
v-else
>
<source
:src=
"item.attContent"
type=
"video/mp4"
/>
<template
v-if=
"item.attType == 6"
>
</video>
<div
class=
"preview-pdf"
>
<i
class=
"el-icon-video-play"
></i>
<div
class=
"pdf-title"
>
{{
item
.
attContent
.
fileName
}}
</div>
</div>
<div
class=
"preview-link"
>
</
template
>
<img
src=
"@/assets/guestCustom/preview-link.png"
alt=
""
/>
</div>
</div>
</template>
</div>
<
template
v-else
>
<div
:class=
"
{'preview-info':true,'isMargin':(previewList
&&
previewList[2]
&&
previewList[2].attType == 6
&&
item.attType ==6) || previewList
&&
previewList[1]
&&
previewList[0].attType == 7
&&
previewList[1].attType ==6
&&
item.attType ==6}"
v-for="item in previewList" :key="item.id">
<template
v-if=
"item.attType == 1 || item.attType == 4 || item.attType == 6 || item.attType == 7"
>
<template
v-if=
"item.attType == 1 && item.attContent"
>
<img
class=
"avatar"
src=
"@/assets/guestCustom/default-customer.png"
alt
/>
<div
class=
"preview-text text"
v-html=
"textContent"
></div>
</
template
>
</
template
>
<
template
v-if=
"item.attType == 7"
>
<
template
v-if=
"!hasAttTypeOne && (item.attType == 4 || item.attType == 6 || item.attType == 7)"
>
<div
class=
"preview-activity"
>
<img
class=
"avatar"
<div
class=
"activity-name"
>
{{
item
.
attContent
.
marketingName
}}
</div>
src=
"@/assets/guestCustom/default-customer.png"
<img
alt
/>
v-if=
"item.attContent.marketingType != 5 && item.attContent.marketingType != 6 && item.attContent.marketingType != 7"
<div
class=
"preview-text text"
>
https//dwz.cn/Fk9vs7ri
</div>
class=
"activity-logo"
src=
"@/assets/guestCustom/activity-logo.png"
alt
/>
<img
v-if=
"item.attContent.marketingType == 5"
class=
"activity-logo"
src=
"@/assets/guestCustom/activity-spike.png"
alt
/>
<img
v-if=
"item.attContent.marketingType == 6"
class=
"activity-logo"
src=
"@/assets/guestCustom/activity-service.png"
alt
/>
<img
v-if=
"item.attContent.marketingType == 7"
class=
"link-logo"
src=
"@/assets/guestCustom/link.png"
alt
/>
<div
class=
"activity-footer"
v-if=
"item.attContent.marketingType != 7"
>
<img
src=
"@/assets/guestCustom/applet-footer.png"
alt
/>
</div>
</div>
</
template
>
</
template
>
</template>
</template>
</template>
<
template
v-else-if=
"item.attType == 2"
>
<img
class=
"avatar"
<
template
v-else-if=
"item.attType == 4"
>
src=
"@/assets/guestCustom/default-customer.png"
<div
class=
"preview-activity"
>
alt
/>
<div
class=
"activity-name"
>
{{
item
.
attContent
.
title
}}
</div>
<el-image
style=
"width: 100px"
:src=
"item.attContent"
fit=
"contain"
></el-image>
<img
class=
"link-logo"
src=
"@/assets/guestCustom/link.png"
alt
/>
</
template
>
</div>
<
template
v-else-if=
"item.attType == 3"
>
</
template
>
<img
class=
"avatar"
<
template
v-else-if=
"item.attType == 2"
>
src=
"@/assets/guestCustom/default-customer.png"
<el-image
style=
"width: 100px"
:src=
"item.attContent"
fit=
"contain"
></el-image>
alt
/>
</
template
>
<div
class=
"video-panel"
:key=
"itm"
>
<
template
v-else-if=
"item.attType == 3"
>
<video
id=
"video"
width=
"95"
>
<div
class=
"video-panel"
:key=
"itm"
>
<source
:src=
"item.attContent"
type=
"video/mp4"
/>
<video
id=
"video"
width=
"95"
>
</video>
<source
:src=
"item.attContent"
type=
"video/mp4"
/>
<i
class=
"el-icon-video-play"
></i>
</video>
<i
class=
"el-icon-video-play"
></i>
</div>
</
template
>
<
template
v-else-if=
"item.attType == 5"
>
<div
class=
"preview-text text preview-applet"
>
<div
class=
"preview-applet-title"
>
<img
:src=
"item.attContent.picUrl"
alt
/>
<span>
{{
item
.
attContent
.
title
}}
</span>
</div>
</div>
{{
item
.
attContent
.
page
}}
</
template
>
</div>
</div>
</
template
>
</template>
<!-- <template v-else-if="item.attType == 6">-->
<!-- <div class="preview-pdf">-->
<!-- <div class="pdf-title">{{ item.attContent.fileName }}</div>-->
<!-- <div class="preview-link">-->
<!-- <img src="@/assets/guestCustom/preview-link.png" alt="" />-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
</div>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -99,10 +79,12 @@ export default {
...
@@ -99,10 +79,12 @@ export default {
props
:
{
eventBus
:
Object
,
previewVal
:
Array
},
props
:
{
eventBus
:
Object
,
previewVal
:
Array
},
data
()
{
data
()
{
return
{
return
{
textContent
:
''
,
previewList
:
[],
previewList
:
[],
currentTime
:
''
,
currentTime
:
''
,
hasSixType
:
false
,
hasSixType
:
false
,
hasSevenType
:
false
hasSevenType
:
false
,
hasAttTypeOne
:
false
}
}
},
},
watch
:
{
watch
:
{
...
@@ -110,8 +92,10 @@ export default {
...
@@ -110,8 +92,10 @@ export default {
if
(
val
.
length
)
{
if
(
val
.
length
)
{
this
.
hasSixType
=
val
.
some
(
item
=>
item
.
attType
==
6
)
this
.
hasSixType
=
val
.
some
(
item
=>
item
.
attType
==
6
)
this
.
hasSevenType
=
val
.
some
(
item
=>
item
.
attType
==
7
)
this
.
hasSevenType
=
val
.
some
(
item
=>
item
.
attType
==
7
)
this
.
hasFourType
=
val
.
some
(
item
=>
item
.
attType
==
4
)
val
.
forEach
(
item
=>
{
val
.
forEach
(
item
=>
{
if
(
item
.
attType
==
1
)
{
if
(
item
.
attType
==
1
)
{
this
.
hasAttTypeOne
=
true
const
attContent
=
item
.
attContent
const
attContent
=
item
.
attContent
const
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
const
htm
=
attContent
.
replace
(
/
\[[\u
4E00-
\u
9FA56
]{1,4}
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
...
@@ -124,9 +108,10 @@ export default {
...
@@ -124,9 +108,10 @@ export default {
}
}
return
`<img style="width: 16px;height: 16px;vertical-align: middle;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png">`
return
`<img style="width: 16px;height: 16px;vertical-align: middle;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png">`
})
})
item
.
attContent
=
htm
this
.
textContent
=
htm
}
else
if
(
item
.
attType
!=
2
&&
item
.
attType
!=
3
&&
item
.
attType
!=
7
)
{
}
else
if
(
item
.
attType
==
4
||
item
.
attType
==
6
||
item
.
attType
==
7
)
{
item
.
attContent
=
JSON
.
parse
(
item
.
attContent
)
let
str
=
'https//dwz.cn/Fk9vs7ri'
this
.
textContent
=
this
.
textContent
?
this
.
textContent
+
str
:
str
}
}
})
})
}
}
...
...
src/views/sop/sopAnalysis/touchList.vue
View file @
2baec74
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<div
class=
"analysis-title-block m-b-20"
>
<div
class=
"analysis-title-block m-b-20"
>
<img
src=
"@/assets/sop/sop01.png"
/>
<img
src=
"@/assets/sop/sop01.png"
/>
<div
class=
"analysis-name"
>
客户总数
<div
class=
"analysis-name"
>
客户总数
<p
class=
"analysis-num"
>
{{
baseData
.
sopEventList
.
length
?
sopInfo
.
customerCount
:
'-'
}}
</p></div>
<p
class=
"analysis-num"
>
{{
sopInfo
.
customerCount
?
sopInfo
.
customerCount
:
'-'
}}
</p></div>
</div>
</div>
</div>
</div>
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<div
class=
"analysis-title-block m-b-20"
>
<div
class=
"analysis-title-block m-b-20"
>
<img
src=
"@/assets/sop/sop02.png"
/>
<img
src=
"@/assets/sop/sop02.png"
/>
<div
class=
"analysis-name"
>
已执行客户数
<div
class=
"analysis-name"
>
已执行客户数
<p
class=
"analysis-num"
>
{{
baseData
.
sopEventList
.
length
&&
sopInfo
.
executedTargetCount
?
sopInfo
.
executedTargetCount
:
'-'
}}
</p></div>
<p
class=
"analysis-num"
>
{{
sopInfo
.
executedTargetCount
?
sopInfo
.
executedTargetCount
:
'-'
}}
</p></div>
</div>
</div>
</div>
</div>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<div
class=
"analysis-title-block m-b-20"
>
<div
class=
"analysis-title-block m-b-20"
>
<img
src=
"@/assets/sop/sop03.png"
/>
<img
src=
"@/assets/sop/sop03.png"
/>
<div
class=
"analysis-name"
>
执行率
<div
class=
"analysis-name"
>
执行率
<p
class=
"analysis-num"
>
{{
baseData
.
sopEventList
.
length
&&
sopInfo
.
executedRatio
?
sopInfo
.
executedRatio
:
'-'
}}
%
</p></div>
<p
class=
"analysis-num"
>
{{
sopInfo
.
executedRatio
?
sopInfo
.
executedRatio
:
'-'
}}
%
</p></div>
</div>
</div>
</div>
</div>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<div
class=
"analysis-name"
>
<div
class=
"analysis-name"
>
已触达客户数
已触达客户数
<p
class=
"analysis-num"
>
<p
class=
"analysis-num"
>
{{
baseData
.
sopEventList
.
length
?
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
:
'-'
}}
</p>
{{
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
?
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
:
'-'
}}
</p>
</div>
</div>
</div>
</div>
...
@@ -70,9 +70,7 @@
...
@@ -70,9 +70,7 @@
<p
class=
"m-b-10"
>
客户触达明细
</p>
<p
class=
"m-b-10"
>
客户触达明细
</p>
<!-- 表格区域 开始 -->
<!-- 表格区域 开始 -->
<GLTable
ref=
"touchListRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
<GLTable
ref=
"touchListRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
></GLTable>
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
></GLTable>
<!-- 表格区域 end -->
<!-- 表格区域 end -->
</div>
</div>
</div>
</div>
...
@@ -80,10 +78,8 @@
...
@@ -80,10 +78,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
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
{
pieOption
}
from
'./pieOption'
export
default
{
export
default
{
name
:
'touchList'
,
name
:
'touchList'
,
...
@@ -195,15 +191,19 @@ export default {
...
@@ -195,15 +191,19 @@ export default {
mounted
()
{
mounted
()
{
this
.
getBaseData
()
this
.
getBaseData
()
this
.
$refs
.
touchListRef
.
tableHeightValues
=
'400px'
this
.
$refs
.
touchListRef
.
tableHeightValues
=
'400px'
this
.
$refs
.
touchListRef
.
refreshTable
()
},
},
methods
:
{
methods
:
{
getBaseInfo
()
{
getBaseInfo
()
{
this
.
$apis
.
sop
.
getSopBaseInfoApi
({
sopId
:
this
.
sopId
}).
then
(
res
=>
{
this
.
$apis
.
sop
.
getSopBaseInfoApi
({
sopId
:
this
.
sopId
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
sopInfo
=
res
this
.
sopInfo
=
res
if
(
this
.
sopInfo
.
sopType
==
1
){
this
.
tableParams
.
tableColumns
.
splice
(
0
,
1
,
1
)
}
this
.
sopInfo
.
touchPercent
=
this
.
baseData
.
sopEventList
.
length
&&
this
.
sopInfo
.
customerCount
?
Math
.
round
((
this
.
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
/
this
.
sopInfo
.
customerCount
)
*
100
).
toFixed
(
0
)
+
'%'
:
'-'
this
.
sopInfo
.
touchPercent
=
this
.
baseData
.
sopEventList
.
length
&&
this
.
sopInfo
.
customerCount
?
Math
.
round
((
this
.
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
/
this
.
sopInfo
.
customerCount
)
*
100
).
toFixed
(
0
)
+
'%'
:
'-'
this
.
drawPie
()
//
this.drawPie()
})
})
},
},
...
@@ -277,26 +277,26 @@ export default {
...
@@ -277,26 +277,26 @@ export default {
this
.
$refs
.
touchListRef
.
data
.
length
?
(
this
.
$refs
.
touchListRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
touchListRef
.
setTableHeightFun
()
this
.
$refs
.
touchListRef
.
data
.
length
?
(
this
.
$refs
.
touchListRef
.
tableHeightValues
=
''
)
:
this
.
$refs
.
touchListRef
.
setTableHeightFun
()
},
},
drawPie
()
{
//
drawPie() {
if
(
this
.
baseData
.
sopEventList
.
length
)
{
//
if (this.baseData.sopEventList.length) {
let
chartDom
=
document
.
getElementById
(
'completePie'
)
//
let chartDom = document.getElementById('completePie')
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
].
data
=
[
//
option.series[0].data = [
{
//
{
value
:
this
.
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
?
this
.
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
:
0
,
//
value: this.selectedEventInfo.eventStatistics.reachCustomerCount ? this.selectedEventInfo.eventStatistics.reachCustomerCount : 0,
name
:
'已触达的客户数'
//
name: '已触达的客户数'
},
//
},
{
//
{
value
:
this
.
sopInfo
.
customerCount
-
this
.
selectedEventInfo
.
eventStatistics
.
reachCustomerCount
,
//
value: this.sopInfo.customerCount - this.selectedEventInfo.eventStatistics.reachCustomerCount,
name
:
'未触达的客户数'
//
name: '未触达的客户数'
}
//
}
]
//
]
//
option
&&
myChart
.
setOption
(
option
)
//
option && myChart.setOption(option)
}
//
}
}
//
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/sop/viewSop.vue
View file @
2baec74
...
@@ -203,6 +203,7 @@ export default {
...
@@ -203,6 +203,7 @@ export default {
let
info
=
this
.
editForm
.
eventList
&&
this
.
editForm
.
eventList
[
0
]
let
info
=
this
.
editForm
.
eventList
&&
this
.
editForm
.
eventList
[
0
]
this
.
$router
.
push
({
path
:
'/sop/viewEvent'
,
query
:
{
info
}});
this
.
$router
.
push
({
path
:
'/sop/viewEvent'
,
query
:
{
info
}});
},
},
tramWord
(
val
)
{
tramWord
(
val
)
{
let
htm
=
val
.
replace
(
let
htm
=
val
.
replace
(
/
\[([\u
4E00-
\u
9FA56
]{1,4}
|OK|NO|666
)
]/gi
,
/
\[([\u
4E00-
\u
9FA56
]{1,4}
|OK|NO|666
)
]/gi
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment