Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
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 b773cd75
authored
Jan 10, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交 一客一群
1 parent
94031874
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1106 additions
and
238 deletions
package.json
src/App.vue
src/api/modules/groupGuest.js
src/assets/empty.png
src/config/index.js
src/main.js
src/utils/util.js
src/views/guestGroup/add.vue
src/views/guestGroup/components/selectFollow.vue
src/views/guestGroup/components/selectMember.vue
src/views/guestGroup/components/selectMembers.vue
src/views/guestGroup/detail.vue
src/views/guestGroup/index.vue
package.json
View file @
b773cd7
...
...
@@ -11,6 +11,7 @@
"dependencies"
:
{
"axios"
:
"^0.21.1"
,
"core-js"
:
"^3.4.4"
,
"dayjs"
:
"^1.10.7"
,
"echarts"
:
"^5.2.0"
,
"element-ui"
:
"^2.4.5"
,
"glsx-common"
:
"^1.4.6"
,
...
...
@@ -46,4 +47,4 @@
"> 1%"
,
"last 2 versions"
]
}
}
\ No newline at end of file
src/App.vue
View file @
b773cd7
...
...
@@ -26,7 +26,7 @@
</div>
<img
src=
"./assets/logo.png"
alt=
""
srcset=
""
/>
</div>
-->
<keep-alive
exclude=
"clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd"
>
<keep-alive
exclude=
"clientDetail,clientGroupDetail,tagsManage,clientDataOverview,guestGroup,guestGroupAdd
,guestGroupDetail
"
>
<router-view></router-view>
</keep-alive>
</div>
...
...
src/api/modules/groupGuest.js
View file @
b773cd7
...
...
@@ -10,6 +10,7 @@ import { http } from '@/main'
const
URL
=
'/rop-scrm-entmicro/router'
const
PATH
=
'entmicro.api.one.template.'
const
WURL
=
'/rop-scrm-wechat/router'
const
PATH2
=
'entmicro.api.group.'
const
templateList
=
params
=>
{
params
.
method
=
`
${
PATH
}
page`
...
...
@@ -102,7 +103,17 @@ const getStatus = params => {
}
//一客一群详情页
const
getListApi
=
params
=>
{
params
.
method
=
`
${
PATH
}
page`
params
.
method
=
`
${
PATH
}
detail`
return
http
({
url
:
URL
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
customerList
=
params
=>
{
params
.
method
=
`
${
PATH2
}
template.customer.page`
return
http
({
url
:
URL
,
method
:
'GET'
,
...
...
@@ -111,6 +122,15 @@ const getListApi = params => {
})
}
const
getFollower
=
params
=>
{
params
.
method
=
'entmicro.api.staff.listFollowerStaffByPage'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
templateList
,
...
...
@@ -122,5 +142,7 @@ export default {
nameVaild
,
getStatus
,
updateNameVaild
,
getListApi
getListApi
,
customerList
,
getFollower
}
src/assets/empty.png
0 → 100644
View file @
b773cd7
1.45 KB
src/config/index.js
View file @
b773cd7
...
...
@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import
{
Http
}
from
'glsx-common'
let
timeout
=
30000
//超时时间
export
const
fetchConfig
=
function
(
isEnv
=
true
)
{
//
if (isEnv) {
//
let { request } = cfg
//
Object.assign(request, { timeout })
//
return Promise.resolve(cfg)
//
}
if
(
isEnv
)
{
let
{
request
}
=
cfg
Object
.
assign
(
request
,
{
timeout
})
return
Promise
.
resolve
(
cfg
)
}
// https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config
return
new
Http
({
request
:{
timeout
:
3000
}}).
get
(
'https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config'
)
...
...
src/main.js
View file @
b773cd7
...
...
@@ -29,6 +29,7 @@ Vue.config.productionTip = false
Vue
.
prototype
.
$apis
=
apis
Vue
.
use
(
glsxTable
);
Vue
.
prototype
.
$message
=
message
Vue
.
prototype
.
size
=
'small'
// Vue.prototype.btn_size = 'mini'
Vue
.
prototype
.
$Constants
=
Constants
Vue
.
prototype
.
$Utils
=
Util
...
...
src/utils/util.js
0 → 100644
View file @
b773cd7
import
{
Message
}
from
'element-ui'
let
util
=
{}
util
.
cloneText
=
function
(
message
)
{
let
input
=
document
.
createElement
(
'input'
)
input
.
value
=
message
document
.
body
.
appendChild
(
input
)
input
.
select
()
input
.
setSelectionRange
(
0
,
input
.
value
.
length
),
document
.
execCommand
(
'Copy'
)
document
.
body
.
removeChild
(
input
)
Message
.
success
(
'复制成功'
)
}
util
.
getBeforeDate
=
function
(
sign
=
'-'
)
{
let
day
=
new
Date
();
let
month
=
day
.
getMonth
()
+
1
;
let
date
=
day
.
getDate
();
if
(
month
<
10
)
month
=
'0'
+
month
;
if
(
date
<
10
)
date
=
'0'
+
date
;
var
s
=
day
.
getFullYear
()
+
sign
+
month
+
sign
+
date
;
return
s
;
}
util
.
getBeforeMonth
=
function
(
days
)
{
let
month
=
new
Date
().
getMonth
()
+
1
;
let
year
=
new
Date
().
getFullYear
();
let
arr
=
new
Array
();
for
(
let
i
=
0
;
i
<
days
;
i
++
)
{
if
(
month
<=
0
)
{
year
=
year
-
1
;
month
=
month
+
12
;
}
if
(
month
<
10
)
month
=
'0'
+
month
;
arr
[
i
]
=
year
+
'年'
+
month
+
'月'
month
--
}
return
arr
;
}
/**
* 格式化时间
* @param {Array} time
*/
util
.
formatTime
=
function
(
time
)
{
return
{
startTime
:
time
?
time
[
0
]
+
' '
+
'00:00:00'
:
''
,
endTime
:
time
?
time
[
1
]
+
' '
+
'23:59:59'
:
''
}
}
util
.
tringToDate
=
function
(
dateStr
,
separator
)
{
if
(
!
separator
)
{
separator
=
"-"
;
}
var
dateArr
=
dateStr
.
split
(
separator
);
var
year
=
parseInt
(
dateArr
[
0
]);
var
month
;
//处理月份为04这样的情况
if
(
dateArr
[
1
].
indexOf
(
"0"
)
==
0
)
{
month
=
parseInt
(
dateArr
[
1
].
substring
(
1
));
}
else
{
month
=
parseInt
(
dateArr
[
1
]);
}
var
day
=
parseInt
(
dateArr
[
2
]);
var
date
=
new
Date
(
year
,
month
-
1
,
day
);
return
date
;
}
util
.
getDay
=
function
(
num
,
str
=
'-'
)
{
var
today
=
new
Date
();
var
nowTime
=
today
.
getTime
();
var
ms
=
24
*
3600
*
1000
*
num
;
today
.
setTime
(
parseInt
(
nowTime
+
ms
));
var
oYear
=
today
.
getFullYear
();
var
oMoth
=
(
today
.
getMonth
()
+
1
).
toString
();
if
(
oMoth
.
length
<=
1
)
oMoth
=
'0'
+
oMoth
;
var
oDay
=
today
.
getDate
().
toString
();
if
(
oDay
.
length
<=
1
)
oDay
=
'0'
+
oDay
;
return
oYear
+
str
+
oMoth
+
str
+
oDay
;
}
util
.
openUrl
=
function
(
url
)
{
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
url
link
.
target
=
'_blank'
link
.
rel
=
'opener'
link
.
click
()
}
util
.
downloadIamge
=
function
(
imgsrc
,
name
=
new
Date
().
getTime
())
{
//下载图片地址和图片名
var
image
=
new
Image
();
// 解决跨域 Canvas 污染问题
image
.
setAttribute
(
"crossOrigin"
,
"anonymous"
);
image
.
onload
=
function
()
{
var
canvas
=
document
.
createElement
(
"canvas"
);
canvas
.
width
=
image
.
width
;
canvas
.
height
=
image
.
height
;
var
context
=
canvas
.
getContext
(
"2d"
);
context
.
drawImage
(
image
,
0
,
0
,
image
.
width
,
image
.
height
);
var
url
=
canvas
.
toDataURL
(
"image/png"
);
//得到图片的base64编码数据
var
a
=
document
.
createElement
(
"a"
);
// 生成一个a元素
var
event
=
new
MouseEvent
(
"click"
);
// 创建一个单击事件
a
.
download
=
name
||
"photo"
;
// 设置图片名称
a
.
href
=
url
;
// 将生成的URL设置为a.href属性
a
.
dispatchEvent
(
event
);
// 触发a的单击事件
};
image
.
src
=
imgsrc
;
}
export
default
util
\ No newline at end of file
src/views/guestGroup/add.vue
View file @
b773cd7
...
...
@@ -11,19 +11,59 @@
<span>
企业主体信息需要认证,才可使用该功能。
</span>
</div>
<el-form
:model=
"basicForm"
:rules=
"basicRules"
ref=
"basicForm"
label-width=
"124px"
>
<el-form-item
label=
"自定义群名"
prop=
"orgName"
>
<el-input
v-model=
"basicForm.groupName"
size=
"small"
placeholder=
"为群聊设个自定义组名,如“VIP服务群”"
maxlength=
"10"
></el-input>
<el-form-item
label=
"自定义群名"
prop=
"groupName"
>
<el-input
v-model=
"basicForm.groupName"
size=
"small"
placeholder=
"为群聊设个自定义组名,如“VIP服务群”"
maxlength=
"10"
></el-input>
</el-form-item>
<el-form-item
label=
"群聊命名规则"
prop=
"rule"
>
<el-radio-group
v-model=
"basicForm.rule"
>
<template
v-if=
"(rule, index) in nameRules"
>
<el-radio
:label=
"rule.id"
:key=
"index"
>
{{
rule
.
rule
}}
</el-radio>
</
template
>
<el-form-item
label=
"群聊命名规则"
prop=
"groupNameRule"
>
<el-radio-group
v-model=
"basicForm.groupNameRule"
style=
"line-height: 40px; font-size: 14px; max-width: 600px;"
>
<el-radio
v-for=
"(rule, index) in nameRules"
:label=
"rule.id"
:key=
"index"
>
{{
rule
.
rule
}}
<span
class=
"rule-tips"
>
{{
rule
.
tips
}}
</span></el-radio>
</el-radio-group>
<
div
class=
"form-tips"
>
群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”
</div
>
<
!--
<div
class=
"form-tips"
>
群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”
</div>
--
>
</el-form-item>
<el-form-item
prop=
"userList"
>
<label
slot=
"label"
class=
"required"
>
默认成员
</label>
<el-form-item
prop=
"followList"
>
<label
slot=
"label"
class=
"required"
>
跟进专员
</label>
<el-button
size=
"small"
@
click=
"openFollow"
>
<i
class=
"el-icon-plus"
></i>
选择跟进专员
</el-button>
<span
class=
"label-text"
>
已选择
<span>
{{
basicForm
.
followList
?
basicForm
.
followList
.
length
:
0
}}
</span>
人
</span>
<div
:key=
"key"
class=
"sale-select"
v-show=
"basicForm.followList.length"
>
<div
class=
"el-input-tag input-tag-wrapper"
>
<div
style=
"max-height: 64px"
>
<el-tag
v-for=
"(tag, idx) in basicForm.followList"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"removeFollow(idx)"
>
<i
class=
"el-icon-user-solid"
></i>
{{
tag
.
staffName
}}
</el-tag>
</div>
</div>
</div>
<!--
<div
class=
"form-tips"
>
必须配置至少1个跟进专员
</div>
-->
</el-form-item>
<el-form-item>
<label
slot=
"label"
>
默认成员
</label>
<el-button
size=
"small"
@
click=
"openMembers"
>
<i
class=
"el-icon-plus"
></i>
选择成员
...
...
@@ -33,17 +73,24 @@
<span>
{{
basicForm
.
userList
?
basicForm
.
userList
.
length
:
0
}}
</span>
人
</span>
<div
:key=
"key"
class=
"sale-select"
v-show=
"basicForm.userList"
>
<div
:key=
"key"
class=
"sale-select"
v-show=
"basicForm.userList
.length
"
>
<div
class=
"el-input-tag input-tag-wrapper"
>
<div
style=
"max-height: 64px"
>
<el-tag
v-for=
"(tag, idx) in basicForm.userList"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(tag, idx)"
>
<el-tag
v-for=
"(tag, idx) in basicForm.userList"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(tag, idx)"
>
<i
class=
"el-icon-user-solid"
></i>
{{
tag
.
staffName
}}
</el-tag>
</div>
</div>
</div>
<div
class=
"form-tips"
>
必须配置2个及以上成员
</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
...
...
@@ -72,102 +119,122 @@
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
</el-button>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
</div>
<basic-dialog
:title=
"'选择成员'"
:width=
"'712px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"handleClose"
>
<SelectMembers
v-if=
"membersVisible"
:key=
"key"
:selectData
.
sync=
"selectData"
ref=
"membersForm"
></SelectMembers>
</basic-dialog>
<basic-dialog
:title=
"'选择成员'"
:width=
"'1142px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"membersVisible = !membersVisible"
>
<!--
<SelectMembers
islord=
"false"
:selectData=
"selectData"
ref=
"membersForm"
></SelectMembers>
-->
<SelectMember
ref=
"membersForm"
v-if=
"membersVisible"
:selectData=
"selectData"
></SelectMember>
</basic-dialog>
<!--
<SelectMember
ref=
"membersForm"
></SelectMember>
-->
<select-follow
@
selectTable=
"selectTable"
ref=
"selectEmpForm"
></select-follow>
</div>
</
template
>
<
script
>
import
Vue
from
'vue'
// import WelcomeWords from './components/welcomeWords.vue'
import
SelectMembers
from
'./components/selectMembers.vue'
import
SelectMember
from
'./components/selectMember.vue'
import
SelectFollow
from
'./components/selectFollow.vue'
// import Preview from './components/preview.vue'
export
default
{
name
:
'guestGroupAdd'
,
components
:
{
// WelcomeWords,
SelectMembers
SelectMember
,
SelectFollow
// Preview
},
data
()
{
const
validatorUser
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
this
.
$route
.
params
.
id
)
{
if
(
this
.
$refs
.
membersForm
)
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
if
(
this
.
basicForm
.
userList
)
{
if
(
this
.
basicForm
.
userList
.
length
<
2
)
{
callback
(
new
Error
(
'至少配置2个及以上成员'
))
}
else
{
callback
()
}
console
.
log
(
this
.
basicForm
.
userList
)
const
followList
=
this
.
basicForm
.
followList
let
userList
=
[]
if
(
this
.
basicForm
.
userList
&&
this
.
basicForm
.
userList
.
length
)
{
userList
=
this
.
basicForm
.
followList
.
concat
(
this
.
basicForm
.
userList
)
}
else
{
callback
(
new
Error
(
'请选择默认成员'
))
userList
=
this
.
basicForm
.
followList
}
}
else
{
if
(
value
)
{
if
(
value
.
length
<
2
)
{
callback
(
new
Error
(
'至少配置2个及以上成员'
))
}
else
{
callback
()
}
console
.
log
(
userList
)
if
(
!
this
.
basicForm
.
followList
.
length
)
{
callback
(
new
Error
(
'请选择跟进专员'
))
}
else
{
callback
(
new
Error
(
'请选择默认成员'
))
}
}
}
const
nameVaild
=
(
rule
,
value
,
callback
)
=>
{
console
.
log
(
this
.
$route
.
params
.
id
)
if
(
value
)
{
const
params
=
{
templateName
:
value
}
let
api
=
'nameVaild'
if
(
this
.
$route
.
params
.
id
)
{
params
.
id
=
this
.
$route
.
params
.
id
api
=
'updateNameVaild'
}
this
.
$apis
.
groupGuest
[
api
](
params
).
then
(
res
=>
{
if
(
res
)
{
callback
(
new
Error
(
'群聊名称不可重复'
))
console
.
log
(
this
.
basicForm
.
followList
)
if
(
userList
.
length
<
2
)
{
this
.
$message
({
type
:
'error'
,
message
:
'必须配置2个及以上成员'
})
// callback(new Error('必须配置2个及以上成员'))
}
else
{
callback
()
}
})
}
}
}
// const nameVaild = (rule, value, callback) => {
// console.log(this.$route.params.id)
// if (value) {
// const params = {
// templateName: value
// }
// let api = 'nameVaild'
// if (this.$route.params.id) {
// params.id = this.$route.params.id
// api = 'updateNameVaild'
// }
// this.$apis.groupGuest[api](params).then(res => {
// if (res) {
// callback(new Error('群聊名称不可重复'))
// } else {
// callback()
// }
// })
// }
// }
return
{
eventBus
:
new
Vue
(),
basicForm
:
{},
basicForm
:
{
followList
:
[],
userList
:
[],
groupNameRule
:
1
},
nameRules
:
[
{
rule
:
'自定义群名'
,
rule
:
'车系+客户昵称+自定义群名'
,
tips
:
'(车系/客户昵称自动填充,例:“奥迪A6Carr_VIP服务群”)'
,
id
:
1
},
{
rule
:
'车系+客户昵称+自定义群名 (车系/客户昵称自动填充,例:“奥迪A6Carr_VIP服务群”)'
,
rule
:
'车系+车牌号+自定义群名'
,
tips
:
'(车系/客户昵称自动填充,例:“日产轩逸粤B·1V566_VIP服务群”)'
,
id
:
2
},
{
rule
:
'
车系+车牌号+自定义群名 (车系/客户昵称自动填充,例:“日产轩逸粤B·1V566_VIP服务群”)
'
,
id
:
3
}
rule
:
'
自定义群名
'
,
id
:
0
}
,
],
basicRules
:
{
orgName
:
[{
required
:
true
,
message
:
'请输入组名'
,
trigger
:
'change'
}],
groupName
:
[
{
required
:
true
,
message
:
'请输入群聊名称'
,
trigger
:
'change'
}
,
{
validator
:
nameVaild
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入群聊名称'
,
trigger
:
'change'
}
//
{ validator: nameVaild, trigger: 'blur' }
],
userList
:
[
groupNameRule
:
[{
required
:
true
,
message
:
'请选择群聊命名规则'
,
trigger
:
'change'
}],
followList
:
[
// { required: true, message: '请选择默认成员', trigger: 'change' },
{
validator
:
validatorUser
,
trigger
:
'
blur
'
}
{
validator
:
validatorUser
,
trigger
:
'
change
'
}
]
},
membersVisible
:
false
,
key
:
new
Date
(),
previewFlag
:
false
,
selectData
:
[],
editStatus
:
false
editStatus
:
false
,
// 跟进专员
followVisible
:
false
}
},
watch
:
{
...
...
@@ -176,7 +243,14 @@ export default {
this
.
editStatus
=
true
},
deep
:
true
}
},
// membersVisible(val) {
// console.log(val)
// if (!val) {
// this.$refs.membersForm.resetSearch()
// }
// }
},
mounted
()
{
if
(
this
.
$route
.
params
)
{
...
...
@@ -191,57 +265,59 @@ export default {
methods
:
{
openMembers
()
{
this
.
membersVisible
=
!
this
.
membersVisible
// if (this.membersVisible && this.$route.params.id) {
// this.$nextTick(() => {
// this.key = new Date()
// console.log(this.$refs.membersForm)
// this.$refs.membersForm.selectTable(this.basicForm.userList)
// if (this.basicForm.userList && this.basicForm.userList.length != 0) {
// this.basicForm.userList.map(item => {
// if (item.masterStatus == 1) {
// this.selectData = this.basicForm.userList
// }
// })
// }
// })
// }
},
openFollow
()
{
console
.
log
(
this
.
basicForm
.
followList
)
this
.
$refs
.
selectEmpForm
.
init
(
this
.
basicForm
.
followList
)
},
handleSubmit
()
{
// const previewList = this.$refs.welcome.previewList
console
.
log
(
this
.
basicForm
)
this
.
$refs
.
basicForm
.
validate
(
valid
=>
{
if
(
valid
)
{
const
params
=
{
// attachmentList: this.$refs.welcome.previewList,
orgName
:
this
.
basicForm
.
orgName
,
groupName
:
this
.
basicForm
.
groupName
const
params
=
{
groupName
:
this
.
basicForm
.
groupName
,
groupNameRule
:
this
.
basicForm
.
groupNameRule
}
const
followList
=
this
.
basicForm
.
followList
.
map
(
item
=>
{
return
{
staffId
:
item
.
staffId
,
staffName
:
item
.
staffName
,
follow
:
1
}
// if (this.$refs.welcome.previewList) params.attachmentList = this.$refs.welcome.previewList
params
.
userList
=
this
.
basicForm
.
userList
.
map
(
item
=>
{
})
let
memberList
=
[]
if
(
this
.
basicForm
.
userList
&&
this
.
basicForm
.
userList
.
map
.
length
)
{
memberList
=
this
.
basicForm
.
userList
.
map
(
i
=>
{
return
{
staffId
:
item
.
staffId
staffId
:
i
.
staffId
,
staffName
:
i
.
staffName
,
follow
:
0
}
})
let
apiName
=
'insert'
if
(
this
.
basicForm
.
id
)
{
apiName
=
'update'
params
.
id
=
this
.
basicForm
.
id
}
this
.
$apis
.
groupGuest
[
apiName
](
params
)
.
then
(
res
=>
{
if
(
res
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
})
this
.
$router
.
push
(
'/guestGroup/index'
)
}
})
.
catch
(
err
=>
{
}
params
.
userList
=
followList
.
concat
(
memberList
)
let
apiName
=
'insert'
if
(
this
.
basicForm
.
id
)
{
apiName
=
'update'
params
.
id
=
this
.
basicForm
.
id
}
console
.
log
(
params
)
this
.
$apis
.
groupGuest
[
apiName
](
params
)
.
then
(
res
=>
{
if
(
res
)
{
this
.
$message
({
type
:
'
error
'
,
message
:
err
.
message
type
:
'
success
'
,
message
:
'操作成功!'
})
this
.
$router
.
push
(
'/guestGroup/index'
)
}
})
.
catch
(
err
=>
{
this
.
$message
({
type
:
'error'
,
message
:
err
.
message
})
})
}
})
},
...
...
@@ -249,15 +325,18 @@ export default {
this
.
$apis
.
groupGuest
.
detail
({
id
}).
then
(
res
=>
{
if
(
res
)
{
this
.
basicForm
=
{
orgName
:
res
.
orgName
,
groupName
:
res
.
groupName
,
id
:
res
.
id
,
merchantId
:
1
,
userList
:
res
.
userList
// attachmentList: res.attachmentList
groupNameRule
:
res
.
groupNameRule
// userList: res.userList
}
if
(
res
.
userList
&&
res
.
userList
.
length
)
{
this
.
selectData
=
res
.
userList
.
filter
(
item
=>
item
.
follow
==
0
)
this
.
basicForm
.
userList
=
this
.
selectData
this
.
basicForm
.
followList
=
res
.
userList
.
filter
(
item
=>
item
.
follow
==
1
)
}
// this.$refs.welcome.updateList(res.attachmentList
)
this
.
selectData
=
res
.
userList
console
.
log
(
this
.
basicForm
)
//
this.selectData = res.userList
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
})
...
...
@@ -265,8 +344,6 @@ export default {
})
},
handleCancel
()
{
// this.$router.go(-1)
// this.$router.push({ path: '/guestGroup/index' })
if
(
this
.
editStatus
)
{
this
.
$confirm
(
'当前有内容信息未保存,是否继续返回?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
...
...
@@ -295,43 +372,23 @@ export default {
},
// 成员弹窗
handleConfirm
()
{
if
(
this
.
$refs
.
membersForm
.
innerTags
.
length
==
0
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请选择成员'
})
}
else
if
(
this
.
$refs
.
membersForm
.
innerTags
.
length
==
1
)
{
this
.
$message
({
type
:
'error'
,
message
:
'必须配置两个及以上成员'
})
}
else
{
// this.$refs.membersForm.resetSearch()
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
this
.
selectData
=
this
.
basicForm
.
userList
this
.
openMembers
()
}
},
handleClose
()
{
// this.openMembers()
// this.$refs.membersForm.resetSearch()
this
.
membersVisible
=
false
// if (this.$route.params.id) {
// this.$nextTick(() => {
// this.$refs.membersForm.selectTable(this.basicForm.userList)
// if (this.basicForm.userList && this.basicForm.userList.length != 0) {
// this.basicForm.userList.map(item => {
// if (item.masterStatus) {
// this.basicForm.group = item
// this.$refs.membersForm.group = item
// this.selectData = this.basicForm.userList
// }
// })
// }
// })
// } else {
// this.selectData = []
// }
},
selectTable
(
item
)
{
this
.
basicForm
.
followList
=
item
.
map
(
item
=>
{
return
{
staffId
:
item
.
id
,
staffName
:
item
.
staffName
}
})
},
removeFollow
(
idx
)
{
this
.
basicForm
.
followList
.
splice
(
idx
,
1
)
}
}
}
...
...
@@ -499,4 +556,13 @@ export default {
margin-right
:
8px
;
}
}
.rule-tips
{
font-size
:
14px
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
14px
;
}
.required
:before
{
margin-right
:
5px
;
}
</
style
>
src/views/guestGroup/components/selectFollow.vue
0 → 100644
View file @
b773cd7
<
template
>
<div
class=
"square-main"
v-loading=
"loading"
>
<el-dialog
title=
"选择跟进专员"
:visible
.
sync=
"dialogVisible"
width=
"50%"
:before-close=
"handleClose"
>
<el-form
:inline=
"true"
:model=
"tableSearchForm"
>
<el-form-item
size=
"small"
label=
"员工"
>
<el-input
v-model=
"tableSearchForm.staffName"
placeholder=
"请输入员工姓名"
></el-input>
</el-form-item>
<el-form-item
size=
"small"
>
<el-button
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</el-form-item>
</el-form>
<div
class=
"table-box"
>
<GLTable
v-if=
"dialogVisible"
ref=
"table"
:layout=
"layout"
:tableData=
"tableData"
:hasNum=
"false"
:tableTotal=
"tableTotal"
:pageConf=
"pageConf"
:tableParams=
"tableParams"
@
refreshTable=
"handleSearch"
@
selectionTable=
"selectionTable"
@
row-click=
"rowClick"
></GLTable>
<div
class=
"form-tips"
>
必须配置至少1个跟进专员
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<a
class=
"dialog-jump"
@
click=
"jumpUrl"
>
新增专员
</a>
<el-button
size=
"small"
@
click=
"handleCancel"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click
.
native=
"handleSelect"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
utils
}
from
'glsx-common'
import
util
from
'@/utils/util'
export
default
{
name
:
'SelectFollow'
,
data
()
{
return
{
loading
:
false
,
dialogVisible
:
false
,
tableSearchForm
:
{},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
tableParams
:
{
listName
:
'data'
,
tableOption
:
false
,
// 行数据的key
mutiSelectUniqueKey
:
'id'
,
// 多选ref的名称
mutiSelectName
:
'salelist'
,
tableColumns
:
[
{
label
:
'姓名'
,
prop
:
'staffName'
},
{
label
:
'部门'
,
prop
:
'departmentName'
},
{
label
:
'跟进专员类型'
,
prop
:
'followerTypeName'
}
]
},
layout
:
''
,
tableData
:
[],
tableTotal
:
0
,
selectItem
:
[],
selectEmp
:
[]
}
},
methods
:
{
jumpUrl
()
{
util
.
openUrl
(
location
.
origin
+
'/home/followUp/index'
)
},
getFollower
()
{
var
params
=
{
...
JSON
.
parse
(
JSON
.
stringify
(
this
.
tableSearchForm
)),
pageSize
:
this
.
$refs
.
table
.
page
.
pageSize
,
pageNum
:
this
.
$refs
.
table
.
page
.
pageNum
}
this
.
$apis
.
groupGuest
.
getFollower
(
params
).
then
(
res
=>
{
this
.
tableData
=
res
.
data
this
.
tableTotal
=
res
.
count
if
(
res
.
count
>
10
)
{
this
.
layout
=
'pager'
}
this
.
tableData
.
forEach
(
item
=>
{
this
.
selectEmp
.
forEach
((
itm
,
index
)
=>
{
if
(
itm
.
staffId
==
item
.
relationId
)
{
this
.
$refs
.
table
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
item
)
this
.
selectEmp
.
splice
(
index
,
1
)
}
})
})
})
},
init
(
item
)
{
this
.
tableSearchForm
=
{}
this
.
selectEmp
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
this
.
dialogVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
.
table
.
page
.
pageNum
=
1
this
.
getFollower
()
})
},
handleSearch
()
{
this
.
getFollower
()
},
selectionTable
(
val
)
{
this
.
selectItem
=
val
},
handleClose
()
{
this
.
handleCancel
()
},
rowClick
(
row
)
{
this
.
$refs
.
table
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
},
handleCancel
:
utils
.
debounce
(
function
()
{
this
.
dialogVisible
=
false
this
.
$refs
.
table
.
$refs
.
salelistMutiTable
.
clearSelection
()
},
300
),
handleSelect
:
utils
.
debounce
(
function
()
{
this
.
loading
=
true
let
selectEmp
=
this
.
selectEmp
.
map
(
item
=>
{
return
{
relationId
:
item
.
staffId
,
staffName
:
item
.
staffName
}
})
const
selectItem
=
this
.
selectItem
.
concat
(
selectEmp
)
if
(
selectItem
.
length
==
0
)
{
this
.
$message
.
error
(
'请选择员工'
)
return
}
this
.
loading
=
false
this
.
dialogVisible
=
false
this
.
$emit
(
'selectTable'
,
this
.
selectItem
.
concat
(
selectEmp
))
this
.
$refs
.
table
.
$refs
.
salelistMutiTable
.
clearSelection
()
},
300
)
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.dialog-jump
{
color
:
#5850FF
;
float
:
left
;
line-height
:
24px
;
text-decoration
:
underline
;
cursor
:
pointer
;
}
.square-main
{
/deep/
{
.el-table
{
height
:
40vh
;
overflow-y
:
auto
;
}
.el-table
::before
{
left
:
0
;
bottom
:
0
;
width
:
100%
;
height
:
0px
;
}
}
}
.form-tips
{
position
:
absolute
;
bottom
:
0
;
right
:
0
;
font-size
:
12px
;
color
:
#999
;
line-height
:
32px
;
}
.table-box
{
position
:
relative
;
}
</
style
>
\ No newline at end of file
src/views/guestGroup/components/selectMember.vue
0 → 100644
View file @
b773cd7
<
template
>
<div
class=
"member-wrapper"
>
<div
class=
"member-left"
>
<div
class=
"member-title"
>
预选
<span>
仅筛选有外部客户联系人的成员
</span>
</div>
<div
class=
"member-content"
>
<el-form
:inline=
"true"
class=
"member-form"
:model=
"searchForm"
@
submit
.
native
.
prevent
>
<el-form-item
label=
"所在门店/部门"
style=
"margin-bottom: 0;"
>
<el-popover
ref=
"popover"
placement=
"bottom"
width=
"215"
trigger=
"click"
v-model=
"popoverVisible"
@
show=
"onShowPopover"
@
hide=
"onHidePopover"
>
<el-tree
class=
"select-tree"
:data=
"treeData"
:props=
"defaultProps"
default-expand-all
@
node-click=
"handleNodeClick"
></el-tree>
<el-input
v-model=
"searchForm.department"
slot=
"reference"
:size=
"size"
readonly
placeholder=
"请选择所在门店/部门"
:class=
"
{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
@keyup.enter.native="search"
>
</el-input>
</el-popover>
</el-form-item>
<el-form-item
label=
"姓名"
style=
"margin-bottom: 0;"
>
<el-input
:size=
"size"
v-model
.
trim=
"searchForm.name"
@
keyup
.
enter
.
native=
"search"
clearable
placeholder=
"请输入姓名搜索"
></el-input>
</el-form-item>
<!--
<el-form-item>
<el-checkbox
v-model=
"searchForm.checked"
>
仅看跟进专员
</el-checkbox>
</el-form-item>
-->
<el-form-item
style=
"margin-bottom: 0;"
>
<el-button
type=
"primary"
:size=
"size"
@
click=
"search"
>
查询
</el-button>
</el-form-item>
</el-form>
<div
class=
"table-content"
>
<GLTable
v-loading=
"loading"
ref=
"empTable"
:tableData=
"tableEmpData"
:tableParams=
"tableParams"
:hasNum=
"false"
:hasPage=
"false"
:noDataImg=
"url"
@
selectionTable=
"selectionTable"
@
row-click=
"rowClick"
>
<div
slot=
"staffName"
slot-scope=
"scope"
>
<span>
{{
scope
.
scope
.
staffName
}}
</span>
<span
class=
"staff-title"
v-show=
"scope.scope.staffTitle"
>
{{
scope
.
scope
.
staffTitle
}}
</span>
</div>
</GLTable>
</div>
</div>
<!--
<div
class=
"member-checked"
>
<el-checkbox
v-model=
"searchForm.checked"
>
仅看跟进专员
</el-checkbox>
</div>
-->
</div>
<div
class=
"member-right"
>
<div
class=
"member-title"
>
已选
</div>
<div
class=
"member-name"
>
成员名称(
{{
innerTags
.
length
}}
项)
</div>
<div
class=
"input-tag-wrapper"
>
<div
class=
"tag-box"
>
<el-tag
v-for=
"(tag, idx) in innerTags"
:key=
"idx"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(tag)"
>
<i
class=
"el-icon-user-solid"
></i>
{{
tag
.
staffName
}}
</el-tag>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
url
from
"@/assets/empty.png"
export
default
{
name
:
'SelectMember'
,
props
:
[
'selectData'
],
data
()
{
return
{
url
:
url
,
searchForm
:
{},
treeData
:
[],
defaultProps
:
{
children
:
'children'
,
label
:
'departmentName'
},
popoverVisible
:
false
,
loading
:
false
,
// 表格参数
tableParams
:
{
checkSelectKey
:
'id'
,
checkSelectVal
:
[],
listName
:
'list'
,
// 行数据的key
mutiSelectUniqueKey
:
'id'
,
// 多选ref的名称
mutiSelectName
:
'salelist'
,
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
tableColumns
:
[
{
label
:
'姓名'
,
prop
:
'staffName'
,
addHtml
:
'staffName'
},
{
label
:
'所在门店/部门'
,
prop
:
'departmentName'
}
]
},
tableEmpData
:
[],
allTreeData
:
[],
currentTreeData
:
[],
innerTags
:
[]
}
},
mounted
()
{
this
.
listDepartmentTree
()
},
methods
:
{
selectionTable
(
val
)
{
console
.
log
(
val
)
this
.
innerTags
=
val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch
()
{
this
.
searchForm
=
{}
this
.
tableEmpData
=
this
.
allTreeData
},
// 显示时触发
onShowPopover
()
{
this
.
popoverVisible
=
true
},
// 隐藏时触发
onHidePopover
()
{
this
.
popoverVisible
=
false
},
listDepartmentTree
()
{
const
params
=
{
addChildrensFlag
:
true
}
if
(
this
.
islord
)
{
// 是否群主
params
.
islord
=
this
.
islord
}
this
.
loading
=
true
console
.
log
(
this
.
selectData
)
// params.isHavCustomer = true
this
.
$apis
.
groupGuest
.
listDepartmentTree
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
loading
=
false
if
(
res
)
{
this
.
tableEmpData
=
this
.
getEmployee
(
res
)
this
.
allTreeData
=
this
.
getEmployee
(
res
)
this
.
currentTreeData
=
this
.
getEmployee
(
res
)
this
.
treeData
=
res
this
.
tableEmpData
.
length
?
(
this
.
$refs
.
empTable
.
tableHeightValues
=
'250px'
)
:
this
.
$refs
.
empTable
.
setTableHeightFun
()
if
(
this
.
selectData
&&
this
.
selectData
.
length
)
{
this
.
selectData
.
forEach
(
item
=>
{
this
.
$refs
.
empTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
item
)
})
}
}
else
{
this
.
treeData
=
[]
}
})
},
handleNodeClick
(
data
)
{
console
.
log
(
data
)
this
.
searchForm
.
department
=
data
.
departmentName
this
.
currentTreeData
=
data
this
.
onHidePopover
()
},
getEmployee
(
d
,
arr
=
[])
{
d
.
reverse
().
forEach
(
i
=>
{
if
(
i
.
entmicroStaffResponses
)
{
i
.
entmicroStaffResponses
.
forEach
(
j
=>
{
const
flag
=
arr
.
find
(
m
=>
m
.
id
==
j
.
id
)
if
(
!
flag
)
{
arr
.
push
(
j
)
}
})
}
if
(
i
.
children
)
{
this
.
getEmployee
(
i
.
children
,
arr
)
}
})
return
arr
},
search
()
{
this
.
tableEmpData
=
[]
const
data
=
this
.
currentTreeData
const
keyword
=
this
.
searchForm
.
name
let
arr
=
[]
// this.loading = true
console
.
log
(
keyword
,
data
,
this
.
tableEmpData
)
if
(
data
instanceof
Array
)
{
data
.
forEach
(
i
=>
{
if
(
i
.
staffName
.
indexOf
(
keyword
)
!=
-
1
)
{
this
.
tableEmpData
.
push
(
i
)
}
})
}
else
if
(
data
instanceof
Object
)
{
if
(
data
.
entmicroStaffResponses
)
{
if
(
keyword
)
{
data
.
entmicroStaffResponses
.
forEach
(
i
=>
{
if
(
i
.
staffName
.
indexOf
(
keyword
)
!=
-
1
)
{
this
.
tableEmpData
.
push
(
i
)
}
})
}
else
{
this
.
tableEmpData
=
this
.
tableEmpData
.
concat
(
data
.
entmicroStaffResponses
)
}
}
if
(
data
.
children
)
{
data
.
children
.
forEach
(
i
=>
{
if
(
i
.
entmicroStaffResponses
)
{
i
.
entmicroStaffResponses
.
forEach
(
j
=>
{
if
(
keyword
)
{
if
(
j
.
staffName
.
indexOf
(
keyword
)
!=
-
1
)
{
const
flag
=
this
.
tableEmpData
.
find
(
m
=>
m
.
id
==
j
.
id
)
if
(
!
flag
)
{
this
.
tableEmpData
.
push
(
j
)
}
}
}
else
{
const
flag
=
this
.
tableEmpData
.
find
(
m
=>
m
.
id
==
j
.
id
)
if
(
!
flag
)
{
this
.
tableEmpData
.
push
(
j
)
}
}
})
}
})
}
}
},
remove
(
item
)
{
this
.
$refs
.
empTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
item
)
},
rowClick
(
row
)
{
this
.
$refs
.
empTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
.el-input.el-input--suffix.rotate
.el-input__suffix
.el-icon-arrow-down
{
transform
:
rotate
(
-180deg
);
}
.select-tree
{
max-height
:
400px
;
overflow-y
:
scroll
;
}
.staff-title
{
position
:
relative
;
font-size
:
12px
;
padding
:
0
10px
;
line-height
:
12px
;
color
:
#999
;
&::before
{
content
:
''
;
position
:
absolute
;
top
:
50%
;
left
:
5px
;
transform
:
translateY
(
-50%
);
display
:
inline-block
;
width
:
1px
;
height
:
12px
;
background-color
:
#999
;
}
}
.member-wrapper
{
display
:
flex
;
.member-title
{
font-size
:
16px
;
font-weight
:
500
;
line-height
:
22px
;
margin-bottom
:
6px
;
span
{
display
:
inline-block
;
padding-left
:
5px
;
font-size
:
12px
;
color
:
#999
;
}
}
.member-left
{
width
:
800px
;
.member-content
{
border
:
1px
solid
#eee
;
.member-form
{
padding
:
10px
20px
;
}
.table-content
{
max-height
:
456px
;
overflow
:
auto
;
border
:
1px
solid
#eee
;
}
}
.member-checked
{
text-align
:
right
;
margin-top
:
10px
;
}
}
.member-right
{
width
:
286px
;
margin-left
:
14px
;
.member-name
{
font-size
:
14px
;
color
:
#333
;
line-height
:
20px
;
padding
:
18px
;
border
:
1px
solid
#eee
;
}
}
}
.tag-box
{
height
:
100%
;
}
.input-tag-wrapper
{
position
:
relative
;
font-size
:
14px
;
border
:
1px
solid
#eee
;
border-top
:
none
;
box-sizing
:
border-box
;
color
:
#606266
;
display
:
inline-block
;
padding
:
8px
10px
;
line-height
:
32px
;
transition
:
border-color
0.2s
cubic-bezier
(
0.645
,
0.045
,
0.355
,
1
);
width
:
100%
;
height
:
calc
(
100%
-
86px
);
display
:
flex
;
align-items
:
center
;
max-height
:
500px
;
overflow
:
auto
;
//
margin-bottom
:
10px
;
i
{
color
:
#75acff
;
margin-right
:
3px
;
font-size
:
14px
;
}
/
deep
/
input
{
/* input { */
/* background-color: red!important; 调试用的样式 */
outline
:
none
!important
;
border
:
none
!important
;
}
/
deep
/
.el-input
{
min-width
:
150px
;
width
:
auto
;
flex
:
1
;
}
}
.el-tag
{
margin-right
:
10px
;
line-height
:
22px
;
margin-bottom
:
5px
;
height
:
24px
;
}
</
style
>
src/views/guestGroup/components/selectMembers.vue
View file @
b773cd7
...
...
@@ -102,11 +102,7 @@ export default {
this
.
innerTags
.
forEach
(
item
=>
{
userIds
.
push
(
item
.
userId
)
})
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
}
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted
()
{}
}
...
...
src/views/guestGroup/detail.vue
View file @
b773cd7
...
...
@@ -11,14 +11,13 @@
<img
src=
"@/assets/guestCustom/chat-logo.png"
alt=
""
/>
</div>
<div
class=
"group-name-info"
>
<div>
初始群聊名称
</div>
<div
class=
"group-name-info-count"
>
13
人
</div>
<div>
{{
groupInfo
.
groupName
}}
</div>
<div
class=
"group-name-info-count"
>
{{
groupInfo
.
userList
?
groupInfo
.
userList
.
length
:
0
}}
人
</div>
</div>
</div>
<div
class=
"text-info"
>
已建群数量:
<span
class=
"group-number"
>
13
</span>
个群组
<span
class=
"group-number"
>
{{
groupInfo
.
groupCount
}}
</span>
</div>
</div>
</div>
...
...
@@ -30,27 +29,38 @@
<div
class=
"commissioner"
>
<div
class=
"text-info"
>
跟进专员:
</div>
<div
class=
"entmicro"
>
<div
class=
"entmicro-tag"
v-for=
"(tag, idx) in
userList"
:key=
"idx
"
>
<el-tag
type=
"info"
v-if=
"idx
<
9
"
:disable-transitions=
"false"
>
<div
class=
"entmicro-tag"
v-for=
"(tag, idx) in
followList"
:key=
"tag.id
"
>
<el-tag
type=
"info"
v-if=
"idx
<
6
"
:disable-transitions=
"false"
>
<i
class=
"el-icon-user-solid"
></i>
{{
tag
.
staffName
}}{{
tag
.
departmentName
?
`(${tag.departmentName
}
)`
:
''
}}
<
/el-tag
>
<
el
-
tag
type
=
"info"
v
-
if
=
"followList.length > 6 && idx == 6"
>
<
el
-
popover
placement
=
"top"
width
=
"600"
trigger
=
"hover"
>
<
span
slot
=
"reference"
>
...({{
followList
.
length
}}
)
<
/span
>
<
div
class
=
"entmicro-hover"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(i, index) in followList"
:
key
=
"index"
:
disable
-
transitions
=
"false"
>
<
i
class
=
"el-icon-user-solid"
><
/i
>
{{
i
.
staffName
}}
{{
i
.
departmentName
?
`(${i.departmentName
}
)`
:
''
}}
<
/el-tag
>
<
/div
>
<
/el-popover
>
<
/el-tag
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"commissioner"
>
<
div
class
=
"text-info"
>
入群成员:
<
/div
>
<
div
class
=
"entmicro"
>
<
div
class
=
"entmicro-tag"
v
-
for
=
"(tag, idx) in
userList"
:
key
=
"idx
"
>
<
el
-
tag
type
=
"info"
v
-
if
=
"idx <
9
"
:
disable
-
transitions
=
"false"
>
<
div
class
=
"entmicro-tag"
v
-
for
=
"(tag, idx) in
memberList"
:
key
=
"tag.id
"
>
<
el
-
tag
type
=
"info"
v
-
if
=
"idx <
6
"
:
disable
-
transitions
=
"false"
>
<
i
class
=
"el-icon-user-solid"
><
/i
>
{{
tag
.
staffName
}}
{{
tag
.
departmentName
?
`(${tag.departmentName
}
)`
:
''
}}
<
/el-tag
>
<
el
-
tag
type
=
"info"
v
-
if
=
"
userList.length > 9 && idx == 9
"
>
<
el
-
popover
placement
=
"top"
width
=
"600"
trigger
=
"hover"
content
=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<
span
slot
=
"reference"
>
...({{
us
erList
.
length
}}
)
<
/span
>
<
el
-
tag
type
=
"info"
v
-
if
=
"
memberList.length > 6 && idx == 6
"
>
<
el
-
popover
placement
=
"top"
width
=
"600"
trigger
=
"hover"
>
<
span
slot
=
"reference"
>
...({{
memb
erList
.
length
}}
)
<
/span
>
<
div
class
=
"entmicro-hover"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(i, index) in
us
erList"
:
key
=
"index"
:
disable
-
transitions
=
"false"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(i, index) in
memb
erList"
:
key
=
"index"
:
disable
-
transitions
=
"false"
>
<
i
class
=
"el-icon-user-solid"
><
/i
>
{{
i
.
staffName
}}
{{
i
.
departmentName
?
`(${i.departmentName
}
)`
:
''
}}
<
/el-tag
>
...
...
@@ -70,39 +80,56 @@
<
i
class
=
"el-icon-refresh"
><
/i
>
更新数据
<
/div
>
<
div
class
=
"text-info"
>
更新于:
2021
-
12
-
27
14
:
47
<
/div
>
<
div
class
=
"text-info"
>
更新于:
{{
currentTime
}}
<
/div
>
<
/div
>
<
GLTable
class
=
"table"
@
setTableFinishFun
=
"setTableFinishFun
"
ref
=
"groupDetail"
:
hasNum
=
"false"
:
getListApi
=
"getListApi"
:
beforeSearchFn
=
"beforeSearchFn"
:
noDataImg
=
"url"
:
pageConf
=
"pageConf"
:
tableParams
=
"tableParams"
:
tableData
=
"tableData"
>
<
GLTable
class
=
"table"
:
searchForm
=
"searchForm
"
ref
=
"groupDetail"
:
hasNum
=
"false"
:
getListApi
=
"getListApi"
:
beforeSearchFn
=
"beforeSearchFn"
:
noDataImg
=
"url"
:
pageConf
=
"pageConf"
:
tableParams
=
"tableParams"
:
tableData
=
"tableData"
>
<
span
slot
=
"customerName"
slot
-
scope
=
"scope"
>
<
div
class
=
"customer"
>
<
div
class
=
"customer-img"
>
<
!--
<
div
class
=
"customer-img"
>
<
img
src
=
"@/assets/guestCustom/chat-logo.png"
alt
=
""
/>
<
/div
>
<
/div>
--
>
<
div
class
=
"customer-name"
>
{{
scope
.
scope
.
customerName
}}
<
label
class
=
"origin"
>
{{
scope
.
scope
.
type
==
1
?
'@微信'
:
'@企微'
}}
<
/label
>
<
label
class
=
"origin"
>
{{
WECHANT_TYPE
[
scope
.
scope
.
type
]
}}
<
/label
>
<
/div
>
<
/div
>
<
/span
>
<
div
slot
=
"groupOwner"
slot
-
scope
=
"scope"
>
<
el
-
tag
type
=
"info"
:
disable
-
transitions
=
"false"
>
<
i
class
=
"el-icon-user-solid"
><
/i
>
{{
scope
.
scope
.
createdBy
}}
{{
scope
.
scope
.
departmentName
?
`(${scope.scope.departmentName
}
)`
:
''
}}
{{
scope
.
scope
.
lordName
}}
{{
scope
.
scope
.
departmentName
?
`(${scope.scope.departmentName
}
)`
:
''
}}
<
/el-tag
>
<
/div
>
<
span
slot
=
"status"
slot
-
scope
=
"scope"
>
<
span
class
=
"statusText"
:
class
=
"
{
'red-text'
:
scope
.
scope
.
status
===
'2'
}"
>
{{
scope
.
scope
.
status
==
'1
'
?
'使用'
:
'解散于'
}}
<
/span
>
<
span
v
-
if
=
"scope.scope.
status === '2
'"
class
=
"gray-text"
>
{{
scope
.
scope
.
cancelTime
}}
<
/span
>
<
span
slot
=
"status"
class
=
"table-status"
slot
-
scope
=
"scope"
>
<
span
class
=
"statusText"
:
class
=
"
{
'red-text'
:
scope
.
scope
.
delFlag
===
'-1'
}"
>
{{
scope
.
scope
.
delFlag
==
'0
'
?
'使用'
:
'解散于'
}}
<
/span
>
<
span
v
-
if
=
"scope.scope.
delFlag === '-1
'"
class
=
"gray-text"
>
{{
scope
.
scope
.
cancelTime
}}
<
/span
>
<
/span
>
<
/GLTable
>
<
/div
>
<
div
class
=
"footer-panel"
:
style
=
"
{
left
:
footerLeft
+
'px'
,
width
:
footerWidth
+
'px'
}
"
>
<el-button @click="
handleCancel
"
>
取消
<
/el-button
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
const
WECHANT_TYPE
=
{
1
:
'@微信'
,
2
:
'@企微'
}
import
*
as
dayjs
from
'dayjs'
export
default
{
name
:
'guestGroupDetail'
,
data
()
{
return
{
// getListApi: this.$apis.groupGuest.getListApi,
WECHANT_TYPE
:
WECHANT_TYPE
,
searchForm
:
{
}
,
// getListApi: this.$apis.groupGuest.customerList,
tableData
:
[
{
id
:
1
,
...
...
@@ -110,9 +137,9 @@ export default {
type
:
1
,
//1微信2企微
orgName
:
'守候专用服务一组'
,
createdTime
:
'2021-06-26 09:00:00 '
,
status
:
'1'
,
//1使用 2
停用
delFlag
:
'0'
,
//0使用 -1
停用
groupName
:
'三人干饭小组'
,
createdBy
:
'刘益玲'
,
lordName
:
'刘益玲'
,
departmentName
:
'财务管理中心'
}
,
{
...
...
@@ -122,9 +149,9 @@ export default {
orgName
:
'守候专用服务一组'
,
createdTime
:
'2021-06-26 09:00:00'
,
cancelTime
:
'2021年7月22日'
,
status
:
'2'
,
//1使用 2
停用
delFlag
:
'-1'
,
//0使用 -1
停用
groupName
:
'三人干饭小组'
,
createdBy
:
'刘益玲(财务管理中心)
'
lordName
:
'刘益玲
'
}
],
tableParams
:
{
...
...
@@ -145,20 +172,20 @@ export default {
{
label
:
'现群名称'
,
prop
:
'groupName'
,
width
:
240
align
:
'left'
}
,
{
label
:
'现群主'
,
prop
:
'createdBy'
,
minWidth
:
'180px'
,
addHtml
:
'groupOwner'
addHtml
:
'groupOwner'
,
align
:
'left'
}
,
{
label
:
'状态'
,
prop
:
'status'
,
width
:
'180px
'
,
a
ddHtml
:
'status
'
addHtml
:
'status
'
,
a
lign
:
'left
'
}
]
}
,
...
...
@@ -172,7 +199,8 @@ export default {
userId
:
'GL1029'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1111
,
...
...
@@ -182,7 +210,8 @@ export default {
userId
:
'GL0667'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1112
,
...
...
@@ -192,7 +221,8 @@ export default {
userId
:
'GL0376'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
1
}
,
{
id
:
1113
,
...
...
@@ -202,7 +232,8 @@ export default {
userId
:
'GL1388'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1114
,
...
...
@@ -212,7 +243,8 @@ export default {
userId
:
'GL0778'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1115
,
...
...
@@ -222,7 +254,8 @@ export default {
userId
:
'GL0640'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1116
,
...
...
@@ -232,7 +265,8 @@ export default {
userId
:
'GL1485'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1117
,
...
...
@@ -242,7 +276,8 @@ export default {
userId
:
'524'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
1
}
,
{
id
:
1118
,
...
...
@@ -252,7 +287,8 @@ export default {
userId
:
'GL1678'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1119
,
...
...
@@ -262,7 +298,8 @@ export default {
userId
:
'GL1744'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1120
,
...
...
@@ -272,7 +309,8 @@ export default {
userId
:
'GL1759'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1121
,
...
...
@@ -282,7 +320,8 @@ export default {
userId
:
'test001'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1122
,
...
...
@@ -292,17 +331,8 @@ export default {
userId
:
'GL1775'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
}
,
{
id
:
1123
,
templateId
:
87
,
staffId
:
26196
,
staffName
:
'黄嘉泰'
,
userId
:
'GL1775'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1124
,
...
...
@@ -312,7 +342,8 @@ export default {
userId
:
'GL1744'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
1
}
,
{
id
:
1125
,
...
...
@@ -322,7 +353,8 @@ export default {
userId
:
'GL0667'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
,
{
id
:
1126
,
...
...
@@ -332,30 +364,69 @@ export default {
userId
:
'GL1485'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
}
,
{
id
:
1127
,
templateId
:
87
,
staffId
:
26255
,
staffName
:
'胡庚美'
,
userId
:
'GL0376'
,
departmentName
:
null
,
masterStatus
:
null
,
delFlag
:
0
delFlag
:
0
,
follow
:
0
}
]
],
userId
:
''
,
groupInfo
:
{
}
,
followList
:
[],
memberList
:
[],
currentTime
:
''
}
}
,
created
()
{
console
.
log
(
this
.
$route
.
params
.
id
)
this
.
userId
=
this
.
$route
.
params
.
id
this
.
getGroupList
(
this
.
$route
.
params
.
id
)
}
,
mounted
()
{
let
clientHeight
=
document
.
documentElement
.
clientHeight
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
boxHeight
=
clientHeight
-
200
}
,
methods
:
{
//更新数据
refreshData
()
{
this
.
$refs
.
groupDetail
.
refreshTable
()
this
.
$set
(
this
,
'currentTime'
,
dayjs
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss'
))
}
,
setTableFinishFun
()
{
if
(
this
.
$refs
.
groupDetail
.
data
&&
!
this
.
$refs
.
groupDetail
.
data
.
length
)
{
this
.
$refs
.
groupDetail
.
setTableHeightFun
()
}
}
,
getGroupList
(
id
)
{
// const id = this.userId
this
.
$apis
.
groupGuest
.
getListApi
({
id
}
).
then
(
res
=>
{
if
(
res
)
{
this
.
followList
=
[]
this
.
memberList
=
[]
this
.
currentTime
=
dayjs
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss'
)
this
.
groupInfo
=
res
if
(
res
.
userList
&&
res
.
userList
.
length
)
{
res
.
userList
.
forEach
(
item
=>
{
if
(
item
.
follow
==
1
)
{
this
.
followList
.
push
(
item
)
}
else
{
this
.
memberList
.
push
(
item
)
}
}
)
}
}
}
)
}
,
handleCancel
()
{
this
.
$router
.
push
(
'/guestGroup/index'
)
}
,
beforeSearchFn
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
searchForm
=
{
templateId
:
this
.
userId
}
resolve
()
}
)
}
}
}
...
...
@@ -464,6 +535,7 @@ export default {
&
.
updata
{
color
:
#
5850
ff
;
margin
:
0
10
px
0
20
px
;
cursor
:
pointer
;
i
.
el
-
icon
-
refresh
{
font
-
size
:
14
px
;
color
:
#
5850
ff
;
...
...
@@ -527,4 +599,20 @@ i {
color
:
#
666666
;
padding
:
0
6
px
!
important
;
}
.
table
-
status
{
display
:
flex
;
align
-
items
:
center
;
}
.
footer
-
panel
{
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
center
;
position
:
fixed
;
bottom
:
0
px
;
height
:
64
px
;
width
:
100
%
;
background
:
#
ffffff
;
box
-
shadow
:
0
px
-
1
px
1
px
0
px
rgba
(
88
,
80
,
255
,
0.1
);
}
<
/style>
\ No newline at end of file
src/views/guestGroup/index.vue
View file @
b773cd7
<
template
>
<div
class=
"scrm-sub-client-container"
>
<div
class=
"btn-header"
>
<
!--
<el-button
class=
"addBtn"
@
click=
"btnClick('create')"
>
新建群组
</el-button>
--
>
<
el-button
class=
"addBtn"
@
click=
"btnClick('create')"
>
新建群组
</el-button
>
<GLButton
class=
"addBtn"
@
click=
"btnClick('create')"
fn=
"新建群组"
>
新建群组
</GLButton>
<span
class=
"toptips"
>
<span>
配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。
</span>
...
...
@@ -9,13 +9,25 @@
</div>
<div
class=
"container"
>
<search-form
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formList=
"searchFormData"
>
<search-form
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formList=
"searchFormData"
>
<span
class=
"inline-b"
style=
"float: right"
slot=
"form-slot"
>
<el-button
type=
"primary"
@
click=
"searchTable"
>
查询
</el-button>
</span>
</search-form>
<!-- 表格区域 开始 -->
<GLTable
ref=
"gueastGroup"
@
setTableFinishFun=
"setTableFinishFun"
:noDataImg=
"url"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<GLTable
ref=
"gueastGroup"
@
setTableFinishFun=
"setTableFinishFun"
:noDataImg=
"url"
:getListApi=
"getListApi"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<div
slot=
"entmicro-name"
class=
"entmicro"
slot-scope=
"scope"
>
<!--
<span
v-for=
"(i, index) in scope.scope.userList"
:key=
"index"
>
{{
i
.
staffName
}}{{
i
.
departmentName
?
`(${i.departmentName
}
)`
:
''
}}
...
...
@@ -29,10 +41,20 @@
{{
tag
.
staffName
}}
{{
tag
.
departmentName
?
`(${tag.departmentName
}
)`
:
''
}}
<
/el-tag
>
<
el
-
tag
type
=
"info"
v
-
if
=
"scope.scope.userList.length > 9 && idx == 9"
>
<
el
-
popover
placement
=
"top"
width
=
"600"
trigger
=
"hover"
content
=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<
el
-
popover
placement
=
"top"
width
=
"600"
trigger
=
"hover"
content
=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<
span
slot
=
"reference"
>
...({{
scope
.
scope
.
userList
.
length
}}
)
<
/span
>
<
div
class
=
"entmicro-hover"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(i, index) in scope.scope.userList"
:
key
=
"index"
:
disable
-
transitions
=
"false"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(i, index) in scope.scope.userList"
:
key
=
"index"
:
disable
-
transitions
=
"false"
>
<
i
class
=
"el-icon-user-solid"
><
/i
>
{{
i
.
staffName
}}
{{
i
.
departmentName
?
`(${i.departmentName
}
)`
:
''
}}
<
/el-tag
>
...
...
@@ -42,17 +64,25 @@
<
/div
>
<
/div
>
<
span
slot
=
"status"
slot
-
scope
=
"scope"
>
<
span
class
=
"statusText"
:
class
=
"
{
'red-text'
:
scope
.
scope
.
status
===
'2'
,
'green-text'
:
scope
.
scope
.
status
===
'1'
}"
>
{{
scope
.
scope
.
status
==
'1'
?
'启用'
:
'停用'
}}
<
/span
>
<
span
class
=
"statusText"
:
class
=
"
{
'red-text'
:
scope
.
scope
.
status
===
'2'
,
'green-text'
:
scope
.
scope
.
status
===
'1'
}"
>
{{
scope
.
scope
.
status
==
'1'
?
'启用'
:
'停用'
}}
<
/span
>
<
/span
>
<
div
class
=
"table-btns"
slot
=
"optionBtns"
slot
-
scope
=
"scope"
>
<!--
<
el
-
button
type
=
"text"
@
click
=
"btnClick('edit', scope.scope)"
>
修改
<
/el-button> --
>
<
el
-
button
type
=
"text"
@
click
=
"btnClick('edit', scope.scope)"
>
修改
<
/el-button
>
<
el
-
button
type
=
"text"
@
click
=
"btnClick('detail', scope.scope)"
>
查看详情
<
/el-button
>
<
GLButton
type
=
"text"
@
click
=
"btnClick('detail', scope.scope)"
fn
=
"客户群详情"
>
查看详情
<
/GLButton
>
<
GLButton
type
=
"text"
@
click
=
"btnClick('edit', scope.scope)"
fn
=
"修改群组"
>
修改
<
/GLButton
>
<
GLButton
type
=
"text"
@
click
=
"btnClick('status', scope.scope)"
fn
=
"启用禁用"
>
{{
scope
.
scope
.
status
==
1
?
'停用'
:
'启用'
}}
<
/GLButton
>
<
GLButton
type
=
"text"
@
click
=
"btnClick('status', scope.scope)"
fn
=
"启用禁用"
>
{{
scope
.
scope
.
status
==
1
?
'停用'
:
'启用'
}}
<
/GLButton
>
<!--
<
el
-
button
type
=
"text"
@
click
=
"btnClick('status', scope.scope)"
>
{{
scope
.
scope
.
status
==
1
?
'停用'
:
'启用'
}}
<
/el-button>
--
>
>
{{
scope
.
scope
.
status
==
1
?
'停用'
:
'启用'
}}
<
/el-button>--
>
<
/div
>
<
/GLTable
>
<!--
表格区域
end
-->
...
...
@@ -89,7 +119,7 @@ export default {
tableColumns
:
[
{
label
:
'群聊名称'
,
prop
:
'
org
Name'
,
prop
:
'
group
Name'
,
width
:
200
}
,
{
...
...
@@ -247,7 +277,7 @@ export default {
btnClick
(
name
,
rowData
)
{
switch
(
name
)
{
case
'create'
:
this
.
$router
.
push
(
'/guestGroup/add'
)
this
.
$router
.
push
(
'/guestGroup/add
/-1
'
)
break
case
'edit'
:
this
.
$router
.
push
(
'/guestGroup/add/'
+
rowData
.
id
)
...
...
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