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