Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 b3ec9e46
authored
Oct 26, 2020
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
组织架构,客户修改调试
1 parent
00dc4418
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
156 additions
and
55 deletions
linkwe-ui/src/api/customer/index.js
linkwe-ui/src/api/organization.js
linkwe-ui/src/layout/components/Navbar.vue
linkwe-ui/src/views/contacts/organization.vue
linkwe-ui/src/views/customerManage/customer.vue
linkwe-ui/src/views/customerManage/customerDetail.vue
linkwe-ui/src/api/customer/index.js
View file @
b3ec9e4
...
...
@@ -34,17 +34,11 @@ export function sync() {
* 编辑客户标签
* @param {*} data
* {
"userid": "添加此客户添加人的id",
"externalUserid": "外部联系人userid",
"addTag": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名"
}],
"removeTag": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名"
}]
}
*/
...
...
@@ -55,3 +49,23 @@ export function makeLabel(data) {
data
})
}
/**
* 移除客户标签
* @param {*} data
* {
"externalUserid": "外部联系人userid",
"addTag": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名"
}]
}
*/
export
function
removeLabel
(
data
)
{
return
request
({
url
:
service
+
'/removeLabel'
,
method
:
'DELETE'
,
data
})
}
linkwe-ui/src/api/organization.js
View file @
b3ec9e4
...
...
@@ -146,6 +146,17 @@ export function startOrStop(data) {
}
/**
* 用户删除接口
* @param {*} userId
*/
export
function
remove
(
userId
)
{
return
request
({
url
:
serviceUser
+
'/'
+
userId
,
method
:
'DELETE'
,
})
}
/**
* 同步成员
*/
export
function
syncUser
()
{
...
...
linkwe-ui/src/layout/components/Navbar.vue
View file @
b3ec9e4
...
...
@@ -89,7 +89,7 @@ export default {
type
:
"warning"
,
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
"LogOut"
).
then
(()
=>
{
location
.
href
=
"/
index
"
;
location
.
href
=
"/"
;
});
});
},
...
...
linkwe-ui/src/views/contacts/organization.vue
View file @
b3ec9e4
...
...
@@ -16,10 +16,22 @@ export default {
dateRange
:
[],
treeData
:
[],
userList
:
[],
status
:
{
0
:
"启用"
,
1
:
"禁用"
,
6
:
"离职"
,
},
statusActivate
:
{
1
:
"已激活"
,
2
:
"已禁用"
,
4
:
"未激活"
,
5
:
"退出企业"
,
6
:
"删除"
,
},
total
:
0
,
defaultProps
:
{
label
:
"name"
,
children
:
"children"
,
childr
启用
en
:
"children"
,
},
form
:
{},
dialogVisible
:
false
,
...
...
@@ -141,7 +153,7 @@ export default {
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
form
.
department
+=
""
;
form
.
isLeaderInDept
+=
""
;
api
[
form
.
i
d
?
"updateUser"
:
"addUser"
](
form
)
api
[
form
.
userI
d
?
"updateUser"
:
"addUser"
](
form
)
.
then
(()
=>
{
this
.
msgSuccess
(
"操作成功"
);
this
.
dialogVisible
=
false
;
...
...
@@ -154,15 +166,30 @@ export default {
});
},
startOrStop
(
data
)
{
// 0: 启用,1:禁用
let
params
=
{
id
:
data
.
i
d
,
enable
:
data
.
enable
==
1
?
false
:
true
,
userId
:
data
.
userI
d
,
enable
:
data
.
enable
==
1
?
0
:
1
,
};
api
.
startOrStop
(
params
).
then
(()
=>
{
this
.
msgSuccess
(
"操作成功"
);
this
.
getList
();
});
},
/** 删除按钮操作 */
remove
(
id
)
{
// const operIds = id || this.ids + "";
this
.
$confirm
(
"是否确认删除吗?"
,
"警告"
,
{
type
:
"warning"
,
})
.
then
(
function
()
{
return
api
.
remove
(
id
);
})
.
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"删除成功"
);
});
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
},
...
...
@@ -318,7 +345,7 @@ export default {
</template>-->
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"isActivate"
>
<
template
slot-scope=
"scope"
>
{{
s
cope
.
row
.
isActivate
==
1
?
'已激活'
:
'未激活'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
s
tatusActivate
[
scope
.
row
.
isActivate
]
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
...
...
@@ -329,26 +356,27 @@ export default {
<
template
slot-scope=
"scope"
>
<el-button
v-hasPermi=
"['contacts:organization:view']"
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"edit(scope.row, 0)"
>
查看
</el-button>
<el-button
v-hasPermi=
"['contacts:organization:forbidden']"
v-if=
"scope.row.userId !== 1"
size=
"mini"
v-if=
"scope.row.userId !== 1 && scope.row.enable
< 2
"
type=
"text"
icon=
"el-icon-close-notification"
@
click=
"startOrStop(scope.row)"
>
{{
s
cope
.
row
.
enable
==
1
?
'禁用'
:
'启用'
}}
</el-button>
>
{{
s
tatus
[
scope
.
row
.
enable
]
}}
</el-button>
<el-button
v-if=
"scope.row.enable
< 2
"
v-hasPermi=
"['contacts:organization:edit']"
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"edit(scope.row, 1)"
>
编辑
</el-button>
<el-button
v-if=
"scope.row.enable
< 2
"
v-hasPermi=
"['customerManage:tag:remove']"
@
click=
"remove(scope.row.userId)"
type=
"text"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
linkwe-ui/src/views/customerManage/customer.vue
View file @
b3ec9e4
...
...
@@ -75,6 +75,7 @@ export default {
dialogVisibleAddTag
:
false
,
// 添加标签弹窗显隐
selectedGroup
:
""
,
// 选择的标签分组
selectedTag
:
[],
// 选择的标签
removeTag
:
[],
// 可移除的标签
tagDialogType
:
{
title
:
""
,
// 选择标签弹窗标题
type
:
""
,
// 弹窗类型
...
...
@@ -113,6 +114,12 @@ export default {
getListTag
()
{
getListTag
().
then
(({
rows
})
=>
{
this
.
listTag
=
Object
.
freeze
(
rows
);
this
.
listTagOneArray
=
[];
this
.
listTag
.
forEach
((
element
)
=>
{
element
.
weTags
.
forEach
((
d
)
=>
{
this
.
listTagOneArray
.
push
(
d
);
});
});
});
},
getListOrganization
()
{
...
...
@@ -128,7 +135,7 @@ export default {
};
this
.
dialogVisible
=
true
;
},
makeTag
()
{
makeTag
(
type
)
{
this
.
selectedTag
=
[];
if
(
!
this
.
multipleSelection
.
length
)
{
this
.
msgInfo
(
"请选择一位客户"
);
...
...
@@ -139,21 +146,21 @@ export default {
return
;
}
this
.
tagDialogType
=
{
title
:
"为客户增加
标签"
,
type
:
"customer"
,
title
:
type
===
"add"
?
"增加标签"
:
"移出
标签"
,
type
:
type
,
};
this
.
multipleSelection
.
forEach
((
element
)
=>
{
// debugger;
element
.
weFlowerCustomerRels
.
forEach
((
child
)
=>
{
child
.
weFlowerCustomerTagRels
.
forEach
((
grandchild
)
=>
{
this
.
selectedTag
.
push
({
id
:
grandchild
.
tagId
,
name
:
grandchild
.
tagName
,
let
filter
=
this
.
listTagOneArray
.
find
((
d
)
=>
{
return
d
.
tagId
===
grandchild
.
tagId
;
});
this
.
selectedTag
.
push
(
filter
);
});
});
});
this
.
removeTag
=
this
.
selectedTag
.
slice
();
this
.
dialogVisible
=
true
;
},
sync
()
{
...
...
@@ -174,18 +181,23 @@ export default {
},
submitSelectTag
(
formName
)
{
if
(
this
.
tagDialogType
.
type
===
"query"
)
{
this
.
query
.
tagIds
=
this
.
selectedTag
.
map
((
d
)
=>
d
.
i
d
)
+
""
;
this
.
query
.
tagIds
=
this
.
selectedTag
.
map
((
d
)
=>
d
.
tagI
d
)
+
""
;
// debugger;
this
.
queryTag
=
this
.
selectedTag
;
this
.
dialogVisible
=
false
;
}
else
if
(
this
.
tagDialogType
.
type
===
"customer"
)
{
}
else
{
let
data
=
{
userid
:
this
.
multipleSelection
[
0
].
externalUserid
,
externalUserid
:
this
.
multipleSelection
[
0
].
externalUserid
,
addTag
:
this
.
selectedTag
,
};
let
apiType
=
{
add
:
"makeLabel"
,
remove
:
"removeLabel"
,
};
api
.
makeLabel
(
this
.
selectedTag
).
then
(()
=>
{
api
[
apiType
[
this
.
tagDialogType
.
type
]](
data
).
then
(()
=>
{
this
.
msgSuccess
(
"操作成功"
);
this
.
dialogVisible
=
false
;
this
.
getList
();
});
}
},
...
...
@@ -278,13 +290,14 @@ export default {
type=
"primary"
size=
"mini"
icon=
"el-icon-s-flag"
@
click=
"makeTag"
@
click=
"makeTag
('add')
"
>
打标签
</el-button>
<el-button
v-hasPermi=
"['customerManage:customer:removeTag']"
type=
"primary"
size=
"mini"
icon=
"el-icon-brush"
@
click=
"makeTag('remove')"
>
移除标签
</el-button>
<el-button
v-hasPermi=
"['customerManage:customer:sync']"
...
...
@@ -320,10 +333,12 @@ export default {
</template>
</el-table-column>
<el-table-column prop="
corpName
" label="
公司名称
" align="
center
"></el-table-column>
<el-table-column prop="
address
" label="
添加人(首位)
" align="
center
">
<el-table-column prop="
userName
" label="
添加人(首位)
" align="
center
">
<template slot-scope="
scope
"
>
{{
scope
.
row
.
weFlowerCustomerRels
[
0
].
userName
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"createTime"
label
=
"添加时间"
align
=
"center"
><
/el-table-column
>
<
el
-
table
-
column
prop
=
"createTime"
label
=
"添加时间"
align
=
"center"
>
<
template
slot
-
scope
=
"scope"
>
{{
scope
.
row
.
weFlowerCustomerRels
[
0
].
createTime
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"address"
label
=
"标签"
align
=
"center"
>
<
template
slot
-
scope
=
"scope"
>
<
div
v
-
for
=
"(item, index) in scope.row.weFlowerCustomerRels"
:
key
=
"index"
>
...
...
@@ -366,24 +381,36 @@ export default {
v-for="
(
item
,
index
)
in
listTag
"
:key="
index
"
:label="
item
.
gourpName
"
:value="
item
.
i
d
"
:value="
item
.
groupI
d
"
></el-option>
</el-select>
<div class="
mt20
">
<el-checkbox-group v-model="
selectedTag
">
<el-checkbox-group v-model="
selectedTag
"
v-if="
tagDialogType
.
type
!==
'remove'
"
>
<template v-for="
(
item
,
index
)
in
listTag
">
<div class="
bfc
-
d
" v-show="
item
.
id
===
selectedGroup
||
!
selectedGroup
" :key="
index
">
<div
class="
bfc
-
d
"
v-show="
item
.
groupId
===
selectedGroup
||
!
selectedGroup
"
:key="
index
"
>
<el-checkbox
:label="
unit
"
value-key="
id
"
v-for="
(
unit
,
unique
)
in
item
.
weTags
"
:key="
index
+
unique
"
>
{{
unit
.
name
}}
<
/el-checkbox
>
<
/div
>
<
/template
>
<
/el-checkbox-group
>
<
el
-
checkbox
-
group
v
-
else
v
-
model
=
"selectedTag"
>
<
template
v
-
for
=
"(item, index) in removeTag"
>
<
el
-
checkbox
v
-
if
=
"item.groupId === selectedGroup || !selectedGroup"
:
label
=
"item"
:
key
=
"index"
>
{{
item
.
name
}}
<
/el-checkbox
>
<
/template
>
<
/el-checkbox-group
>
<
/div
>
<
div
class
=
"mt20"
v
-
show
=
"tagDialogType.type === '
customer
'"
>
<
div
class
=
"mt20"
v
-
show
=
"tagDialogType.type === '
add
'"
>
<
el
-
button
type
=
"primary"
@
click
=
"dialogVisibleAddTag = true"
>
添加标签
<
/el-button
>
<
/div
>
<
/div
>
...
...
@@ -447,4 +474,7 @@ export default {
color
:
#
f753b2
;
}
}
.
bfc
-
d
+
.
bfc
-
d
.
el
-
checkbox
:
first
-
child
{
margin
-
left
:
10
px
;
}
<
/style
>
linkwe-ui/src/views/customerManage/customerDetail.vue
View file @
b3ec9e4
...
...
@@ -5,7 +5,10 @@ export default {
name
:
"CustomerDetail"
,
data
()
{
return
{
customer
:
{},
datePickerVisible
:
false
,
customer
:
{
weFlowerCustomerRels
:
[],
},
};
},
created
()
{
...
...
@@ -29,22 +32,28 @@ export default {
<div>
<!--
<el-button
slot=
"append"
circle
icon=
"el-icon-back"
@
click=
"$router.back()"
></el-button>
返回 -->
<div
class=
"flex aic"
>
<el-avatar
:size=
"100"
src=
"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
></el-avatar>
<el-avatar
:size=
"100"
:src=
"customer.avatar"
></el-avatar>
<div
class=
"info-wrap"
>
<div
style=
"margin-bottom: 20px;
"
>
{{
customer
.
groupN
ame
}}
<div
class=
"mb10
"
>
{{
customer
.
n
ame
}}
<span
:style=
"
{color: customer.type === 1 ? '#4bde03' : '#f9a90b'}"
>
{{
({
1
:
'@微信'
,
2
:
'@企业微信'
}
)[
customer
.
type
]
}}
<
/span
>
<
i
:
class
=
"
[
'el-icon-s-custom'
,
({
1
:
'man'
,
2
:
'woman'
}
)[
customer
.
gender
]]
"></i>
</div>
<div class="
info
"
>
出生日期:
{{
customer
.
createTime
||
'--'
}}
<
i
class
=
"el-icon-edit"
><
/i
>
<
el
-
date
-
picker
v
-
model
=
"customer.createTime"
type
=
"date"
placeholder
=
"选择日期"
><
/el-date-picker
>
出生日期:
{{
customer
.
birthday
||
'--'
}}
<
div
class
=
"ml20"
style
=
"position: absolute;"
>
<
el
-
date
-
picker
v
-
if
=
"datePickerVisible"
v
-
model
=
"customer.birthday"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"选择日期便于以后客情维护"
@
blur
=
"datePickerVisible = false"
><
/el-date-picker
>
<
i
v
-
else
class
=
"el-icon-edit"
@
click
=
"datePickerVisible = true"
><
/i
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -53,28 +62,36 @@ export default {
<div>
<el-row :gutter="
10
">
<el-col :span="
10
">备注名:</el-col>
<el-col :span="
12
">
Dora
</el-col>
<el-col :span="
12
"
>
{{
customer
.
name
}}
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"10"
>
<
el
-
col
:
span
=
"10"
>
标签:
<
/el-col
>
<el-col :span="
12
">Dora</el-col>
<
el
-
col
:
span
=
"12"
>
<
div
v
-
for
=
"(item, index) in customer.weFlowerCustomerRels"
:
key
=
"index"
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(unit, unique) in item.weFlowerCustomerTagRels"
:
key
=
"unique"
>
{{
unit
.
tagName
}}
<
/el-tag
>
<
/div
>
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"10"
>
<
el
-
col
:
span
=
"10"
>
个人标签:
<
/el-col
>
<el-col :span="
12
">
Dora
</el-col>
<
el
-
col
:
span
=
"12"
>
{{
"--"
}}
<
/el-col
>
<
/el-row
>
<
el
-
divider
><
/el-divider
>
<
el
-
row
:
gutter
=
"10"
>
<
el
-
col
:
span
=
"10"
>
添加人:
<
/el-col
>
<el-col :span="
12
">
Dora
</el-col>
<
el
-
col
:
span
=
"12"
>
{{
customer
.
weFlowerCustomerRels
[
0
].
userName
}}
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"10"
>
<
el
-
col
:
span
=
"10"
>
所在部门:
<
/el-col
>
<el-col :span="
12
">
Dora
</el-col>
<
el
-
col
:
span
=
"12"
>
{{
"--"
}}
<
/el-col
>
<
/el-row
>
<
el
-
row
:
gutter
=
"10"
>
<
el
-
col
:
span
=
"10"
>
添加时间:
<
/el-col
>
<el-col :span="
12
">
Dora
</el-col>
<
el
-
col
:
span
=
"12"
>
{{
customer
.
weFlowerCustomerRels
[
0
].
createTime
}}
<
/el-col
>
<
/el-row
>
<
/div
>
<
/el-card
>
...
...
@@ -106,6 +123,7 @@ export default {
margin
-
left
:
20
px
;
.
info
{
color
:
#
aaa
;
line
-
height
:
32
px
;
}
}
...
...
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