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 75b7be57
authored
May 20, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商户账户交互调整
1 parent
8bcd1f82
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
26 deletions
src/views/baseInfo/components/departmentTree.vue
src/views/baseInfo/components/merchantTree.vue
src/views/baseInfo/components/search.vue
src/views/baseInfo/relevance.vue
src/views/baseInfo/components/departmentTree.vue
View file @
75b7be5
...
...
@@ -92,7 +92,7 @@ export default {
},
submit
()
{
console
.
log
(
this
.
checkObj
)
if
(
!
this
.
checkObj
)
{
if
(
!
this
.
checkObj
.
first
)
{
this
.
$message
({
message
:
'请选择门店'
,
type
:
'warning'
...
...
src/views/baseInfo/components/merchantTree.vue
View file @
75b7be5
...
...
@@ -27,9 +27,9 @@
<div>
<div
class=
"tree-list"
:style=
"
{ height: listHeight + 'px' }">
<el-radio-group
v-model=
"checkObj.first"
@
change=
"selectChange"
>
<div
class=
"tree-item"
v-for=
"item in
departmentList"
:key=
"item.departme
ntId"
@
click
.
self=
"toNext(item, $event)"
>
<el-radio
:label=
"item"
:disabled=
"
!item.relevanceMerchant"
>
{{
item
.
departme
ntName
}}
</el-radio>
<i
v-show=
"item.
childrenNum
"
class=
"el-icon-arrow-right"
></i>
<div
class=
"tree-item"
v-for=
"item in
merchantList"
:key=
"item.mercha
ntId"
@
click
.
self=
"toNext(item, $event)"
>
<el-radio
:label=
"item"
:disabled=
"
item.hasChildren"
>
{{
item
.
mercha
ntName
}}
</el-radio>
<i
v-show=
"item.
hasChildren
"
class=
"el-icon-arrow-right"
></i>
</div>
</el-radio-group>
</div>
...
...
@@ -50,8 +50,53 @@ export default {
visible
:
false
,
dialogTitle
:
'选择商户账户'
,
listHeight
:
220
,
departmentList
:
[],
parentMerchantList
:
[],
merchantList
:
[],
parentMerchantList
:
[
{
merchantId
:
1
,
merchantName
:
'测试10001'
,
parentMerchantName
:
''
,
hasChildren
:
false
,
level
:
1
,
disabled
:
true
},
{
merchantId
:
2
,
merchantName
:
'嘀加智慧平台-公共商户'
,
parentMerchantName
:
'嘀加公共市代商户'
,
hasChildren
:
true
,
level
:
1
,
disabled
:
true
},
{
merchantId
:
3
,
merchantName
:
'深圳南山崇文园区奥迪4S店'
,
parentMerchantName
:
'嘀加公共市代商户'
,
level
:
1
,
hasChildren
:
false
},
{
merchantId
:
4
,
merchantName
:
'南山智园崇文园区'
,
parentMerchantName
:
'嘀加公共市代商户'
,
level
:
1
,
hasChildren
:
false
},
{
merchantId
:
5
,
merchantName
:
'深圳世界之窗'
,
parentMerchantName
:
'嘀加公共市代商户'
,
level
:
1
,
hasChildren
:
false
},
{
merchantId
:
6
,
merchantName
:
'大众进口商务车中心'
,
parentMerchantName
:
'嘀加公共市代商户'
,
level
:
1
,
hasChildren
:
false
}
],
subSubMerchantList
:
[],
checkObj
:
{
first
:
''
...
...
@@ -68,11 +113,12 @@ export default {
}
},
mounted
()
{
this
.
getDepartmentList
()
// this.getMerchantList()
this
.
merchantList
=
this
.
parentMerchantList
},
methods
:
{
// 获取门店数据
get
Departme
ntList
(
depth
,
id
)
{
get
Mercha
ntList
(
depth
,
id
)
{
var
params
=
{}
depth
?
(
params
.
depth
=
depth
)
:
(
params
.
depth
=
0
)
if
(
id
)
{
...
...
@@ -80,8 +126,8 @@ export default {
}
this
.
$apis
.
baseInfo
.
getDepartment
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
departme
ntList
=
res
console
.
log
(
this
.
departme
ntList
)
this
.
mercha
ntList
=
res
console
.
log
(
this
.
mercha
ntList
)
})
},
handleClose
()
{
...
...
@@ -89,14 +135,14 @@ export default {
},
submit
()
{
console
.
log
(
this
.
checkObj
)
if
(
!
this
.
checkObj
)
{
if
(
!
this
.
checkObj
.
first
)
{
this
.
$message
({
message
:
'请选择
门店
'
,
message
:
'请选择
商户账户
'
,
type
:
'warning'
})
return
}
this
.
$emit
(
'select'
,
this
.
checkObj
)
this
.
$emit
(
'select
Merchant
'
,
this
.
checkObj
)
this
.
visible
=
false
},
// 选中时触发
...
...
src/views/baseInfo/components/search.vue
View file @
75b7be5
...
...
@@ -22,26 +22,35 @@
<li>
无数据
</li>
</
template
>
</ul>
<el-input
slot=
"reference"
debounce
style=
"width: 320px"
v-model=
"searchKey.departmentName"
:size=
"size"
@
input=
"handleInput"
@
focus=
"handleFocus"
placeholder=
"请输入内容
"
>
<el-input
slot=
"reference"
debounce
style=
"width: 320px"
v-model=
"searchKey.departmentName"
:size=
"size"
@
input=
"handleInput"
@
focus=
"handleFocus"
:placeholder=
"type
"
>
<!-- <i slot="suffix" class="el-input__icon el-icon-arrow-down" :class="isOpen ? 'is-focus' : ''"></i> -->
<
template
slot=
"append"
>
<div
class=
"input_append"
@
click
.
stop=
"arrowClick"
>
<div
class=
"input_append"
@
click
.
stop=
"arrowClick
()
"
>
<img
src=
"@/assets/add_merchant.png"
alt=
""
/>
</div>
</
template
>
</el-input>
</el-popover>
<DepartmentTree
ref=
"departmentTree"
@
select=
"select"
></DepartmentTree>
<MerchantTree
ref=
"merchantTree"
@
selectMerchant=
"selectMerchant"
></MerchantTree>
</div>
</template>
<
script
>
import
{
utils
}
from
'glsx-common'
import
DepartmentTree
from
'./departmentTree.vue'
import
MerchantTree
from
'./merchantTree.vue'
export
default
{
name
:
'SearchSelect'
,
components
:
{
DepartmentTree
DepartmentTree
,
MerchantTree
},
props
:
{
name
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
...
...
@@ -50,7 +59,7 @@ export default {
id
:
''
,
departmentName
:
''
},
// 绑定input的值
isOpen
:
false
,
//
isOpen: false,
visible
:
false
,
isCheck
:
false
,
departmentList
:
[],
// 接口返回数据
...
...
@@ -69,9 +78,15 @@ export default {
},
methods
:
{
arrowClick
()
{
console
.
log
(
this
.
name
)
this
.
isOpen
=
true
this
.
visible
=
false
if
(
this
.
isOpen
)
{
if
(
this
.
name
===
'merchant'
)
{
this
.
$refs
.
merchantTree
.
visible
=
true
// this.$refs.merchantTree.getMerchantList()
return
}
this
.
$refs
.
departmentTree
.
visible
=
true
this
.
$refs
.
departmentTree
.
getDepartmentList
()
}
...
...
@@ -116,6 +131,7 @@ export default {
this
.
visible
=
false
this
.
$emit
(
'getCurDepartment'
,
val
)
},
// 选择企微门店
select
(
val
)
{
console
.
log
(
val
)
// this.searchKey = {
...
...
@@ -126,6 +142,13 @@ export default {
this
.
searchKey
.
departmentName
=
val
.
first
.
departmentName
this
.
$emit
(
'getCurDepartment'
,
val
.
first
)
},
// 选择商户账户
selectMerchant
(
val
)
{
console
.
log
(
val
)
this
.
searchKey
.
id
=
val
.
first
.
merchantId
+
''
this
.
searchKey
.
departmentName
=
val
.
first
.
merchantName
this
.
$emit
(
'getCurMerchant'
,
val
.
first
)
},
handleBlur
()
{
this
.
visible
=
false
// this.searchKey = {}
...
...
src/views/baseInfo/relevance.vue
View file @
75b7be5
...
...
@@ -14,13 +14,14 @@
</div>
<div
class=
"select_wrapper"
>
<div
class=
"label"
>
商户账户
</div>
<el-cascader
ref=
"cascaderRef1"
placeholder=
"请选择商户/门店"
@
change=
"getCurMerchant"
:show-all-levels=
"false"
v-model=
"shopName"
:props=
"mypropParam1"
:options=
"shopList"
size=
"small"
style=
"width: 320px"
separator=
" "
filterable
>
<SearchSelect
@
getCurMerchant=
"getCurMerchant"
:name=
"componentsName"
></SearchSelect>
<!--
<el-cascader
ref=
"cascaderRef1"
placeholder=
"请选择商户/门店"
@
change=
"getCurMerchant"
:show-all-levels=
"false"
v-model=
"shopName"
:props=
"mypropParam1"
:options=
"shopList"
size=
"small"
style=
"width: 320px"
separator=
" "
filterable
>
<template
slot-scope=
"
{ data }">
<el-tooltip
popper-class=
"myToolTipClass"
style=
"border: none"
:disabled=
"data.label.length > 12 ? false : true"
class=
"item"
effect=
"light"
:content=
"data.label"
placement=
"top-end"
>
<div
class=
"limitText"
style=
"width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
>
{{
data
.
label
}}
</div>
</el-tooltip>
</
template
>
</el-cascader>
</el-cascader>
-->
</div>
</div>
<div
class=
"icon_wrap"
>
...
...
@@ -35,7 +36,7 @@
</div>
<div
class=
"select_wrapper"
>
<div
class=
"label"
>
企业微信
</div>
<SearchSelect
@
getCurDepartment=
"getCurDepartment"
></SearchSelect>
<SearchSelect
@
getCurDepartment=
"getCurDepartment"
:name=
"componentsName1"
></SearchSelect>
<!-- <el-cascader ref="cascaderRef" @change="getCurDepartment" placeholder="请选择企微门店" :show-all-levels="false" v-model="selectedDepartment" :props="mypropsParam" :options="departmentList" size="small" style="width: 320px" separator=" " filterable>
<template slot-scope="{ data }">
<el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.departmentName.length > 12 ? false : true" class="item" effect="light" :content="data.departmentName" placement="top-end">
...
...
@@ -119,6 +120,8 @@ export default {
},
data
()
{
return
{
componentsName
:
'merchant'
,
componentsName1
:
'department'
,
departmentList
:
[],
shopList
:
[],
qwShop
:
''
,
...
...
@@ -166,14 +169,19 @@ export default {
},
// 获取当前选择的商户
getCurMerchant
(
val
)
{
let
id
=
val
[
val
.
length
-
1
]
let
labels
=
this
.
$refs
.
cascaderRef1
.
getCheckedNodes
()[
0
].
pathLabels
let
curLabel
=
labels
[
labels
.
length
-
1
]
console
.
log
(
val
,
'---'
)
this
.
curTempMerchant
=
{
merchantId
:
i
d
,
merchantName
:
curLabel
merchantId
:
val
.
merchantI
d
,
merchantName
:
val
.
merchantName
}
this
.
$refs
.
cascaderRef1
.
dropDownVisible
=
false
// let id = val[val.length - 1]
// let labels = this.$refs.cascaderRef1.getCheckedNodes()[0].pathLabels
// let curLabel = labels[labels.length - 1]
// this.curTempMerchant = {
// merchantId: id,
// merchantName: curLabel
// }
// this.$refs.cascaderRef1.dropDownVisible = false
},
// 获取当前选择的部门
getCurDepartment
(
val
)
{
...
...
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