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 a3b07c06
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
2 changed files
with
180 additions
and
2 deletions
src/views/account/index.vue
src/views/baseInfo/components/merchantTree.vue
src/views/account/index.vue
View file @
a3b07c0
<
template
>
<
template
>
<div
class=
"scrm-main"
>
<div
class=
"scrm-main"
>
<div
class=
"form-header"
v-if=
"$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1"
>
<div
class=
"form-header"
v-if=
"$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1"
>
<
!--
<GLButton
@
click=
"handleContact"
icon=
"el-icon-link"
fn=
"门店账户关联企微"
type=
"primary"
size=
"small"
mode=
"el-button"
>
门店账户关联企微
</GLButton>
--
>
<
GLButton
@
click=
"handleContact"
icon=
"el-icon-link"
fn=
"门店账户关联企微"
type=
"primary"
size=
"small"
mode=
"el-button"
>
门店账户关联企微
</GLButton
>
<
el-button
type=
"primary"
@
click=
"handleContact"
size=
"small"
icon=
"el-icon-link"
>
门店账户关联企微
</el-button
>
<
!--
<el-button
type=
"primary"
@
click=
"handleContact"
size=
"small"
icon=
"el-icon-link"
>
门店账户关联企微
</el-button>
--
>
</div>
</div>
<div
class=
"follow-form"
>
<div
class=
"follow-form"
>
<GLCombiForm
:formObj=
"searchForm"
:searchSelectObj=
"searchSelectObj"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
<GLCombiForm
:formObj=
"searchForm"
:searchSelectObj=
"searchSelectObj"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
></GLCombiForm>
...
...
src/views/baseInfo/components/merchantTree.vue
0 → 100644
View file @
a3b07c0
<!--
* @Description: 选择层级的树结构
* @Author: huyue
* @Date: 2022-04-28 10:15:34
* @LastEditors: huyue
* @LastEditTime: 2022-05-18 18:06:35
-->
<
template
>
<div>
<GLDialog
class=
"tree-dialog"
:visible=
"visible"
@
close=
"handleClose"
:title=
"dialogTitle"
:showClose=
"true"
>
<div>
<div
class=
"el-breadcrumb"
>
<span
class=
"el-breadcrumb__item"
>
<span
class=
"el-breadcrumb__inner"
style=
"cursor: context-menu"
>
{{
$globalState
.
session
.
merchantName
}}
</span>
<i
class=
"el-breadcrumb__separator el-icon-arrow-right"
></i>
</span>
<span
class=
"el-breadcrumb__item"
v-for=
"item in selectLevel"
:key=
"item.departmentId"
@
click=
"backLevel(item)"
>
<span
class=
"el-breadcrumb__inner"
>
{{
item
.
departmentName
}}
</span>
<i
class=
"el-breadcrumb__separator el-icon-arrow-right"
></i>
</span>
<span
class=
"el-breadcrumb__item last-level"
v-if=
"lastLevel"
>
<span
class=
"el-breadcrumb__inner"
>
请选择下级组织结构
</span>
<i
class=
"el-breadcrumb__separator el-icon-arrow-right"
></i>
</span>
</div>
<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.departmentId"
@
click
.
self=
"toNext(item, $event)"
>
<el-radio
:label=
"item"
:disabled=
"!item.relevanceMerchant"
>
{{
item
.
departmentName
}}
</el-radio>
<i
v-show=
"item.childrenNum"
class=
"el-icon-arrow-right"
></i>
</div>
</el-radio-group>
</div>
</div>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
提交
</el-button>
</div>
</GLDialog>
</div>
</
template
>
<
script
>
export
default
{
name
:
'MerchantTree'
,
data
()
{
return
{
visible
:
false
,
dialogTitle
:
'选择商户账户'
,
listHeight
:
220
,
departmentList
:
[],
parentMerchantList
:
[],
subSubMerchantList
:
[],
checkObj
:
{
first
:
''
},
// 选中的用来展示面包屑
selectLevel
:
[
// {
// merchantId: this.$globalState.session.merchantId,
// merchantName: this.$globalState.session.merchantName,
// level: 0
// }
],
lastLevel
:
true
// 是否显示请选择
}
},
mounted
()
{
this
.
getDepartmentList
()
},
methods
:
{
// 获取门店数据
getDepartmentList
(
depth
,
id
)
{
var
params
=
{}
depth
?
(
params
.
depth
=
depth
)
:
(
params
.
depth
=
0
)
if
(
id
)
{
params
.
departmentId
=
id
}
this
.
$apis
.
baseInfo
.
getDepartment
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
departmentList
=
res
console
.
log
(
this
.
departmentList
)
})
},
handleClose
()
{
this
.
visible
=
false
},
submit
()
{
console
.
log
(
this
.
checkObj
)
if
(
!
this
.
checkObj
)
{
this
.
$message
({
message
:
'请选择门店'
,
type
:
'warning'
})
return
}
this
.
$emit
(
'select'
,
this
.
checkObj
)
this
.
visible
=
false
},
// 选中时触发
selectChange
(
val
)
{
console
.
log
(
val
)
this
.
$set
(
this
.
selectLevel
,
val
.
depth
-
1
,
val
)
// this.lastLevel = false
val
.
childrenNum
?
(
this
.
lastLevel
=
true
)
:
(
this
.
lastLevel
=
false
)
// this.lastLevel = val.hasChildren
},
// 跳转下一级,需判断是否有下一级
toNext
(
item
,
event
)
{
console
.
log
(
item
,
this
.
checkObj
,
event
)
console
.
log
(
item
.
departmentId
)
if
(
item
.
childrenNum
)
{
this
.
checkObj
.
first
=
''
this
.
lastLevel
=
true
this
.
getDepartmentList
(
item
.
depth
,
item
.
id
)
this
.
selectLevel
[
item
.
depth
-
1
]
=
item
console
.
log
(
this
.
selectLevel
)
}
},
// 点击页签,返回
backLevel
(
item
)
{
console
.
log
(
item
)
this
.
checkObj
.
first
=
''
item
.
childrenNum
?
(
this
.
lastLevel
=
true
)
:
(
this
.
lastLevel
=
false
)
console
.
log
(
this
.
selectLevel
)
this
.
selectLevel
=
this
.
selectLevel
.
slice
(
0
,
item
.
depth
-
1
)
this
.
getDepartmentList
(
item
.
depth
-
1
)
console
.
log
(
this
.
selectLevel
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.el-breadcrumb
{
line-height
:
28px
;
}
.el-radio__label
{
color
:
#333
;
}
.tree-dialog
{
/deep/
{
.last-level
{
.el-breadcrumb__inner
{
color
:
#5850ff
;
}
}
.el-breadcrumb__inner
{
font-weight
:
normal
;
cursor
:
pointer
;
}
.el-dialog__body
{
padding
:
20px
;
}
}
}
.tree
{
&-list
{
margin-top
:
10px
;
overflow
:
auto
;
.el-radio-group
{
width
:
100%
;
}
}
&
-item
{
padding
:
15px
0
11px
;
border-top
:
1px
solid
#e6e6e6
;
width
:
100%
;
display
:
flex
;
justify-content
:
space-between
;
i
{
font-size
:
12px
;
}
}
}
</
style
>
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