Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
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 6a7a1cad
authored
May 19, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
模糊搜索
1 parent
e24b6c7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
124 deletions
src/api/modules/baseInfo.js
src/views/baseInfo/components/departmentTree.vue
src/views/baseInfo/components/search.vue
src/api/modules/baseInfo.js
View file @
6a7a1ca
...
...
@@ -25,8 +25,8 @@ const getDepartment = params => {
sign
:
true
})
}
const
get
DepartmentList
=
params
=>
{
params
.
method
=
'entmicro.api.department.
listDepartmentTre
e'
const
find
DepartmentList
=
params
=>
{
params
.
method
=
'entmicro.api.department.
findDepartmentListByPag
e'
return
http_config
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
...
...
@@ -65,7 +65,7 @@ const brandList = params => {
export
default
{
getMerchantTree
,
getDepartment
,
get
DepartmentList
,
find
DepartmentList
,
toGL
,
merchantInfo
,
brandList
...
...
src/views/baseInfo/components/departmentTree.vue
View file @
6a7a1ca
...
...
@@ -68,7 +68,7 @@ export default {
}
},
mounted
()
{
this
.
getDepartmentList
()
//
this.getDepartmentList()
},
methods
:
{
// 获取门店数据
...
...
src/views/baseInfo/components/search.vue
View file @
6a7a1ca
...
...
@@ -13,9 +13,9 @@
<!--
<li
class=
"el-cascader__suggestion-item"
:class=
"isCheck ? 'is-checked' : ''"
>
dafsd
</li>
-->
<template
v-if=
"searchList.length"
>
<li
class=
"el-cascader__suggestion-item"
:class=
"item.departmentName == searchKey.departmentName"
v-for=
"item in searchList"
:key=
"item.id"
@
click=
"selectItem(item)"
>
<
el-radio
:label=
"item"
>
{{
item
.
departmentName
}}
</el-radio
>
<
!--
<div>
{{
item
.
departmentName
}}
</div>
--
>
<
!--
<div
class=
"parent-merchant"
>
{{
item
.
parentMerchantName
}}
</div>
--
>
<
!--
<el-radio
:label=
"item"
>
{{
item
.
departmentName
}}
</el-radio>
--
>
<
div>
{{
item
.
departmentName
}}
</div
>
<
div
class=
"parent-merchant"
>
{{
item
.
entmicroParentName
}}
</div
>
</li>
</
template
>
<
template
v-else
>
...
...
@@ -52,120 +52,45 @@ export default {
isOpen
:
false
,
visible
:
false
,
isCheck
:
false
,
merchantList
:
[
{
id
:
1
,
merchantName
:
'嘀加平台公共商户'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
2
,
merchantName
:
'嘀加权限测试'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
3
,
merchantName
:
'测试的什么'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
4
,
merchantName
:
'蛤蛤1S'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
5
,
merchantName
:
'姓江的岁月神偷'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
6
,
merchantName
:
'4s店'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
7
,
merchantName
:
'周立明视频加测试批发商账号'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
8
,
merchantName
:
'周立明视频加测试4S店账号'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
9
,
merchantName
:
'供应商的账号'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
10
,
merchantName
:
'颗粒的供应商'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
11
,
merchantName
:
'颗粒的4s店'
,
parentMerchantName
:
'嘀加公共市代商户'
},
{
id
:
12
,
merchantName
:
'颗粒的综合汽贸店'
,
parentMerchantName
:
'嘀加公共市代商户'
}
],
// 接口返回数据
departmentList
:
[],
// 接口返回数据
searchValue
:
''
,
// 搜索值
searchList
:
[],
// 搜索结果
list
:
[],
count
:
0
count
:
0
,
pageParams
:
{
pageNum
:
1
,
pageSize
:
10
}
}
},
mounted
()
{
// this.list = this.merchantList
this
.
getList
()
},
methods
:
{
getList
()
{
this
.
$apis
.
baseInfo
.
getDepartmentList
({}).
then
(
res
=>
{
console
.
log
(
res
[
0
].
children
)
this
.
merchantList
=
res
[
0
].
children
})
},
arrowClick
()
{
console
.
log
(
1
)
this
.
isOpen
=
true
this
.
visible
=
false
if
(
this
.
isOpen
)
{
this
.
$refs
.
departmentTree
.
visible
=
true
this
.
$refs
.
departmentTree
.
getDepartmentList
()
}
},
handleInput
:
utils
.
debounce
(
function
(
val
)
{
console
.
log
(
val
)
this
.
getSearchList
(
val
)
this
.
searchValue
=
val
this
.
getSearchList
()
},
300
),
// 获取企微门店数据
getSearchList
(
val
)
{
console
.
log
(
val
)
console
.
log
(
this
.
merchantList
)
if
(
val
)
{
this
.
merchantList
.
forEach
(
item
=>
{
if
(
item
.
children
)
{
// item.children.forEach(ite => {
// if (ite.departmentName.indexOf(val) > -1) {
// if (!ite.children && ite.relevanceMerchant) {
// this.searchList.push(ite)
// }
// }
// })
// if (item.relevanceMerchant) {
// this.searchList.push(item)
// }
this
.
filterDepartment
(
item
.
children
,
val
)
}
if
(
item
.
departmentName
.
indexOf
(
val
)
>
-
1
)
{
if
(
item
.
relevanceMerchant
)
{
this
.
searchList
.
push
(
item
)
}
}
// 根据输入内容搜索企微门店数据
getSearchList
()
{
console
.
log
(
this
.
searchValue
)
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
pageParams
))
params
.
departmentName
=
this
.
searchValue
console
.
log
(
params
)
if
(
this
.
searchValue
)
{
this
.
$apis
.
baseInfo
.
findDepartmentList
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
searchList
.
push
(
res
.
data
)
this
.
pageParams
.
pageNum
++
})
}
else
{
this
.
searchList
=
[]
...
...
@@ -173,24 +98,6 @@ export default {
console
.
log
(
this
.
searchList
)
this
.
visible
=
!
this
.
visible
},
// 过滤搜索企微门店数据
filterDepartment
(
item
,
val
)
{
console
.
log
(
item
)
item
.
forEach
(
ite
=>
{
if
(
ite
.
children
)
{
if
(
item
.
relevanceMerchant
)
{
this
.
searchList
.
push
(
item
)
}
this
.
filterDepartment
(
ite
.
children
,
val
)
}
if
(
ite
.
departmentName
.
indexOf
(
val
)
>
-
1
)
{
if
(
ite
.
relevanceMerchant
)
{
this
.
searchList
.
push
(
ite
)
}
}
})
console
.
log
(
this
.
searchList
)
},
selectItem
(
val
)
{
console
.
log
(
val
)
this
.
searchKey
=
val
...
...
@@ -205,12 +112,13 @@ export default {
this
.
$emit
(
'getCurDepartment'
,
val
.
first
)
},
handleBlur
()
{
//
this.visible = false
//
this.searchKey = ''
//
this.searchList = []
this
.
visible
=
false
this
.
searchKey
=
''
this
.
searchList
=
[]
},
load
()
{
// this.searchList.push(`Aaaaa${this.count++}`)
this
.
getSearchList
()
}
}
}
...
...
@@ -253,6 +161,7 @@ export default {
}
.el-cascader__suggestion-list
{
overflow
:
auto
;
width
:
300px
;
}
/
deep
/
.el-input-group__append
{
padding
:
0
;
...
...
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