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 7109ba97
authored
Dec 30, 2021
by
李长胜
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
标签修改
1 parent
841b19a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
47 deletions
src/common/common.js
src/views/tagsManage/index.vue
src/common/common.js
View file @
7109ba9
...
@@ -108,5 +108,23 @@ export const common = {
...
@@ -108,5 +108,23 @@ export const common = {
}
else
{
}
else
{
callback
()
callback
()
}
}
},
/**
* 中文英文数字下划线括号,30个字符,是字符
*/
checkCharName
(
rule
,
value
,
callback
)
{
var
rxp
=
/^
[\u
4e00-
\u
9fa5_a-zA-Z0-9.
\\
()
\\
()
]
+$/
if
(
!
rule
.
required
)
{
if
(
!
value
)
{
callback
()
}
else
if
(
!
rxp
.
test
(
value
))
{
return
callback
(
new
Error
(
'请输入中文英文数字下划线或括号'
))
}
}
if
(
!
value
)
{
return
callback
(
new
Error
(
'请输入'
))
}
else
{
callback
()
}
}
}
}
}
src/views/tagsManage/index.vue
View file @
7109ba9
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<span
class=
"toptips"
>
<span
class=
"toptips"
>
<!-- v-if="!((merchantModel==2 && accountLevel==4) || (merchantModel==1 && accountLevel==1))" -->
<!-- v-if="!((merchantModel==2 && accountLevel==4) || (merchantModel==1 && accountLevel==1))" -->
<span>
<span>
共有
{{
numberObj
.
groupCount
||
0
}}
个标签组
<template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
,
{{
numberObj
.
bizLabelCount
||
0
}}
个企业标签
</
template
>
共有
{{
numberObj
.
groupCount
||
0
}}
个标签组
<template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
,
{{
numberObj
.
bizLabelCount
||
0
}}
个企业标签
</
template
>
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
>
,
{{
numberObj
.
rcLabelCount
||
0
}}
个自店标签
</
template
>
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
>
,
{{
numberObj
.
rcLabelCount
||
0
}}
个自店标签
</
template
>
</span>
</span>
<span
class=
"iconPanelWrap"
v-if=
"!isFirstShow"
>
<span
class=
"iconPanelWrap"
v-if=
"!isFirstShow"
>
...
@@ -19,9 +20,8 @@
...
@@ -19,9 +20,8 @@
</span>
</span>
</span>
</span>
<div
class=
"initPanel"
v-if=
"isFirstShow"
>
<div
class=
"initPanel"
v-if=
"isFirstShow"
>
<
template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;
</
template
>
<
template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;
</
template
>
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
>
自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
>
自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;
</
template
>
</
template
>
行业标签为通过大数据算法规则生成的标签
行业标签为通过大数据算法规则生成的标签
<img
src=
"@/assets/tagsManage/Shape.png"
alt=
""
/>
<img
src=
"@/assets/tagsManage/Shape.png"
alt=
""
/>
<i
class=
"el-icon-close"
@
click=
"closeInitPanel"
></i>
<i
class=
"el-icon-close"
@
click=
"closeInitPanel"
></i>
...
@@ -50,23 +50,22 @@
...
@@ -50,23 +50,22 @@
<span>
{{ item.name }}
</span>
<span>
{{ item.name }}
</span>
</el-tooltip>
</el-tooltip>
</span>
</span>
<el-popover
v-if=
"scope.scope.labelList.length > 9
"
class=
"ellipsis-1 tag-box-wrap"
placement=
"top"
width=
"600"
trigger=
"hover"
content=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<el-popover
v-if=
"scope.scope.labelList.length > 9
"
class=
"ellipsis-1 tag-box-wrap"
placement=
"top"
width=
"600"
trigger=
"hover"
content=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
>
<span
slot=
"reference"
>
...({{ scope.scope.labelList.length }})
</span>
<span
slot=
"reference"
>
...({{ scope.scope.labelList.length }})
</span>
<div
class=
"entmicro-hover"
style=
"height:214px;overflow-y:auto;
"
>
<div
class=
"entmicro-hover"
style=
"height: 214px; overflow-y: auto
"
>
<el-tag
type=
"info"
class=
"ellipsis-1"
style=
"margin-right: 10px; margin-bottom: 10px;max-width: 200px;
"
v-for=
"(i, sindex) in scope.scope.labelList"
:key=
"sindex"
:disable-transitions=
"false"
>
<el-tag
type=
"info"
class=
"ellipsis-1"
style=
"margin-right: 10px; margin-bottom: 10px; max-width: 200px
"
v-for=
"(i, sindex) in scope.scope.labelList"
:key=
"sindex"
:disable-transitions=
"false"
>
<el-tooltip
class=
"item"
:content=
"i.name"
placement=
"top"
>
<el-tooltip
class=
"item"
:content=
"i.name"
placement=
"top"
>
<span>
{{ i.name }}
</span>
<span>
{{ i.name }}
</span>
</el-tooltip>
</el-tooltip>
</el-tag>
</el-tag>
</div>
</div>
</el-popover>
</el-popover>
</div>
</div>
</span>
</span>
<
template
slot=
"xxx"
slot-scope=
"scope"
>
<
template
slot=
"xxx"
slot-scope=
"scope"
>
<!-- //这版关掉自店标签 1.0.1允许集团的门店打字店标签,也可以编辑-->
<!-- //这版关掉自店标签 1.0.1允许集团的门店打字店标签,也可以编辑-->
<span
@
click=
"btnClick('edit', scope.scope)"
class=
"blue-text"
v-if=
"scope.scope.labelType != '行业标签' && isShowEditBtn(scope.scope)"
>
编辑标签组
</span>
<span
@
click=
"btnClick('edit', scope.scope)"
class=
"blue-text"
v-if=
"scope.scope.labelType != '行业标签' && isShowEditBtn(scope.scope)"
>
编辑标签组
</span>
</
template
>
</
template
>
</GLTable>
</GLTable>
</div>
</div>
...
@@ -79,8 +78,11 @@
...
@@ -79,8 +78,11 @@
</el-select>
</el-select>
<!-- id="tagTipMsgRef" -->
<!-- id="tagTipMsgRef" -->
<span
class=
"tagTipMsg"
v-if=
"tagDialogTitle == '添加标签组' && !tagForm.initTagsGroup"
>
<span
class=
"tagTipMsg"
v-if=
"tagDialogTitle == '添加标签组' && !tagForm.initTagsGroup"
>
<
template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
企业标签
</
template
>
<
template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
企业标签
</
template
>
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
><template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
和
</
template
>
自店标签分别
</template>
<
template
v-if=
"!((merchantModel == 2 && accountLevel == 4) || (merchantModel == 1 && accountLevel == 1))"
>
<template
v-if=
"!(merchantModel == 1 && accountLevel == 4)"
>
和
</
template
>
自店标签分别
</template>
最多3000个
最多3000个
</span>
</span>
<span
class=
"tagTipMsg"
v-if=
"tagDialogTitle == '添加标签组' && tagForm.initTagsGroup == 1"
>
<span
class=
"tagTipMsg"
v-if=
"tagDialogTitle == '添加标签组' && tagForm.initTagsGroup == 1"
>
...
@@ -105,7 +107,8 @@
...
@@ -105,7 +107,8 @@
<div
slot=
"tagsInput-type"
>
<div
slot=
"tagsInput-type"
>
<div
class=
"tagsWrap"
v-if=
"tagDialogTitle == '编辑标签组'"
>
<div
class=
"tagsWrap"
v-if=
"tagDialogTitle == '编辑标签组'"
>
<span
class=
"tag"
:class=
"{ inputWrapShow: item.inputVisible }"
v-for=
"item in editTagList"
:key=
"item.id"
>
<span
class=
"tag"
:class=
"{ inputWrapShow: item.inputVisible }"
v-for=
"item in editTagList"
:key=
"item.id"
>
<el-input
class=
"input-new-tag"
maxlength=
"30"
show-word-limit
v-if=
"item.inputVisible"
v-model
.
trim=
"item.name"
ref=
"saveTagInput"
size=
"small"
@
blur=
"handleInputConfirm(item.name, item.id)"
@
keyup
.
enter
.
native=
"handleInputConfirm(item.name, item.id)"
></el-input>
<!-- maxlength="30" show-word-limit -->
<el-input
class=
"input-new-tag"
v-if=
"item.inputVisible"
v-model
.
trim=
"item.name"
ref=
"saveTagInput"
size=
"small"
@
blur=
"item.name=handleInputConfirm(item.name, item.id)"
@
keyup
.
enter
.
native=
"item.name=handleInputConfirm(item.name, item.id)"
></el-input>
<el-tooltip
class=
"item"
:content=
"item.name"
placement=
"top"
>
<el-tooltip
class=
"item"
:content=
"item.name"
placement=
"top"
>
<span
class=
"ellipsis-1"
v-if=
"!item.inputVisible"
>
{{ item.name }}
</span>
<span
class=
"ellipsis-1"
v-if=
"!item.inputVisible"
>
{{ item.name }}
</span>
</el-tooltip>
</el-tooltip>
...
@@ -114,8 +117,8 @@
...
@@ -114,8 +117,8 @@
</div>
</div>
<div
class=
"row-tag"
v-for=
"(item, index) in tagForm.tagsList"
:key=
"index"
>
<div
class=
"row-tag"
v-for=
"(item, index) in tagForm.tagsList"
:key=
"index"
>
<!-- :onkeyup="(item.name = item.name.replace(/\s+/g, ''))" -->
<!-- :onkeyup="(item.name = item.name.replace(/\s+/g, ''))"
maxlength="30" show-word-limit @input="checkInputContent"
-->
<el-input
v-model
.
trim=
"item.name"
placeholder=
"添加标签名称(至少添加一个标签)"
maxlength=
"30"
show-word-limit
@
input=
"checkInputContent"
></el-input>
<el-input
v-model
.
trim=
"item.name"
placeholder=
"添加标签名称(至少添加一个标签)"
@
keyup
.
native=
"item.name = checkInputContent(item.name)"
></el-input>
<span
class=
"el-icon-circle-close"
@
click=
"deleteRow(index)"
></span>
<span
class=
"el-icon-circle-close"
@
click=
"deleteRow(index)"
></span>
</div>
</div>
<!-- 需要后台告诉已经创建多少个标签了 -->
<!-- 需要后台告诉已经创建多少个标签了 -->
...
@@ -149,6 +152,26 @@ export default {
...
@@ -149,6 +152,26 @@ export default {
name
:
'tagsManage'
,
name
:
'tagsManage'
,
data
()
{
data
()
{
//这里就是整个checkName啦,就是方法一的使用
var
checkName
=
(
rule
,
value
,
callback
)
=>
{
var
len
=
0
for
(
var
i
=
0
;
i
<
value
.
length
;
i
++
)
{
var
c
=
value
.
charCodeAt
(
i
)
//单字节加1
if
((
c
>=
0x0001
&&
c
<=
0x007e
)
||
(
0xff60
<=
c
&&
c
<=
0xff9f
))
{
len
++
}
else
{
len
+=
2
}
}
if
(
len
>
30
)
{
//重点重点,下面就是填写提示的文字 (len < 4 && len> 0) ||
// callback(new Error('名称长度为4-30个字符,一个中文字等于2个字符。'));
callback
(
new
Error
(
'名称长度不大于30个字符,一个中文字等于2个字符'
))
}
else
{
callback
()
}
}
var
checkTagsInput
=
(
rule
,
value
,
callBack
)
=>
{
var
checkTagsInput
=
(
rule
,
value
,
callBack
)
=>
{
console
.
log
(
'value值为:'
,
value
,
typeof
value
,
value
.
length
)
console
.
log
(
'value值为:'
,
value
,
typeof
value
,
value
.
length
)
...
@@ -222,7 +245,7 @@ export default {
...
@@ -222,7 +245,7 @@ export default {
{
{
label
:
'操作'
,
label
:
'操作'
,
prop
:
'xxx'
,
prop
:
'xxx'
,
fixed
:
'right'
,
fixed
:
'right'
,
addHtml
:
'xxx'
,
addHtml
:
'xxx'
,
width
:
120
width
:
120
}
}
...
@@ -246,8 +269,8 @@ export default {
...
@@ -246,8 +269,8 @@ export default {
prop
:
'tagsName'
,
prop
:
'tagsName'
,
type
:
'input'
,
type
:
'input'
,
placeholder
:
'添加标签组名称,最多30个字符'
,
placeholder
:
'添加标签组名称,最多30个字符'
,
maxlength
:
30
,
//
maxlength: 30,
showWordLimit
:
true
,
//
showWordLimit: true,
disabled
:
false
disabled
:
false
},
},
{
{
...
@@ -269,7 +292,7 @@ export default {
...
@@ -269,7 +292,7 @@ export default {
tagsName
:
[
tagsName
:
[
{
required
:
true
,
message
:
'请输入名称'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请输入名称'
,
trigger
:
'blur'
},
{
{
validator
:
this
.
$Commons
.
checkName
,
validator
:
checkName
,
//
this.$Commons.checkName,
trigger
:
'blur'
trigger
:
'blur'
}
}
],
],
...
@@ -301,22 +324,21 @@ export default {
...
@@ -301,22 +324,21 @@ export default {
this
.
merchantModel
=
this
.
$globalState
.
session
.
merchantModel
this
.
merchantModel
=
this
.
$globalState
.
session
.
merchantModel
this
.
accountLevel
=
this
.
$globalState
.
session
.
accountLevel
this
.
accountLevel
=
this
.
$globalState
.
session
.
accountLevel
this
.
userType
=
this
.
$globalState
.
session
.
userType
this
.
userType
=
this
.
$globalState
.
session
.
userType
console
.
log
(
this
.
$globalState
.
session
,
'555'
)
console
.
log
(
this
.
$globalState
.
session
,
'555'
)
// if (this.merchantModel == 1) {
// if (this.merchantModel == 1) {
// if (!(this.accountLevel == 1 && this.userType == 1)) this.tagsGroupList.splice(0, 1) //只能创建自店标签
// if (!(this.accountLevel == 1 && this.userType == 1)) this.tagsGroupList.splice(0, 1) //只能创建自店标签
// }
// }
//1.0.1集团下的门店只能创建自店标签
//1.0.1集团下的门店只能创建自店标签
if
(
this
.
merchantModel
==
1
)
{
if
(
this
.
merchantModel
==
1
)
{
if
(
(
this
.
accountLevel
==
4
)
)
{
if
(
this
.
accountLevel
==
4
)
{
this
.
tagsGroupList
.
splice
(
0
,
1
)
//只能创建自店标签
this
.
tagsGroupList
.
splice
(
0
,
1
)
//只能创建自店标签
this
.
tagsPartFormList
[
0
].
options
.
splice
(
0
,
1
)
this
.
tagsPartFormList
[
0
].
options
.
splice
(
0
,
1
)
}
}
}
}
if
(
this
.
merchantModel
==
1
)
{
if
(
this
.
merchantModel
==
1
)
{
if
(
this
.
accountLevel
==
1
)
{
if
(
this
.
accountLevel
==
1
)
{
//集团下的工厂只能创建企微标签,自店标签不要了
//集团下的工厂只能创建企微标签,自店标签不要了
this
.
tagsGroupList
.
splice
(
1
,
1
)
this
.
tagsGroupList
.
splice
(
1
,
1
)
this
.
tagsPartFormList
[
0
].
options
.
splice
(
1
,
1
)
this
.
tagsPartFormList
[
0
].
options
.
splice
(
1
,
1
)
}
}
...
@@ -348,21 +370,42 @@ export default {
...
@@ -348,21 +370,42 @@ export default {
return
[]
return
[]
}
}
// return list
// return list
return
list
.
slice
(
0
,
9
)
return
list
.
slice
(
0
,
9
)
},
},
checkInputContent
(
e
)
{
checkInputContent
(
e
)
{
let
str
=
e
var
len
=
0
var
singleNum
=
0
var
doubleNum
=
0
for
(
var
i
=
0
;
i
<
e
.
length
;
i
++
)
{
var
c
=
e
.
charCodeAt
(
i
)
//单字节加1
if
((
c
>=
0x0001
&&
c
<=
0x007e
)
||
(
0xff60
<=
c
&&
c
<=
0xff9f
))
{
len
++
singleNum
++
}
else
{
len
+=
2
doubleNum
++
}
}
if
(
len
>
30
)
{
this
.
$message
.
error
(
'字数已达上限'
)
return
str
.
substr
(
0
,
15
)
}
// console.log(e, '输入框的值')
// console.log(e, '输入框的值')
//确保每个输入框的内容不和已存在的编辑标签相同
//确保每个输入框的内容不和已存在的编辑标签相同
let
isHasSameTag
=
this
.
editTagList
.
some
(
ele
=>
ele
.
name
==
e
)
let
isHasSameTag
=
this
.
editTagList
.
some
(
ele
=>
ele
.
name
==
e
)
if
(
isHasSameTag
)
{
if
(
isHasSameTag
)
{
this
.
$message
.
error
(
'不允许输入已存在的标签'
)
this
.
$message
.
error
(
'不允许输入已存在的标签'
)
return
return
str
}
}
return
str
},
},
isShowEditBtn
(
row
)
{
isShowEditBtn
(
row
)
{
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//单店模式下,仅门店和员工可以编辑
//单店模式下,仅门店和员工可以编辑
if
(
row
.
labelType
==
'自店标签'
&&
(
!
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
)
))
{
if
(
row
.
labelType
==
'自店标签'
&&
!
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
))
{
return
false
return
false
}
}
if
(
this
.
merchantModel
==
1
)
{
if
(
this
.
merchantModel
==
1
)
{
...
@@ -437,10 +480,10 @@ export default {
...
@@ -437,10 +480,10 @@ export default {
switch
(
pType
)
{
switch
(
pType
)
{
case
'create'
:
case
'create'
:
this
.
tagDialogTitle
=
'添加标签组'
this
.
tagDialogTitle
=
'添加标签组'
this
.
tagForm
.
tagsForm
=
''
this
.
tagForm
.
tagsForm
=
''
this
.
tagForm
.
initTagsGroup
=
1
//默认改成,企业标签
this
.
tagForm
.
initTagsGroup
=
1
//默认改成,企业标签
if
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
)
{
if
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
)
{
this
.
tagForm
.
initTagsGroup
=
2
this
.
tagForm
.
initTagsGroup
=
2
}
}
this
.
$set
(
this
.
tagDialogData
[
0
],
'disabled'
,
false
)
this
.
$set
(
this
.
tagDialogData
[
0
],
'disabled'
,
false
)
...
@@ -529,9 +572,9 @@ export default {
...
@@ -529,9 +572,9 @@ export default {
if
(
!
this
.
tagVisible
&&
this
.
$refs
.
tagForm
)
{
if
(
!
this
.
tagVisible
&&
this
.
$refs
.
tagForm
)
{
this
.
$refs
.
tagForm
.
$children
[
0
].
resetFields
()
this
.
$refs
.
tagForm
.
$children
[
0
].
resetFields
()
this
.
tagForm
.
initTagsGroup
=
1
this
.
tagForm
.
initTagsGroup
=
1
if
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
)
{
if
(
this
.
merchantModel
==
1
&&
this
.
accountLevel
==
4
)
{
this
.
tagForm
.
initTagsGroup
=
2
this
.
tagForm
.
initTagsGroup
=
2
}
}
this
.
tagForm
.
tagsName
=
''
this
.
tagForm
.
tagsName
=
''
// console.log(this.tagForm.initTagsGroup, '7777')
// console.log(this.tagForm.initTagsGroup, '7777')
// console.log(this.tagForm, '内')
// console.log(this.tagForm, '内')
...
@@ -634,18 +677,33 @@ export default {
...
@@ -634,18 +677,33 @@ export default {
},
},
handleInputConfirm
(
inputValue
,
id
)
{
handleInputConfirm
(
inputValue
,
id
)
{
let
value
=
inputValue
// if (String(value).length == 0) {
// this.$message.warning('不能清空标签')
// return
// }
this
.
editTagList
.
forEach
(
i
=>
{
this
.
editTagList
.
forEach
(
i
=>
{
if
(
i
.
id
==
id
)
{
if
(
i
.
id
==
id
)
{
i
.
inputVisible
=
false
i
.
inputVisible
=
false
}
}
})
})
let
str
=
inputValue
var
len
=
0
var
singleNum
=
0
var
doubleNum
=
0
for
(
var
i
=
0
;
i
<
str
.
length
;
i
++
)
{
var
c
=
str
.
charCodeAt
(
i
)
//单字节加1
if
((
c
>=
0x0001
&&
c
<=
0x007e
)
||
(
0xff60
<=
c
&&
c
<=
0xff9f
))
{
len
++
singleNum
++
}
else
{
len
+=
2
doubleNum
++
}
}
if
(
len
>
30
)
{
this
.
$message
.
error
(
'字数已达上限'
)
return
str
.
substr
(
0
,
15
)
}
return
str
},
},
handleSelect
(
value
)
{
handleSelect
(
value
)
{
console
.
log
(
'值内容'
,
value
)
console
.
log
(
'值内容'
,
value
)
...
...
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