Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 86f35ca7
authored
Feb 18, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
群发助手标签
1 parent
71e8f65b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
75 deletions
src/api/modules/customerTransform.js
src/setup/index.js
src/setup/qiankun.js
src/setup/single.js
src/views/customerTransform/addCustomer.vue
src/views/customerTransform/components/selectLabel.vue
src/api/modules/customerTransform.js
View file @
86f35ca
import
{
http
}
from
'@/main'
import
{
http
,
http2
}
from
'@/main'
const
path
=
'entmicro.api.mass.'
const
URL
=
'rop-scrm-entmicro/router'
...
...
@@ -67,7 +67,8 @@ const findLordGroup = params => {
}
const
querylabeltree
=
params
=>
{
params
.
method
=
'scrm.api.datahub.label.querylabeltree'
// params.method = 'scrm.api.datahub.label.querylabeltree'
params
.
method
=
'scrm.api.datahub.labelgroup.queryLabelTree'
return
http
({
url
:
'/rop-scrm-datahub/router'
,
method
:
'POST'
,
...
...
src/setup/index.js
View file @
86f35ca
...
...
@@ -10,3 +10,4 @@
import
{
bootstrap
,
mount
,
unmount
}
from
'./qiankun'
import
{
start
}
from
'./single'
export
{
bootstrap
,
mount
,
unmount
,
start
}
src/setup/qiankun.js
View file @
86f35ca
...
...
@@ -49,3 +49,4 @@ function subscribe({ messenger }) {
console
.
log
(
`监听到子应用
${
v
.
from
}
发来消息:`
,
v
)
})
}
src/setup/single.js
View file @
86f35ca
...
...
@@ -16,7 +16,7 @@ import render from './render'
import
{
routes
}
from
'@/router'
export
async
function
start
()
{
if
(
window
.
__POWERED_BY_QIANKUN__
)
return
const
{
response
,
request
,
sign
,
secret
}
=
await
fetchConfig
()
const
{
response
,
request
,
sign
,
secret
,
request2
}
=
await
fetchConfig
()
var
urlParams
=
{}
// window.location.href
// .split('?')[1]
...
...
@@ -24,7 +24,8 @@ export async function start() {
// .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1]
// })
var
token
=
Object
.
keys
(
urlParams
).
includes
(
'sessionId'
)
?
urlParams
.
sessionId
:
'mini-53e870b5-80d5-483e-8277-cdc4dec0ad80-rop'
var
token
=
Object
.
keys
(
urlParams
).
includes
(
'sessionId'
)
?
urlParams
.
sessionId
:
'scrm-base-0958821a-6542-474e-b057-74a1192a25f2-rop'
Vue
.
prototype
.
$http2
=
new
Http
({
response
,
request
:
request2
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
}
})
Vue
.
prototype
.
$http
=
new
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
token
}
})
Vue
.
use
(
GLButton
,
{
permissions
:
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
render
(
'/'
,
routes
)
...
...
src/views/customerTransform/addCustomer.vue
View file @
86f35ca
...
...
@@ -102,7 +102,7 @@
style=
"width: 320px;"
></el-date-picker>
</el-form-item>
<
!--
<
el-form-item
label=
"标签筛选"
>
<el-form-item
label=
"标签筛选"
>
<el-button
size=
"small"
@
click=
"openLabel"
>
<i
class=
"el-icon-plus"
></i>
标签筛选
...
...
@@ -112,15 +112,17 @@
:key=
"key"
class=
"el-input-tag input-tag-wrapper"
>
<el-tag
v-for=
"(tag, idx) in tagging"
:key=
"idx"
<span
v-for=
"(tag, idx) in tagging"
:key=
"idx"
>
<el-tag
v-for=
"(tagItem, idx1) in tag.labelList"
:key=
"idx1"
:size=
"size"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"removeTag(tag, idx)"
>
{{
tag
.
name
}}
</el-tag>
@
close=
"removeTag(tag, idx1, idx)"
>
{{
tagItem
.
name
}}
</el-tag>
</span>
</div>
<div
class=
"sale-select"
v-show=
"basicForm.condition.labelList"
>
<div
:key=
"key"
class=
"el-input-tag input-tag-wrapper"
>
...
...
@@ -136,7 +138,7 @@
<el-input
size=
"small"
style=
"outline: none; border: none"
></el-input>
</div>
</div>
</el-form-item>
-->
</el-form-item>
</el-form>
</div>
</div>
...
...
@@ -280,6 +282,7 @@ export default {
return
{
addLoading
:
false
,
eventBus
:
new
Vue
(),
taggingList
:
''
,
btnList
:
[
{
id
:
1
,
...
...
@@ -432,8 +435,24 @@ export default {
},
openLabel
()
{
this
.
dialogVisible
=
!
this
.
dialogVisible
this
.
$refs
.
selectLabel
.
init
()
},
handleSubmit
()
{
let
arr
=
[]
this
.
tagging
.
forEach
(
item
=>
{
item
.
labelList
.
forEach
(
tag
=>
{
arr
.
push
(
{
groupId
:
parseInt
(
item
.
labelGroup
.
id
),
groupName
:
item
.
labelGroup
.
name
,
labelId
:
parseInt
(
tag
.
id
),
labelName
:
tag
.
name
,
groupType
:
item
.
labelType
})
})
})
this
.
taggingList
=
arr
// console.log(this.taggingList)
this
.
$refs
.
basicForm
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
attachmentShow
=
true
...
...
@@ -512,20 +531,28 @@ export default {
},
handleSelect
(
val
)
{
this
.
isUpdate
=
true
const
arr
=
[]
if
(
val
.
length
!=
0
)
{
val
.
forEach
(
item
=>
{
if
(
item
.
labelList
.
length
!=
0
)
{
item
.
labelList
.
map
(
i
=>
arr
.
push
(
i
))
}
// arr.push(item.labelList)
})
}
this
.
tagging
=
arr
// const arr = []
// if (val.length != 0) {
// val.forEach(item => {
// if (item.labelList.length != 0) {
// item.labelList.map(i => arr.push(i))
// }
// // arr.push(item.labelList)
// })
// }
this
.
tagging
=
val
// this.taggingList = val
console
.
log
(
val
,
'1'
)
console
.
log
(
this
.
tagging
,
'2'
)
},
// 删除标签
removeTag
(
item
,
idx
)
{
this
.
tagging
.
splice
(
idx
,
1
)
removeTag
(
tag
,
idx1
,
idx
)
{
console
.
log
(
tag
,
'tag'
);
// this.tagging.splice(idx, 1)
tag
.
labelList
.
splice
(
idx1
,
1
)
if
(
tag
.
labelList
.
length
==
0
)
{
this
.
tagging
.
splice
(
idx
,
1
)
}
this
.
isUpdate
=
true
// this.$refs.selectLabel.init(this.tagging)
},
...
...
@@ -554,9 +581,12 @@ export default {
sex
:
this
.
basicForm
.
condition
.
sex
,
chatId
:
chatFlag
?
this
.
basicForm
.
condition
.
chat
.
map
(
item
=>
item
.
id
).
join
(
','
)
:
''
,
chatName
:
chatFlag
?
this
.
basicForm
.
condition
.
chat
.
map
(
item
=>
item
.
groupName
).
join
(
','
)
:
''
,
tagId
:
tagFlag
?
this
.
tagging
.
map
(
item
=>
item
.
id
).
join
(
','
)
:
''
,
tagName
:
tagFlag
?
this
.
tagging
.
map
(
item
=>
item
.
name
).
join
(
','
)
:
''
// tagId: "328,329,330",
// tagName: "一般,重要,核心"
// tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
// tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging)
labelList
:
this
.
taggingList
}
}
if
(
this
.
basicForm
.
condition
.
date
)
{
...
...
@@ -583,17 +613,18 @@ export default {
return
}
const
params
=
this
.
getSiftMembers
()
this
.
$apis
.
customerTransform
.
customerCount
(
params
)
.
then
(
res
=>
{
// if (res) {
this
.
groupNumber
=
res
// }
this
.
isUpdate
=
false
})
.
catch
(
err
=>
{
this
.
groupNumber
=
0
})
console
.
log
(
params
)
// this.$apis.customerTransform
// .customerCount(params)
// .then(res => {
// // if (res) {
// this.groupNumber = res
// // }
// this.isUpdate = false
// })
// .catch(err => {
// this.groupNumber = 0
// })
},
// 选择客户change事件
radioChange
(
val
)
{
...
...
src/views/customerTransform/components/selectLabel.vue
View file @
86f35ca
...
...
@@ -9,30 +9,14 @@
<el-input
size=
"small"
v-model=
"labelGroupName"
placeholder=
"请输入搜索内容"
></el-input>
<el-button
size=
"small"
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</div>
<div
class=
"checkbox-group-box"
:style=
"
{ 'max-height': heightBox + 'px' }">
<div
v-for=
"(item, index) in labelTreeRets"
:key=
"index"
>
<span
class=
"el-tree-node__expand-icon el-icon-caret-right"
:class=
"
{ expanded: item.checked }"
@click="item.checked = !item.checked"
>
</span>
<el-checkbox
:indeterminate=
"item.isIndeterminate"
v-model=
"item.checkAll"
@
change=
"handleCheckAllChange(item.checkAll, index)"
>
{{
item
.
labelGroup
.
name
}}
(
{{
item
.
tagChecked
.
length
}}
/
{{
item
.
labelList
.
length
}}
项)
</el-checkbox>
<div
class=
"checkbox-group-box"
:style=
"
{ height: heightBox + 'px' }">
<div
style=
"margin-bottom: 8px"
v-for=
"(item, index) in labelTreeRets"
:key=
"index"
>
<span
class=
"el-tree-node__expand-icon el-icon-caret-right"
:class=
"
{ expanded: item.checked }" @click="item.checked = !item.checked">
</span>
<el-checkbox
:indeterminate=
"item.isIndeterminate"
v-model=
"item.checkAll"
@
change=
"handleCheckAllChange(item.checkAll, index)"
>
{{
item
.
labelGroup
.
name
}}
(
{{
item
.
tagChecked
.
length
}}
/
{{
item
.
labelList
.
length
}}
项)
</el-checkbox>
<el-tag
:size=
"size"
>
{{
item
.
labelType
}}
</el-tag>
<div
style=
"margin: 15px 0"
></div>
<el-checkbox-group
class=
"tag-group"
v-model=
"item.tagChecked"
@
change=
"handleCheckedChange(item.tagChecked, index)"
v-show=
"item.checked"
>
<el-checkbox
v-for=
"(itm, idx) in item.labelList"
:label=
"itm"
:key=
"idx"
>
{{
itm
.
name
}}
</el-checkbox>
<el-checkbox-group
class=
"tag-group"
v-model=
"item.tagChecked"
@
change=
"handleCheckedChange(item.tagChecked, index)"
v-show=
"item.checked"
>
<el-checkbox
v-for=
"(itm, idx) in item.labelList"
:label=
"itm"
:key=
"idx"
>
{{
itm
.
name
}}
</el-checkbox>
</el-checkbox-group>
</div>
</div>
...
...
@@ -42,18 +26,12 @@
<div
class=
"tag-title"
>
已选标签
</div>
<div
class=
"tag-select-box"
>
<div
class=
"tag-box-header"
>
标签名称(
{{
selectNum
}}
项)
</div>
<div
class=
"tag-selected-box"
>
<div
class=
"tag-selected-box"
:style=
"
{ height: heightBox + 'px' }"
>
<template
v-for=
"item in labelTreeRetSelect"
>
<template
v-for=
"(tag, idx) in item.tagChecked"
>
<el-tag
class=
"tag-selected-item"
:key=
"idx"
v-if=
"tag"
type=
"info"
closable
:disable-transitions=
"false"
@
close=
"remove(item, idx)"
>
{{
tag
.
name
}}
</el-tag>
<el-tag
:title=
"tag.name"
type=
"info"
class=
"tag-selected-item"
:key=
"idx"
v-if=
"tag"
closable
:disable-transitions=
"false"
@
close=
"remove(item, idx)"
>
{{
tag
.
name
}}
</el-tag>
</
template
>
</template>
</div>
...
...
@@ -61,6 +39,7 @@
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button
size=
"small"
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"handleSelect"
>
确 定
</el-button>
</span>
...
...
@@ -70,8 +49,9 @@
<
script
>
import
{
utils
}
from
'glsx-common'
import
util
from
'@/utils/util'
export
default
{
name
:
'
SelectLab
el'
,
name
:
'
activityMod
el'
,
data
()
{
return
{
heightBox
:
200
,
...
...
@@ -109,10 +89,10 @@ export default {
}
},
watch
:
{
labelTreeRet
s
:
{
labelTreeRet
Select
:
{
handler
()
{
this
.
selectNum
=
0
this
.
labelTreeRet
s
.
forEach
(
item
=>
{
this
.
labelTreeRet
Select
.
forEach
(
item
=>
{
this
.
selectNum
+=
item
.
tagChecked
.
length
})
},
...
...
@@ -120,6 +100,10 @@ export default {
}
},
methods
:
{
jumpUrl
()
{
util
.
openUrl
(
location
.
origin
+
'/custom/tagsManage/index'
)
this
.
dialogVisible
=
false
},
init
(
item
)
{
this
.
labelGroupName
=
''
this
.
dialogVisible
=
true
...
...
@@ -135,15 +119,19 @@ export default {
labelTreeReq
:
{
pageNum
:
1
,
pageSize
:
1000
,
shopId
:
this
.
$globalState
.
session
.
merchantId
,
// shopId: this.$globalState.session.merchantId,
shopId
:
'44210934'
,
labelGroupName
:
this
.
labelGroupName
,
edition
:
this
.
$globalState
.
session
.
merchantModel
// labelTypesStr: '自店标签,企业标签',
// edition: this.$globalState.session.merchantModel
edition
:
4
}
})
.
then
(
res
=>
{
if
(
selectItem
&&
selectItem
.
length
>
0
)
{
this
.
labelTreeRets
=
res
.
labelTreeRets
.
map
(
item
=>
{
return
{
labelType
:
item
.
labelType
,
labelGroup
:
item
.
labelGroup
,
labelList
:
item
.
labelList
,
checked
:
false
,
...
...
@@ -182,6 +170,7 @@ export default {
}
else
{
this
.
labelTreeRets
=
res
.
labelTreeRets
.
map
(
item
=>
{
return
{
labelType
:
item
.
labelType
,
labelGroup
:
item
.
labelGroup
,
labelList
:
item
.
labelList
,
checked
:
false
,
...
...
@@ -241,11 +230,13 @@ export default {
if
(
item
.
tagChecked
.
length
)
{
return
{
labelGroup
:
item
.
labelGroup
,
labelType
:
item
.
labelType
,
labelList
:
item
.
tagChecked
}
}
})
.
filter
(
item
=>
item
)
console
.
log
(
labelTreeRets
)
this
.
$emit
(
'tagSelected'
,
labelTreeRets
)
},
//全选
...
...
@@ -285,12 +276,19 @@ export default {
},
mounted
()
{
let
clientHeight
=
document
.
documentElement
.
clientHeight
this
.
heightBox
=
clientHeight
-
0.15
*
clientHeight
-
3
0
0
this
.
heightBox
=
clientHeight
-
0.15
*
clientHeight
-
3
5
0
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.dialog-jump
{
color
:
#5850ff
;
float
:
left
;
line-height
:
24px
;
text-decoration
:
underline
;
cursor
:
pointer
;
}
.tag-panel
{
display
:
flex
;
.tag-panel-select
{
...
...
@@ -348,6 +346,12 @@ export default {
margin
:
0px
6px
6px
0px
;
height
:
26px
;
line-height
:
24px
;
font-size
:
14px
;
color
:
#666
;
max-width
:
200px
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
}
.el-tree-node__expand-icon
{
color
:
#5850ff
;
...
...
@@ -368,6 +372,11 @@ export default {
}
.checkbox-group-box
{
overflow
:
auto
;
.el-tag
{
font-size
:
12px
;
border
:
none
;
background
:
rgba
(
$
color
:
#5850FF
,
$
alpha
:
0.3
)
}
}
.tag-selected-box
{
min-height
:
200px
;
...
...
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