Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-customer
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 fe8fda2f
authored
Nov 30, 2021
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
88cd0e24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
78 deletions
src/api/groupTag.js
src/views/customerDetails/index.vue
src/views/tag/index.vue
src/views/tag/make.vue
src/api/groupTag.js
View file @
fe8fda2
// const url = 'http://192.168.
3.191:8064
/rop-scrm-entmicro/router'
// const url = 'http://192.168.
2.42:8064/
/rop-scrm-entmicro/router'
const
url
=
'/rop-scrm-entmicro/router'
const
returnAll
=
true
...
...
@@ -14,7 +14,7 @@ export default {
})
},
/**标签数据获取 */
gettag
ging
List
(
data
=
{})
{
gettagList
(
data
=
{})
{
data
.
method
=
'entmicro.api.qywechat.tagging.info'
return
window
.
$HTTP
({
url
,
...
...
@@ -22,4 +22,13 @@ export default {
returnAll
})
},
/**给客户打标签 */
putCustomertag
(
data
=
{})
{
data
.
method
=
'entmicro.api.qywechat.tagging.put.customer'
return
window
.
$HTTP
({
url
,
data
,
returnAll
})
},
}
src/views/customerDetails/index.vue
View file @
fe8fda2
...
...
@@ -27,7 +27,9 @@ export default {
add
,
tag
},
created
()
{},
created
()
{
},
methods
:
{
changeTabs
(
e
)
{
let
tabTop
=
document
.
querySelector
(
'#tabId'
).
offsetTop
...
...
src/views/tag/index.vue
View file @
fe8fda2
<
template
>
<div
class=
"tagContainer"
>
<search
placeholder=
"请输入关键字"
v-if=
"isTitle"
:keyword=
"key
word"
@
search=
"searchKeyw
ord"
></search>
<search
placeholder=
"请输入关键字"
v-if=
"isTitle"
:keyword=
"key
Word"
@
search=
"searchkeyW
ord"
></search>
<tip
:title=
"title"
></tip>
<template
v-if=
"customerList && customerList.length > 0"
>
<div
class=
"customerList"
>
<scroll-view
class=
"content"
@
ReachBottom=
"onReachBottom"
ref=
"scrollView"
>
<div
class=
"customer"
v-for=
"(item, index) in customerList"
:key=
"item.id"
@
click=
"gotoInfo(item)"
>
<
!--
<
div
class=
"checked-box"
>
<div
class=
"checked-box"
>
<template
v-if=
"item.isChecked"
>
<div
class=
"sprite-icon icon-customer-active"
@
click
.
stop=
"toggleHandle(index)"
></div>
</
template
>
<
template
v-else
>
<div
class=
"checked"
@
click
.
stop=
"toggleHandle(index)"
></div>
</
template
>
</div>
-->
</div>
<div
class=
"customer-portrait"
>
<img
:src=
"item.avatar"
alt=
""
/>
</div>
...
...
@@ -31,7 +31,7 @@
<div
class=
"buttomLine"
></div>
</div>
</scroll-view>
<
template
v-if=
"isTitle"
>
<
template
>
<div
class=
"footer"
>
<div
class=
"checked-box"
>
<template
v-if=
"allChecked"
>
...
...
@@ -52,18 +52,20 @@
</div>
</template>
<empty
v-else
description=
"暂无数据"
/>
<make
@
success=
"successHandle"
ref=
"popRefs"
></make>
<make
@
success=
"successHandle"
:externalUserIds=
"externalUserIds"
ref=
"popRefs"
></make>
</div>
</template>
<
script
>
import
make
from
'./make.vue'
import
{
groupTag
,
ssoApi
,
groupCustomer
,
wxConfig
}
from
'@/api'
import
{
Toast
}
from
'vant'
export
default
{
components
:
{
make
},
data
()
{
return
{
key
w
ord
:
''
,
key
W
ord
:
''
,
customerList
:
[],
externalUserIds
:
[],
checkList
:
[],
allChecked
:
false
,
title
:
''
,
...
...
@@ -113,10 +115,11 @@ export default {
},
init
()
{
//获取打标签客户列表
let
seacrh
=
{
key
word
:
this
.
keyw
ord
let
obj
=
{
key
Word
:
this
.
keyW
ord
}
groupTag
.
getcustomerList
(
seacrh
).
then
(
res
=>
{
this
.
allChecked
=
false
groupTag
.
getcustomerList
(
obj
).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
customerList
=
res
.
data
this
.
title
=
`您共有
${
this
.
customerList
.
length
}
位客户暂未添加标签`
...
...
@@ -134,7 +137,7 @@ export default {
toggleHandle
(
index
)
{
this
.
customerList
[
index
].
isChecked
=
!
this
.
customerList
[
index
].
isChecked
let
array
=
[]
this
.
customerList
.
map
(
item
=>
{
this
.
customerList
.
forEach
(
item
=>
{
if
(
item
.
isChecked
)
{
array
.
push
(
item
)
}
...
...
@@ -147,17 +150,29 @@ export default {
this
.
customerList
.
forEach
(
item
=>
{
item
.
isChecked
=
this
.
allChecked
})
this
.
toggleHandle
()
},
search
Keyw
ord
(
e
)
{
this
.
key
w
ord
=
e
search
keyW
ord
(
e
)
{
this
.
key
W
ord
=
e
this
.
init
()
},
handleTag
()
{
this
.
$refs
.
popRefs
.
toggle
()
this
.
externalUserIds
=
[]
this
.
customerList
.
forEach
(
item
=>
{
item
.
isChecked
?
this
.
externalUserIds
.
push
(
item
.
userid
)
:
''
})
console
.
log
(
this
.
externalUserIds
)
if
(
this
.
externalUserIds
.
length
>
0
)
{
this
.
$refs
.
popRefs
.
toggle
()
}
else
{
Toast
(
'请先选择客户'
)
}
},
successHandle
()
{
this
.
$refs
.
popRefs
.
toggle
()
this
.
checkList
=
[]
this
.
externalUserIds
=
[]
this
.
keyWord
=
''
this
.
init
()
},
//打开会话
gotoInfo
(
item
)
{
...
...
src/views/tag/make.vue
View file @
fe8fda2
<
template
>
<van-popup
v-model=
"tagShow"
position=
"bottom"
:style=
"
{ height: '90%' }">
<div
class=
"container-pop"
>
<
!--
<search
placeholder=
"请输入关键字"
:keyword=
"keyword"
@
search=
"searchKeyword"
></search>
--
>
<
search
placeholder=
"请输入关键字"
:keyword=
"keyWord"
@
search=
"searchkeyWord"
></search
>
<div
class=
"close-container"
v-if=
"checkAll.length > 0"
>
<div
class=
"nav-icon"
>
<img
src=
"../../assets/images/icon/nav-icon.png"
/>
</div>
<template
v-for=
"(closeTag, i) in checkAll"
>
<div
class=
"close-tag"
@
click=
"close(closeTag, i)"
:key=
"i"
>
{{
closeTag
.
t
ext
}}
{{
closeTag
.
t
aggingName
}}
<img
src=
"../../assets/images/icon/close-icon.png"
/>
</div>
</
template
>
...
...
@@ -16,10 +16,10 @@
<div
class=
"tag-container"
>
<
template
v-if=
"tagList.length > 0"
>
<div
class=
"tag-type"
v-for=
"(item, index) in tagList"
:key=
"index"
>
<div
class=
"tag-title"
>
{{
item
.
typ
e
}}
</div>
<div
class=
"tag-title"
>
{{
item
.
groupNam
e
}}
</div>
<div
class=
"tag-list"
>
<template
v-for=
"(tag, ids) in item.tag
s
"
>
<div
:key=
"ids"
:class=
"
{ tag: true, active: tag.isChecked }" @click="chooseTag(index, ids)">
{{
tag
.
t
ext
}}
</div>
<template
v-for=
"(tag, ids) in item.tag
gingList
"
>
<div
:key=
"ids"
:class=
"
{ tag: true, active: tag.isChecked }" @click="chooseTag(index, ids)">
{{
tag
.
t
aggingName
}}
</div>
</
template
>
</div>
</div>
...
...
@@ -35,103 +35,139 @@
</template>
<
script
>
import
{
groupTag
}
from
'@/api'
import
{
Toast
}
from
'vant'
export
default
{
name
:
'make'
,
data
()
{
return
{
keyword
:
''
,
tagList
:
[
{
type
:
'客户等级'
,
tags
:
[
{
text
:
'核心'
},
{
text
:
'重要'
},
{
text
:
'一般'
}
]
},
{
type
:
'保养周期'
,
tags
:
[
{
text
:
'半年'
},
{
text
:
'一年'
}
]
},
{
type
:
'客户意向'
,
tags
:
[
{
text
:
'意见非常好,可以立即跟进'
},
{
text
:
'重要'
}
]
}
],
keyWord
:
''
,
tagList
:
[],
checkAll
:
[],
tagShow
:
false
}
},
created
()
{
console
.
log
(
this
.
externalUserIds
)
this
.
init
()
},
props
:
{
externalUserIds
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
methods
:
{
chooseTag
(
index
,
ids
)
{
this
.
tagList
[
index
].
tag
s
[
ids
].
isChecked
=
!
this
.
tagList
[
index
].
tags
[
ids
].
isChecked
this
.
tagList
[
index
].
tag
gingList
[
ids
].
isChecked
=
!
this
.
tagList
[
index
].
taggingList
[
ids
].
isChecked
this
.
add
(
index
,
ids
)
this
.
judge
(
index
)
},
judge
()
{
this
.
tagList
.
forEach
(
item
=>
{
item
.
checked
=
false
if
(
item
.
taggingList
.
some
(
tag
=>
tag
.
isChecked
))
{
item
.
checked
=
true
}
})
},
add
(
index
,
ids
)
{
this
.
checkAll
.
push
(
this
.
tagList
[
index
].
tags
[
ids
])
if
(
this
.
tagList
[
index
].
taggingList
[
ids
].
isChecked
)
{
this
.
checkAll
.
push
(
this
.
tagList
[
index
].
taggingList
[
ids
])
}
else
{
this
.
checkAll
.
splice
(
index
,
1
)
}
},
close
(
data
,
value
)
{
console
.
log
(
data
)
this
.
checkAll
.
splice
(
value
,
1
)
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
tag
s
.
length
;
j
++
)
{
if
(
this
.
tagList
[
i
].
tag
s
[
j
].
text
==
data
.
text
)
{
this
.
tagList
[
i
].
tag
s
[
j
].
isChecked
=
false
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
tag
gingList
.
length
;
j
++
)
{
if
(
this
.
tagList
[
i
].
tag
gingList
[
j
].
taggingId
==
data
.
taggingId
)
{
this
.
tagList
[
i
].
tag
gingList
[
j
].
isChecked
=
false
}
}
}
this
.
judge
()
},
toggle
()
{
this
.
tagShow
=
!
this
.
tagShow
},
init
()
{
let
obj
=
{
keyWord
:
this
.
keyWord
}
groupTag
.
gettagList
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
this
.
tagList
=
res
.
data
if
(
this
.
tagList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
this
.
tagList
[
i
].
checked
=
false
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
taggingList
.
length
;
j
++
)
{
this
.
$set
(
this
.
tagList
[
i
].
taggingList
[
j
],
'isChecked'
,
false
)
}
}
}
}
else
{
this
.
tagList
=
[]
}
console
.
log
(
this
.
tagList
)
})
},
searchkeyWord
(
e
)
{
this
.
keyWord
=
e
this
.
init
()
},
clearData
()
{
if
(
this
.
tagList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
tags
.
length
;
j
++
)
{
this
.
$set
(
this
.
tagList
[
i
].
tags
[
j
],
'isChecked'
,
false
)
this
.
tagList
[
i
].
checked
=
false
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
taggingList
.
length
;
j
++
)
{
this
.
$set
(
this
.
tagList
[
i
].
taggingList
[
j
],
'isChecked'
,
false
)
}
}
}
// groupTag.gettaggingList().then(res => {
// console.log(res)
// this.tagList = res.data
// })
},
searchKeyword
(
e
)
{
this
.
keyword
=
e
this
.
keyWord
=
''
this
.
checkAll
=
[]
},
//打标签
handleTag
()
{
this
.
$emit
(
'success'
)
console
.
log
(
this
.
externalUserIds
)
let
taggingInfo
=
[]
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
if
(
this
.
tagList
[
i
].
checked
)
{
let
tagIds
=
[]
this
.
tagList
[
i
].
taggingList
.
forEach
(
tag
=>
{
tag
.
isChecked
?
tagIds
.
push
(
tag
.
taggingId
)
:
''
})
taggingInfo
.
push
({
labelType
:
this
.
tagList
[
i
].
labelType
,
groupId
:
this
.
tagList
[
i
].
groupId
,
tagIds
:
tagIds
.
join
(
','
)
})
}
}
if
(
taggingInfo
.
length
>
0
)
{
let
obj
=
{
externalUserIds
:
this
.
externalUserIds
.
join
(
','
),
taggingInfo
:
JSON
.
stringify
(
taggingInfo
)
}
groupTag
.
putCustomertag
(
obj
).
then
(
res
=>
{
if
(
res
.
data
)
Toast
(
'标签批量添加成功'
)
this
.
clearData
()
})
this
.
$emit
(
'success'
)
}
else
{
Toast
(
'请先选择标签'
)
}
},
//重置
reset
()
{
this
.
checkAll
=
[]
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
tags
.
length
;
j
++
)
{
if
(
this
.
tagList
[
i
].
tags
[
j
].
isChecked
)
{
this
.
tagList
[
i
].
tags
[
j
].
isChecked
=
false
}
this
.
tagList
[
i
].
checked
=
false
for
(
let
j
=
0
;
j
<
this
.
tagList
[
i
].
taggingList
.
length
;
j
++
)
{
this
.
tagList
[
i
].
taggingList
[
j
].
isChecked
=
false
}
}
}
...
...
@@ -156,6 +192,7 @@ export default {
.tag-list
{
display
:
flex
;
align-items
:
center
;
flex-wrap
:
wrap
;
.tag
{
padding
:
4px
12px
;
font-size
:
14px
;
...
...
@@ -165,6 +202,7 @@ export default {
background
:
#eeeeee
;
border-radius
:
14px
;
margin-left
:
12px
;
margin-bottom
:
10px
;
}
.active
{
color
:
#5850ff
;
...
...
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