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 028ba3d0
authored
Feb 20, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
群客户跟进,客户跟进标签修改
1 parent
05286f2a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
711 additions
and
220 deletions
src/api/detail.js
src/api/wxConfig.js
src/assets/css/customer.scss
src/assets/css/index.scss
src/components/Search.vue
src/components/TabCustomer.vue
src/router/routes.js
src/views/customer/detail.vue
src/views/customer/groupDetail.vue
src/views/customer/index.vue
src/views/tag/make.vue
vue.config.js
src/api/detail.js
View file @
028ba3d
const
url
=
'/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router'
export
default
{
/** 侧边栏-客户跟进 */
getCustomerDetail
(
data
)
{
...
...
@@ -7,5 +8,39 @@ export default {
url
,
data
,
})
},
/** 侧边栏-群客户跟进-群基本信息 */
getCustomerBaseDetail
(
data
)
{
data
.
method
=
'entmicro.api.customer.base.detail'
return
window
.
$HTTP
({
url
,
data
,
})
},
/** 侧边栏-群客户跟进-统计接口 */
getCustomerBaseDetailStatics
(
data
)
{
data
.
method
=
'entmicro.api.customer.base.detail.statics'
return
window
.
$HTTP
({
url
,
data
,
})
},
/** 侧边栏-群客户跟进-群客户列表 */
getCustomerCustList
(
data
)
{
data
.
method
=
'entmicro.api.customer.base.cust.list'
return
window
.
$HTTP
({
url
,
data
,
})
},
/** 侧边栏-群客户跟进-群员工列表 */
getCustomerStaffList
(
data
)
{
data
.
method
=
'entmicro.api.customer.base.staff.list'
return
window
.
$HTTP
({
url
,
data
,
})
}
}
src/api/wxConfig.js
View file @
028ba3d
...
...
@@ -49,7 +49,6 @@ const WxConfig = {
**/
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
invoke
(
'getContext'
,
{},
(
res
)
=>
{
console
.
log
(
res
)
let
{
err_msg
,
entry
,
shareTicket
}
=
res
/** entry 说明
*contact_profile 从联系人详情进入 3.0.24
...
...
@@ -84,7 +83,18 @@ const WxConfig = {
})
})
},
/**获取当前客户群ID */
getCurExternalChat
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
invoke
(
'getCurExternalChat'
,
{},
res
=>
{
if
(
res
.
err_msg
==
"getCurExternalChat:ok"
)
{
resolve
(
res
.
chatId
)
//返回当前客户群的群聊ID
}
else
{
reject
(
res
)
}
})
})
},
/** 外部联系人选人接口 */
selectExternalContact
()
{
return
new
Promise
((
resolve
)
=>
{
...
...
src/assets/css/customer.scss
View file @
028ba3d
...
...
@@ -13,29 +13,55 @@
}
}
.content
{
height
:
calc
(
100vh
-
90
px
);
height
:
calc
(
100vh
-
363
px
);
.item
{
height
:
7
9
px
;
height
:
7
8
px
;
border-bottom
:
1px
solid
rgba
(
195
,
195
,
195
,
0
.3
);
padding
:
0
16
px
;
margin
:
0
20
px
;
position
:
relative
;
box-sizing
:
border-box
;
.avatar
{
margin-right
:
16px
;
margin-right
:
10px
;
width
:
46px
;
height
:
46px
;
}
.info
{
font-size
:
14px
;
color
:
#333333
;
.phone
{
font-size
:
14px
;
font-weight
:
600
;
font-size
:
16px
;
color
:
#333333
;
line-height
:
20px
;
margin-bottom
:
6px
;
.wx
{
font-size
:
14px
;
font-weight
:
400
;
color
:
#6760ff
;
color
:
#3975C6
;
line-height
:
20px
;
}
}
.time
{
color
:
#999999
;
.time
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
17px
;
}
.tag-wrap
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#3975C6
;
.tag
{
padding
:
3px
14px
;
background
:
rgba
(
57
,
117
,
198
,
0
.15
);
border-radius
:
14px
;
margin-right
:
4px
;
width
:
52px
;
box-sizing
:
border-box
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
}
}
.btns
{
...
...
@@ -55,9 +81,18 @@
}
}
}
.mark
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
17px
;
position
:
absolute
;
right
:
19px
;
}
.icon-arrow
{
position
:
absolute
;
right
:
16
px
;
right
:
4
px
;
top
:
50%
;
transform
:
translateY
(
-50%
);
}
...
...
@@ -65,63 +100,63 @@
}
}
.page-type-0
{
.content
{
height
:
calc
(
100vh
-
220px
);
}
.copy-box
{
height
:
130px
;
box-sizing
:
border-box
;
padding
:
10px
16px
;
font-weight
:
500
;
font-size
:
14px
;
color
:
#333333
;
word-break
:
break-all
;
position
:
relative
;
background
:
#ffffff
;
box-shadow
:
0px
1px
0px
0px
#e9e9e9
;
.sprite-icon
{
position
:
absolute
;
top
:
10px
;
right
:
15px
;
}
.title
{
margin-bottom
:
16px
;
}
}
}
//
.page-type-0 {
//
.content {
//
height: calc(100vh - 220px);
//
}
//
.copy-box {
//
height: 130px;
//
box-sizing: border-box;
//
padding: 10px 16px;
//
font-weight: 500;
//
font-size: 14px;
//
color: #333333;
//
word-break: break-all;
//
position: relative;
//
background: #ffffff;
//
box-shadow: 0px 1px 0px 0px #e9e9e9;
//
.sprite-icon {
//
position: absolute;
//
top: 10px;
//
right: 15px;
//
}
//
.title {
//
margin-bottom: 16px;
//
}
//
}
//
}
.page-type-2
{
.content
{
height
:
calc
(
100vh
-
164px
);
}
.checked-box
{
margin-right
:
16px
;
.checked
{
width
:
14px
;
height
:
14px
;
border-radius
:
2px
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.15
);
}
}
.checked-control
{
font-size
:
14px
;
color
:
#333333
;
padding
:
0
16px
;
height
:
74px
;
.all
{
font-size
:
16px
;
font-weight
:
600
;
margin-right
:
16px
;
}
.btn
{
width
:
148px
;
height
:
36px
;
background
:
#3975C6
;
box-shadow
:
0px
2px
4px
0px
rgba
(
88
,
80
,
255
,
0
.3
);
border-radius
:
21px
;
margin-left
:
auto
;
color
:
#ffffff
;
}
}
}
\ No newline at end of file
// .page-type-2 {
// .content {
// height: calc(100vh - 164px);
// }
// .checked-box {
// margin-right: 16px;
// .checked {
// width: 14px;
// height: 14px;
// border-radius: 2px;
// border: 1px solid rgba(0, 0, 0, 0.15);
// }
// }
// .checked-control {
// font-size: 14px;
// color: #333333;
// padding: 0 16px;
// height: 74px;
// .all {
// font-size: 16px;
// font-weight: 600;
// margin-right: 16px;
// }
// .btn {
// width: 148px;
// height: 36px;
// background: #3975C6;
// box-shadow: 0px 2px 4px 0px rgba(88, 80, 255, 0.3);
// border-radius: 21px;
// margin-left: auto;
// color: #ffffff;
// }
// }
//
}
\ No newline at end of file
src/assets/css/index.scss
View file @
028ba3d
...
...
@@ -61,3 +61,21 @@ img {
.sticky
{
position
:
static
;
}
.text-12
{
font-size
:
12px
;
font-weight
:
400
;
color
:
#FFFFFF
;
line-height
:
17px
;
}
.text-20
{
font-size
:
20px
;
font-weight
:
500
;
color
:
#FFFFFF
;
line-height
:
28px
;
}
.text-14
{
font-size
:
14px
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
20px
;
}
src/components/Search.vue
View file @
028ba3d
<
template
>
<div
class=
"search"
>
<van-search
v-model=
"value"
:placeholder=
"placeholder"
@
search=
"onSearch"
/>
<van-search
v-model=
"value"
:placeholder=
"placeholder"
@
search=
"onSearch"
/>
</div>
</
template
>
...
...
@@ -21,15 +17,19 @@ export default {
default
:
'请输入内容搜索'
}
},
data
()
{
watch
:
{
keyword
(
e
)
{
this
.
value
=
e
}
},
data
()
{
return
{
value
:
this
.
keyword
}
},
mounted
()
{
},
mounted
()
{},
methods
:
{
onSearch
(
e
)
{
onSearch
(
e
)
{
this
.
$emit
(
'search'
,
e
)
}
}
...
...
src/components/TabCustomer.vue
0 → 100644
View file @
028ba3d
<
template
>
<div
class=
"tab"
v-if=
"data.length > 0"
>
<!-- 样式占位符-->
<div
class=
"canvas-tab flex"
>
<template
v-for=
"(i, index) in data"
>
<div
@
click=
"click(index)"
:class=
"['item', `$
{tabIndex == index ? 'active-' + index : ''}`]" :key="index">
</div>
</
template
>
</div>
<div
class=
"canvas-place-tab flex placeholder"
>
<
template
v-for=
"(i, index) in data"
>
<div
@
click=
"click(index)"
:class=
"['item', 'text-center', `$
{tabIndex == index ? 'active' : ''}`]" :key="index + 'i'">
{{
i
}}
</div>
</
template
>
</div>
<slot></slot>
</div>
</template>
<
script
>
export
default
{
name
:
'TabCustomer'
,
props
:
{
index
:
{
type
:
Number
,
default
:
0
},
list
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
}
},
data
()
{
return
{
data
:
this
.
list
,
tabIndex
:
this
.
index
}
},
watch
:
{
index
(
n
)
{
this
.
tabIndex
=
n
},
list
(
n
)
{
this
.
data
=
n
}
},
mounted
()
{},
methods
:
{
click
(
index
)
{
this
.
$emit
(
'change'
,
index
)
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.tab
{
height
:
auto
;
box-shadow
:
0px
3px
10px
0px
rgba
(
223
,
228
,
234
,
0.81
);
border-radius
:
4px
;
position
:
relative
;
background-color
:
#fff
;
.canvas-tab
{
width
:
100%
;
height
:
50px
;
box-sizing
:
border-box
;
background-color
:
#dfe7f1
;
.item
{
width
:
50%
;
transition
:
all
0.5s
;
font-size
:
14px
;
}
.active-0
{
height
:
0
;
border-bottom
:
50px
solid
#ffffff
;
border-right
:
10px
solid
transparent
;
}
.active-1
{
height
:
0
;
border-bottom
:
50px
solid
#ffffff
;
border-left
:
10px
solid
transparent
;
}
}
.canvas-place-tab
{
width
:
100%
;
height
:
50px
;
box-sizing
:
border-box
;
font-size
:
12px
;
color
:
#333333
;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
top
:
0
;
z-index
:
9
;
.item
{
color
:
#333333
;
flex
:
1
;
transition
:
all
0.5s
;
font-size
:
14px
;
}
.active
{
color
:
#3975c6
;
height
:
50px
;
}
}
}
</
style
>
\ No newline at end of file
src/router/routes.js
View file @
028ba3d
...
...
@@ -16,10 +16,10 @@ const pages = {
backgroundColor
:
'#F7F7F7'
,
keepAlive
:
true
,
}
},{
name
:
'detail'
,
meta
:{
title
:
'渠道活码'
,
},
{
name
:
'detail'
,
meta
:
{
title
:
'渠道活码'
,
keepAlive
:
true
,
}
}],
...
...
@@ -43,6 +43,13 @@ const pages = {
keepAlive
:
true
,
}
},
{
name
:
'groupDetail'
,
meta
:
{
title
:
'客户跟进'
,
backgroundColor
:
'#F7F7F7'
,
keepAlive
:
true
,
}
},
{
name
:
'editDetail'
,
meta
:
{
backgroundColor
:
'#F7F7F7'
,
...
...
@@ -74,6 +81,7 @@ const pages = {
const
redirect
=
''
let
routes
=
[]
const
keepAlives
=
[]
console
.
log
(
Object
.
keys
(
pages
))
Object
.
keys
(
pages
).
map
(
parent
=>
{
pages
[
parent
].
map
(
val
=>
{
const
isIndex
=
parent
==
redirect
&&
val
.
name
==
'index'
...
...
src/views/customer/detail.vue
View file @
028ba3d
...
...
@@ -28,7 +28,7 @@
<
template
v-for=
"(i, index) in detailObj"
>
<van-cell
:key=
"index"
:title=
"i.title"
@
click=
"setDetail(i)"
title-class=
"cell-title"
>
<template
#
default
>
<div
v-if=
"i.value(userInfo) &&
i.special !== 'special'"
>
{{
i
.
value
(
userInfo
)
}}
</div>
<div
v-if=
"i.value(userInfo) && i.special !== 'special'"
>
{{
i
.
value
(
userInfo
)
}}
</div>
<div
v-else-if=
"i.special == 'special'"
>
{{
i
.
value
(
userInfo
)
}}
{{
i
.
valueTrain
(
userInfo
)
}}
{{
i
.
valueType
(
userInfo
)
}}
</div>
<div
v-else
class=
"placeholder"
>
<template
v-if=
"i.placeholder"
>
{{
i
.
placeholder
}}
</
template
>
...
...
@@ -47,7 +47,7 @@
<div
class=
"detail-bg detail-third"
>
<div
class=
"title"
>
客户标签
</div>
<div
class=
"detail-label"
>
<div
v-if=
"!userInfo.labelInfos.length"
class=
"no-label"
>
<div
v-if=
"
userInfo.labelInfos&&
!userInfo.labelInfos.length"
class=
"no-label"
>
<div
class=
"btn text-center"
@
click=
"handleTag"
>
<van-icon
name=
"plus"
class=
"plus"
/>
<span>
标签
</span>
...
...
@@ -86,7 +86,7 @@
<van-popup
v-model=
"showDatePicker"
position=
"bottom"
round
>
<van-datetime-picker
v-model=
"selectDate"
type=
"date"
title=
"选择年月日"
:min-date=
"minDate"
:max-date=
"maxDate"
@
confirm=
"confirmDate"
@
cancel=
"showDatePicker = false"
/>
</van-popup>
<make
@
success=
"successHandle"
:externalUserIds=
"[id]"
:chooseItems=
"userInfo.labelInfos"
ref=
"popRefs"
></make>
<make
@
success=
"successHandle"
:externalUserIds=
"[id]"
:chooseItems=
"userInfo.labelInfos"
:isCustomer=
'false'
ref=
"popRefs"
></make>
</div>
</template>
...
...
@@ -242,11 +242,12 @@ export default {
},
mounted
()
{
this
.
showLoading
()
let
{
id
}
=
this
.
getQuery
()
//
console.log(id)
// id = 'wm
219ICgAARGgXJUmUdGxCgNfGxRCWDg
'
let
{
id
,
customerId
}
=
this
.
getQuery
()
console
.
log
(
id
)
// id = 'wm
dMreDgAA2tF6eep95QX1zxGuKjObHA
'
if
(
id
)
{
this
.
id
=
id
this
.
customerId
=
customerId
//用来判断。若员工尚未添加该客户为好友,则暂不允许在客户跟进中修改客户的信息,仅只读。
this
.
getCustomerDetail
(
id
)
}
else
{
wxConfig
.
init
([
'getCurExternalContact'
]).
then
(()
=>
{
...
...
@@ -304,8 +305,9 @@ export default {
userInfo
:
{
vehicleInfo
,
info
}
}
=
this
let
userId
=
this
.
id
if
(
this
.
customerId
==
0
)
return
if
(
type
==
'tel'
)
{
if
(
info
.
customerPhone
&&
save_key
==
'customerPhone'
)
return
if
(
info
.
customerPhone
&&
save_key
==
'customerPhone'
)
return
this
.
$router
.
push
({
name
:
'customer.editDetail'
,
params
:
{
...
...
src/views/customer/groupDetail.vue
0 → 100644
View file @
028ba3d
<
template
>
<div
class=
"group-customer-wrap"
>
<div
class=
"group-customer-vehicle"
>
<div
class=
"group-customer-vehicle-info"
>
{{
groupBase
&&
groupBase
.
groupName
}}
</div>
<div
class=
"group-customer-person-info"
>
<div
class=
"line-person-info text-14 flex"
>
<div
class=
"person-info-title"
>
群主|
</div>
<div>
{{
groupBase
&&
groupBase
.
groupHostName
}}
</div>
</div>
<div
class=
"line-person-info text-14 flex"
>
<div
class=
"person-info-title"
>
创建时间|
</div>
<div>
{{
groupBase
&&
groupBase
.
createDate
}}
</div>
</div>
</div>
</div>
<div
class=
"group-customer-members flex"
>
<div
class=
"group-customer-members-line"
>
<div
class=
"group-customer-members-line-text text-12"
>
全部群成员
</div>
<div
class=
"flex text-20"
>
{{
baseStatics
&&
baseStatics
.
total
}}
<div
class=
"text-12"
>
人
</div>
</div>
</div>
<div
class=
"line"
></div>
<div
class=
"group-customer-members-line"
>
<div
class=
"group-customer-members-line-text text-12"
>
今日入群
</div>
<div
class=
"flex text-20"
>
{{
baseStatics
&&
baseStatics
.
addNum
}}
<div
class=
"text-12"
>
人
</div>
</div>
</div>
<div
class=
"line"
></div>
<div
class=
"group-customer-members-line"
>
<div
class=
"group-customer-members-line-text text-12"
>
今日退群
</div>
<div
class=
"flex text-20"
>
{{
baseStatics
&&
baseStatics
.
removeNum
}}
<div
class=
"text-12"
>
人
</div>
</div>
</div>
</div>
<tab-customer
:list=
"list"
@
change=
"change"
:index=
"tabIndex"
>
<index
ref=
"customerIndex"
:index=
"tabIndex"
:chatId=
"chatId"
@
listChange=
"getList"
></index>
</tab-customer>
</div>
</
template
>
<
script
>
import
index
from
'@/views/customer'
import
{
detailApi
,
wxConfig
}
from
'@/api'
export
default
{
components
:
{
index
},
data
()
{
return
{
tabIndex
:
0
,
baseStatics
:
''
,
//群统计
groupBase
:
''
,
list
:
[
'客户'
,
'员工'
],
chatId
:
''
}
},
mounted
()
{
this
.
showLoading
()
let
{
id
}
=
this
.
getQuery
()
console
.
log
(
'id'
,
id
)
// id = '1103'
if
(
id
)
{
this
.
chatId
=
id
this
.
initData
(
id
)
this
.
hideLoading
()
}
else
{
wxConfig
.
init
([
'getCurExternalContact'
]).
then
(()
=>
{
wxConfig
.
getCurExternalContact
()
.
then
(
chatId
=>
{
this
.
chatId
=
chatId
this
.
initData
(
id
)
})
.
catch
(
e
=>
{
this
.
hideLoading
()
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该功能暂不支持在群侧边栏打开'
,
confirmButtonText
:
'知道了'
,
confirmButtonColor
:
'#3975c6'
}).
then
(()
=>
{
wx
.
closeWindow
()
})
})
})
}
},
methods
:
{
initData
(
id
)
{
this
.
getCustomerBaseDetail
(
id
)
//群基本信息
this
.
getCustomerBaseDetailStatics
(
id
)
//统计接口
},
//群基本信息
getCustomerBaseDetail
(
id
)
{
let
obj
=
{
id
,
pageSize
:
10
,
pageNum
:
1
}
detailApi
.
getCustomerBaseDetail
(
obj
).
then
(
res
=>
{
if
(
res
)
{
let
reg
=
/
(\d{4})\/(\d{1,2})\/(\d{1,2})
/
res
.
createDate
=
res
.
createDate
.
replace
(
reg
,
'$1-$2-$3'
)
this
.
groupBase
=
res
}
})
},
//统计接口
getCustomerBaseDetailStatics
(
id
)
{
let
obj
=
{
id
,
pageSize
:
10
,
pageNum
:
1
}
detailApi
.
getCustomerBaseDetailStatics
(
obj
).
then
(
res
=>
{
if
(
res
)
{
this
.
baseStatics
=
res
}
})
},
change
(
index
)
{
this
.
$refs
.
customerIndex
.
initSearch
()
this
.
tabIndex
=
index
},
getList
(
data
)
{
this
.
list
=
data
.
list
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.group-customer-wrap
{
margin
:
10px
16px
;
.group-customer-vehicle
{
width
:
100%
;
height
:
130px
;
background
:
#ffffff
;
box-shadow
:
0px
4px
8px
0px
rgba
(
224
,
224
,
224
,
0.5
);
border-radius
:
4px
;
padding
:
10px
;
box-sizing
:
border-box
;
&-info
{
font-size
:
16px
;
font-weight
:
600
;
color
:
#333333
;
line-height
:
22px
;
padding
:
10px
0
20px
10px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.1
);
}
.group-customer-person-info
{
margin
:
9px
0
10px
10px
;
.line-person-info
{
margin-bottom
:
7px
;
.person-info-title
{
width
:
70px
;
text-align
:
right
;
margin-right
:
6px
;
color
:
#999999
;
}
}
}
}
.group-customer-members
{
width
:
100%
;
height
:
93px
;
background
:
linear-gradient
(
127deg
,
#3975c6
0%
,
rgba
(
57
,
117
,
198
,
0.99
)
98%
,
#3975c6
100%
);
border-radius
:
4px
;
margin
:
10px
0
;
padding
:
20px
30px
;
box-sizing
:
border-box
;
justify-content
:
space-between
;
.line
{
width
:
2px
;
height
:
40px
;
background
:
#fff
;
}
&
-line
{
display
:
flex
;
width
:
auto
;
flex-direction
:
column
;
align-items
:
center
;
&-text
{
margin-bottom
:
8px
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/customer/index.vue
View file @
028ba3d
<
template
>
<div
:class=
"['layout',`page-type-$
{tabIndex}`]">
<tab
:list=
"['待添加','待通过','已通过','全部']"
@
change=
"change"
sticky
:index=
"tabIndex"
></tab>
<div
class=
"tips flex"
>
您共有5位客户待添加!
<div
class=
"time"
>
2021/7/24
</div>
</div>
<template>
<template>
<scroll-view
class=
"content"
@
ReachBottom=
"onReachBottom"
ref=
"scrollView"
>
<template
v-for=
"(item,index) in 10"
>
<div
:key=
"index"
class=
"item flex"
>
<template
v-if=
"tabIndex == 2"
>
<div
class=
"checked-box"
>
<template
v-if=
"index % 2 == 0"
>
<div
class=
"sprite-icon icon-customer-active"
></div>
</
template
>
<
template
v-else
>
<div
class=
"checked"
></div>
</
template
>
</div>
<div
class=
"avatar"
>
<div
class=
"sprite-icon icon-avatar"
></div>
</div>
<div
class=
"info"
>
<div
class=
"phone flex"
>
恒河猴
<div
class=
"wx"
>
@微信
</div>
</div>
<div
class=
"time"
>
2021年7月24日添加
</div>
<div
:class=
"['layout', `page-type-$
{tabIndex}`]">
<search
:placeholder=
"tabIndex == 0 ? '姓名、手机、车牌号' : '输入员工姓名'"
:keyword=
"keyWord"
@
search=
"searchkeyWord"
></search>
<template
v-if=
"tabIndex == 0 ? custList.length > 0 : staffList.length > 0"
>
<scroll-view
class=
"content"
@
ReachBottom=
"onReachBottom"
ref=
"scrollView"
>
<template
v-for=
"(item, index) in tabIndex == 0 ? custList : staffList"
>
<div
:key=
"index"
class=
"item flex"
@
click=
"goTo(item)"
>
<template>
<div
class=
"avatar"
>
<img
:src=
"tabIndex == 0 ? item.avatar : item.thumbAvatar"
alt=
""
v-if=
"item.avatar || item.thumbAvatar"
/>
<div
v-else
class=
"sprite-icon icon-avatar"
></div>
</div>
<div
class=
"info"
>
<div
class=
"phone flex"
>
{{
item
.
groupNickName
}}
<div
class=
"wx"
>
{{
item
.
type
==
1
?
'@微信'
:
'@企微'
}}
</div>
</div>
<div
class=
"sprite-icon icon-arrow"
></div>
</template>
<
template
v-else
>
<template
v-if=
"tabIndex == 3"
>
<div
class=
"avatar"
>
<div
class=
"sprite-icon icon-avatar"
></div>
</div>
<template
v-if=
"tabIndex == 1"
>
<div
class=
"time"
>
进群时间:
{{
item
.
joinTime
}}
</div>
</
template
>
<div
class=
"info"
>
<div
class=
"phone"
>
13931970596
</div>
恒河猴
<div
class=
"tag-wrap flex"
v-else
>
<
template
v-if=
"item.labels.length > 0"
>
<div
class=
"tag"
v-for=
"tag in item.labels.slice(0, 3)"
:key=
"tag.labelId"
>
{{
tag
.
labelValue
}}
</div>
</
template
>
</div>
<
template
v-if=
"tabIndex != 1"
>
<div
class=
"btns flex"
>
<div
class=
"btn flex"
>
<div
class=
"sprite-icon icon-customer-add"
></div>
加好友
</div>
<div
class=
"line"
></div>
<div
class=
"btn flex"
@
click=
"makePhoneCall(13931970596)"
>
<div
class=
"sprite-icon icon-customer-phone"
></div>
拨打电话
</div>
</div>
</
template
>
</div>
<
template
v-if=
"item.isMyCustomer == 0 && tabIndex == 0"
>
<div
class=
"mark"
>
我的客户
</div>
</
template
>
</div>
</template>
</scroll-view>
</template>
</template>
<
template
v-if=
"tabIndex == 0"
>
<div
class=
"copy-box"
>
<div
class=
"sprite-icon icon-customer-copy"
></div>
<div
class=
"title"
>
客户好友申请文案
</div>
<div>
我是深圳福田宝马4S店的售后经理王俊凯,添加企业微信,帮你解决您购车售后任何问题。
</div>
</div>
<div
class=
"sprite-icon icon-arrow"
v-if=
"tabIndex == 0"
></div>
</template>
</div>
</template>
</scroll-view>
</template>
<
template
v-if=
"tabIndex == 2"
>
<div
class=
"checked-control flex"
>
<div
class=
"checked-box"
>
<template
v-if=
"true"
>
<div
class=
"sprite-icon icon-customer-active"
></div>
</
template
>
<
template
v-else
>
<div
class=
"checked"
></div>
</
template
>
</div>
<div
class=
"all"
>
全选
</div>
已选1个客户
<div
class=
"btn text-center"
>
批量打标签
</div>
</div>
<
template
v-else
>
<empty
description=
"暂无数据"
/>
</
template
>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
detailApi
,
ssoApi
,
wxConfig
}
from
'@/api'
export
default
{
name
:
''
,
data
()
{
data
()
{
return
{
tabIndex
:
0
tabIndex
:
this
.
index
,
custList
:
[],
staffList
:
[],
keyWord
:
''
,
list
:
[],
id
:
this
.
chatId
}
},
props
:
{
index
:
{
type
:
Number
,
default
:
0
},
chatId
:
{
type
:
String
,
default
:
''
}
},
watch
:
{
index
(
n
)
{
this
.
tabIndex
=
n
},
custList
:
{
handler
()
{
this
.
$emit
(
'listChange'
,
{
list
:
[
'客户('
+
this
.
custList
.
length
+
')'
,
'员工('
+
this
.
staffList
.
length
+
')'
]
})
},
deep
:
true
,
immediate
:
true
},
staffList
:
{
handler
()
{
this
.
$emit
(
'listChange'
,
{
list
:
[
'客户('
+
this
.
custList
.
length
+
')'
,
'员工('
+
this
.
staffList
.
length
+
')'
]
})
},
deep
:
true
,
immediate
:
true
},
chatId
:
{
handler
(
e
)
{
this
.
id
=
e
this
.
initData
()
},
immediate
:
true
}
},
mounted
()
{
created
()
{
this
.
getuserInfo
()
},
mounted
()
{
this
.
initWx
()
},
methods
:
{
change
(
e
)
{
console
.
log
(
e
)
//初始化微信接口
initWx
()
{
wxConfig
.
init
([
'openEnterpriseChat'
]).
then
(()
=>
{})
},
initData
(
index
)
{
// if (index == 0) this.getCustomerCustList() //群客户列表
// if (index == 1) this.getCustomerStaffList() //群员工列表
this
.
getCustomerCustList
()
//群客户列表
this
.
getCustomerStaffList
()
//群员工列表
},
initSearch
()
{
this
.
keyWord
=
''
// console.log(this.keyWord)
this
.
initData
()
},
getuserInfo
()
{
ssoApi
.
getuserInfo
().
then
(
res
=>
{
this
.
workUserId
=
res
.
data
.
workUserId
})
},
//群客户列表
getCustomerCustList
()
{
let
obj
=
{
id
:
this
.
id
,
pageSize
:
20
,
pageNum
:
1
,
keyword
:
this
.
tabIndex
==
0
?
this
.
keyWord
:
''
}
detailApi
.
getCustomerCustList
(
obj
).
then
(
res
=>
{
if
(
res
)
{
this
.
custList
=
res
// console.log(this.custList)
}
})
},
//群员工列表
getCustomerStaffList
()
{
let
obj
=
{
id
:
this
.
id
,
pageSize
:
20
,
pageNum
:
2
,
customerName
:
this
.
tabIndex
==
1
?
this
.
keyWord
:
''
}
detailApi
.
getCustomerStaffList
(
obj
).
then
(
res
=>
{
if
(
res
)
{
this
.
staffList
=
res
// console.log(this.staffList)
}
})
},
searchkeyWord
(
e
)
{
this
.
keyWord
=
e
if
(
this
.
tabIndex
==
0
)
this
.
getCustomerCustList
()
//群客户列表
if
(
this
.
tabIndex
==
1
)
this
.
getCustomerStaffList
()
//群员工列表
},
change
(
e
)
{
// console.log(e)
this
.
tabIndex
=
e
},
onReachBottom
()
{
console
.
log
(
'触底'
)
onReachBottom
()
{
//
console.log('触底')
this
.
$refs
.
scrollView
.
loading
=
false
this
.
$refs
.
scrollView
.
finished
=
true
},
goTo
(
data
)
{
if
(
!
data
.
oneid
&&
this
.
tabIndex
==
0
)
{
Toast
(
'该用户尚未成为企业微信客户,请先添加为客户'
)
return
}
if
(
this
.
tabIndex
==
0
)
this
.
$router
.
push
({
path
:
'/customer/detail'
,
query
:
{
id
:
data
.
userId
,
customerId
:
data
.
isMyCustomer
}
})
if
(
this
.
tabIndex
==
1
)
{
let
seach
=
{
userIds
:
[
this
.
workUserId
],
//参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds
:
[
data
.
userId
],
// 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName
:
''
,
// 会话名称。单聊时该参数传入空字符串""即可。
chatId
:
''
}
wxConfig
.
openEnterpriseChat
(
seach
).
then
(
res
=>
{})
}
}
}
}
...
...
src/views/tag/make.vue
View file @
028ba3d
...
...
@@ -22,7 +22,8 @@
<div
class=
"tag-title"
>
{{
item
.
groupName
}}
</div>
<div
class=
"tag-list"
>
<template
v-for=
"(tag, ids) in item.taggingList"
>
<div
:key=
"ids"
:class=
"['text-center', 'tag',
{ active: tag.isChecked || tag.disabled }]" @click="chooseTag(index, ids)">
{{
tag
.
taggingName
}}
</div>
<div
:key=
"ids"
:class=
"['text-center', 'tag',
{ active: tag.isChecked }]" @click="chooseTag(index, ids)">
{{
tag
.
taggingName
}}
</div>
<!--
{ active: tag.isChecked || tag.disabled } -->
</
template
>
</div>
</div>
...
...
@@ -71,6 +72,10 @@ export default {
chooseItems
:
{
type
:
Array
,
default
:
()
=>
[]
},
isCustomer
:
{
type
:
Boolean
,
default
:
true
}
},
created
()
{
...
...
@@ -79,7 +84,8 @@ export default {
methods
:
{
chooseTag
(
index
,
ids
)
{
let
{
disabled
}
=
this
.
tagList
[
index
].
taggingList
[
ids
]
if
(
disabled
)
{
let
{
isCustomer
}
=
this
if
(
disabled
&&
isCustomer
)
{
this
.
showToast
(
'标签修改功能即将上线,敬请期待'
)
return
}
...
...
@@ -106,6 +112,7 @@ export default {
}
}
}
console
.
log
(
this
.
checkAll
)
},
close
(
data
,
value
)
{
this
.
checkAll
.
splice
(
value
,
1
)
...
...
@@ -127,7 +134,8 @@ export default {
this
.
tagFlag
=
false
},
init
()
{
let
{
chooseItems
,
keyWord
}
=
this
let
{
chooseItems
,
keyWord
,
isCustomer
}
=
this
console
.
log
(
chooseItems
,
'chooseItems'
)
let
obj
=
{
keyWord
}
...
...
@@ -135,6 +143,7 @@ export default {
this
.
tagFlag
=
true
if
(
res
&&
res
.
length
>
0
)
{
this
.
tagList
=
res
console
.
log
(
'this.tagList'
,
this
.
tagList
)
if
(
this
.
tagList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
tagList
.
length
;
i
++
)
{
this
.
tagList
[
i
].
checked
=
false
...
...
@@ -143,19 +152,27 @@ export default {
}
}
}
chooseItems
.
map
(
e
=>
{
this
.
tagList
.
map
(
t
=>
{
if
(
e
.
labelGroupInfo
.
labelGroupId
==
t
.
groupId
)
{
t
.
taggingList
.
map
(
k
=>
{
e
.
labelInfoList
.
map
(
s
=>
{
if
(
s
.
labelId
==
k
.
taggingId
)
{
k
.
disabled
=
true
}
//
if
(
chooseItems
&&
chooseItems
.
length
>
0
)
{
chooseItems
.
map
(
e
=>
{
this
.
tagList
.
map
(
t
=>
{
if
(
e
.
labelGroupInfo
.
labelGroupId
==
t
.
groupId
)
{
t
.
taggingList
.
map
(
k
=>
{
e
.
labelInfoList
.
map
(
s
=>
{
if
(
s
.
labelId
==
k
.
taggingId
)
{
k
.
disabled
=
true
k
.
isChecked
=
true
//客户跟进获取已打标签的数据
if
(
!
isCustomer
)
this
.
checkAll
.
unshift
(
k
)
console
.
log
(
this
.
checkAll
)
}
})
})
}
)
}
}
}
)
})
})
}
if
(
this
.
checkAll
.
length
>
0
&&
this
.
tagList
.
length
>
0
)
{
this
.
saveTag
()
}
...
...
@@ -195,25 +212,34 @@ export default {
},
//打标签
handleTag
()
{
let
taggingInfo
=
[]
console
.
log
(
'this.tagList'
,
this
.
tagList
)
let
tagIds
=
[]
let
deletetagIds
=
[]
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
(
','
)
})
}
this
.
tagList
[
i
].
taggingList
.
forEach
(
tag
=>
{
!
tag
.
isChecked
&&
tag
.
disabled
?
deletetagIds
.
push
(
tag
.
taggingId
)
:
''
tag
.
isChecked
&&
!
tag
.
disabled
?
tagIds
.
push
(
tag
.
taggingId
)
:
''
})
// taggingInfo.push({
// labelType: this.tagList[i].labelType,
// groupId: this.tagList[i].groupId,
// tagIds: tagIds.join(',')
// })
// deleteTaggingInfo.push({
// labelType: this.tagList[i].labelType,
// groupId: this.tagList[i].groupId,
// tagIds: deletetagIds.join(',')
// })
// }
}
if
(
tag
gingInfo
.
length
>
0
)
{
if
(
tag
Ids
.
length
>
0
||
deletetagIds
.
length
>
0
)
{
let
obj
=
{
externalUserIds
:
this
.
externalUserIds
.
join
(
','
),
taggingInfo
:
JSON
.
stringify
(
taggingInfo
)
labelIdAddList
:
tagIds
,
labelIdDelList
:
deletetagIds
,
taggingInfo
:
1111
}
console
.
log
(
obj
)
groupTag
.
putCustomertag
(
obj
).
then
(
res
=>
{
if
(
res
)
Toast
(
this
.
externalUserIds
.
length
>
1
?
'标签批量添加成功'
:
'标签添加成功'
)
this
.
clearData
()
...
...
vue.config.js
View file @
028ba3d
...
...
@@ -49,7 +49,7 @@ const spritesmithFunction = data => {
return
`
${
shared
}
\n
${
perSprite
}
`
}
module
.
exports
=
{
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-
group-cha
t/'
,
// 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath
:
IS_PROD
?
'./'
:
'/dj-scrm-wx-
work-main-tes
t/'
,
// 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router history模式使用
...
...
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