Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
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 a710fcda
authored
Nov 10, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
hebing
2 parents
11b4c883
1030837a
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2380 additions
and
2484 deletions
html/employee/add.html
html/employee/detail.html
html/employee/index.html
html/employee/validPeriod.html
html/merchant/add.html
html/merchant/addSubMerchant.html
html/merchant/detail.html
html/merchant/edit.html
html/merchant/index.html
html/merchant/validPeriodForm.html
html/role/add.html
html/role/detail.html
html/role/index.html
html/role/tree.html
js/gtree.js
js/helper.js
js/treeTab.js
html/employee/add.html
View file @
a710fcd
...
...
@@ -287,7 +287,6 @@
radio
:
true
,
data
:
[],
on
:
function
(
data
)
{
console
.
log
(
data
)
merchantId
=
data
.
change
[
0
].
id
getList
(
merchantId
)
}
...
...
@@ -387,7 +386,6 @@
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
console
.
log
(
data
)
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
layer
.
msg
(
'可见商户必选'
,
{
icon
:
2
...
...
@@ -415,7 +413,6 @@
}
var
params
=
helper
.
clone
(
true
,
data
.
field
,
otherParams
)
delete
params
.
merhcnatImg
console
.
log
(
params
)
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
...
...
@@ -434,7 +431,6 @@
// select 选择触发
form
.
on
(
'select(merchants)'
,
function
(
data
)
{
console
.
log
(
data
.
value
)
merchantId
=
data
.
value
getList
(
merchantId
)
})
...
...
@@ -488,7 +484,6 @@
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
.
data
)
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
...
...
@@ -527,7 +522,6 @@
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
pwd
.
attr
(
'readonly'
,
true
)
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
var
data
=
res
.
data
employeeForm
=
{
...
...
@@ -556,7 +550,6 @@
// var visibleInferiorMerArr = [32, 38]
callback
(
visibleInferiorMerArr
)
}
console
.
log
(
employeeForm
,
merchantFileRequest
)
form
.
val
(
'employeeForm'
,
employeeForm
)
form
.
render
(
'select'
)
})
...
...
html/employee/detail.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<title>
员工管理
</title>
</head>
<style>
.sub-bg-white
{
width
:
100%
;
background-color
:
#f4f5fa
;
padding-top
:
8px
;
}
.sub-title
{
margin-top
:
21px
;
}
.content-title
{
margin-bottom
:
20px
;
}
.fixed-btn
{
position
:
fixed
;
right
:
10px
;
bottom
:
20px
;
background-color
:
#409eff
;
border-radius
:
20px
;
text-align
:
center
;
}
.fixed-btn
a
{
display
:
block
;
width
:
40px
;
padding
:
5px
;
color
:
#fff
;
border-bottom
:
1px
solid
#fff
;
}
.fixed-btn
a
:last-child
{
border-bottom
:
none
;
}
.topwrap
,
.topmidwrap
,
.topbottomwrap
,
.bottomwrap
{
/* margin: 0 20px 0; */
background-color
:
#fff
;
position
:
relative
;
min-height
:
238px
;
}
.topwrap
,
.topmidwrap
{
/* min-height: calc(100vh - 480px); */
padding-bottom
:
10px
;
}
.topbottomwrap
{
min-height
:
calc
(
100vh
-
200px
);
}
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.layui-tab-content
{
position
:
relative
;
}
.layui-no-data
{
width
:
100%
;
height
:
500px
;
}
.layui-no-data
.no-data
{
position
:
absolute
;
top
:
50%
;
height
:
50%
;
width
:
100%
;
text-align
:
center
;
font-size
:
14px
;
line-height
:
22px
;
}
.layui-no-data
.no-data
div
{
margin-top
:
12px
;
}
.show
{
display
:
inline-block
;
}
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<title>
员工管理
</title>
</head>
<style>
.sub-bg-white
{
width
:
100%
;
background-color
:
#f4f5fa
;
padding-top
:
8px
;
}
.hide
{
display
:
none
;
}
.wrapper
.employeeDetail
.layui-this
{
color
:
#5850ff
;
background-color
:
#f4f6fc
;
}
.wrapper
,
.detail
{
padding-bottom
:
100px
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"wrapper detail"
>
<div
class=
"layui-tab layui-tab-brief"
lay-filter=
"editTab"
>
<ul
class=
"layui-tab-title employeeDetail"
>
<li
lay-id=
"1"
style=
"padding: 0; width: 90px; margin-right: 20px"
class=
"layui-this"
>
基本信息
</li>
<li
lay-id=
"2"
style=
"padding: 0; width: 90px; margin-right: 20px"
>
账户权限
</li>
<li
lay-id=
"3"
style=
"padding: 0; width: 90px"
>
修改记录
</li>
</ul>
<div
class=
"layui-tab-content"
>
<div
class=
"layui-tab-item layui-show"
>
<div
class=
"topwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"basic"
>
员工基本信息
<div
class=
"title-right"
id=
"merchantName"
></div>
</h3>
.sub-title
{
margin-top
:
21px
;
}
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
姓名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"staffName"
></div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
登录手机号:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"staffPhone"
></div>
</div>
.content-title
{
margin-bottom
:
20px
;
}
.fixed-btn
{
position
:
fixed
;
right
:
10px
;
bottom
:
20px
;
background-color
:
#409eff
;
border-radius
:
20px
;
text-align
:
center
;
}
.fixed-btn
a
{
display
:
block
;
width
:
40px
;
padding
:
5px
;
color
:
#fff
;
border-bottom
:
1px
solid
#fff
;
}
.fixed-btn
a
:last-child
{
border-bottom
:
none
;
}
.topwrap
,
.topmidwrap
,
.topbottomwrap
,
.bottomwrap
{
/* margin: 0 20px 0; */
background-color
:
#fff
;
position
:
relative
;
min-height
:
238px
;
}
.topwrap
,
.topmidwrap
{
/* min-height: calc(100vh - 480px); */
padding-bottom
:
10px
;
}
.topbottomwrap
{
min-height
:
calc
(
100vh
-
200px
);
}
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.layui-tab-content
{
position
:
relative
;
}
.layui-no-data
{
width
:
100%
;
height
:
500px
;
}
.layui-no-data
.no-data
{
position
:
absolute
;
top
:
50%
;
height
:
50%
;
width
:
100%
;
text-align
:
center
;
font-size
:
14px
;
line-height
:
22px
;
}
.layui-no-data
.no-data
div
{
margin-top
:
12px
;
}
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
.wrapper
.employeeDetail
.layui-this
{
color
:
#5850ff
;
background-color
:
#f4f6fc
;
}
.wrapper
,
.detail
{
padding-bottom
:
100px
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"wrapper detail"
>
<div
class=
"layui-tab layui-tab-brief"
lay-filter=
"editTab"
>
<ul
class=
"layui-tab-title employeeDetail"
>
<li
lay-id=
"1"
style=
"padding: 0; width: 90px; margin-right: 20px"
class=
"layui-this"
>
基本信息
</li>
<li
lay-id=
"2"
style=
"padding: 0; width: 90px; margin-right: 20px"
>
账户权限
</li>
<li
lay-id=
"3"
style=
"padding: 0; width: 90px"
>
修改记录
</li>
</ul>
<div
class=
"layui-tab-content"
>
<div
class=
"layui-tab-item layui-show"
>
<div
class=
"topwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"basic"
>
员工基本信息
<div
class=
"title-right"
id=
"merchantName"
></div>
</h3>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
姓名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"staffName"
></div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
企微号:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"entmicroName"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
登录手机号:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"staffPhone"
><
/div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职务:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"staffJob"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
企微号:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"entmicroName"
><
/div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleName"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职务:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"staffJob"
><
/div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
创建人:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"createdAccount"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"roleName"
><
/div>
</div>
</div>
<div
class=
"topmidwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"visibleMerchant"
>
可见下级商户
</h3>
<!-- <ul id="merchantTree" class="ztree wrapper-tree"></ul> -->
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
创建人:
</label>
<div
class=
"layui-input-block"
>
<
ul
id=
"visibleInferiorMerName"
></ul
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"createdAccount"
></div
>
</div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"topbottomwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"accountAuth"
>
账户权限
</h3>
<div
class=
"layui-tab tabmutiple-content"
style=
"padding: 0 20px 10px; background-color: #fff; margin-bottom: 80px"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title"
></ul>
<div
class=
"layui-tab-content"
></div>
</div>
<div
class=
"topmidwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"visibleMerchant"
>
可见下级商户
</h3>
<!-- <ul id="merchantTree" class="ztree wrapper-tree"></ul> -->
<div
class=
"layui-input-block"
>
<ul
id=
"visibleInferiorMerName"
></ul>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"bottomwrap"
style=
"margin-bottom: 80px; padding: 0 20px"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"record"
>
修改记录
</h3>
<div
class=
"layui-tab tabmutiple-content"
>
<div
class=
"table-page"
>
<table
class=
"layui-table"
id=
"recordTable"
></table>
<div
id=
"recordPage"
class=
"align-left"
></div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"topbottomwrap"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"accountAuth"
>
账户权限
</h3>
<div
class=
"layui-tab tabmutiple-content"
style=
"padding: 0 20px 10px; background-color: #fff; margin-bottom: 80px"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title"
></ul>
<div
class=
"layui-tab-content"
></div>
</div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"bottomwrap"
style=
"margin-bottom: 80px; padding: 0 20px"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title sub-title"
id=
"record"
>
修改记录
</h3>
<div
class=
"layui-tab tabmutiple-content"
>
<div
class=
"table-page"
>
<table
class=
"layui-table"
id=
"recordTable"
></table>
<div
id=
"recordPage"
class=
"align-left"
></div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"sub-bg-white"
>
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"return"
>
关闭
</button>
</div>
<!-- <div class="fixed-btn">
</div>
<div
class=
"sub-bg-white"
>
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"return"
>
关闭
</button>
</div>
<!-- <div class="fixed-btn">
<a id="basicBtn">基本信息</a>
<a id="accountAuthBtn">账户权限</a>
<a id="recordBtn">修改记录</a>
</div> -->
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'request'
,
'helper'
,
'treeTab'
,
'table'
,
'laypage'
],
function
()
{
/** 变量 */
var
$
=
layui
.
$
var
request
=
layui
.
request
var
helper
=
layui
.
helper
var
id
=
qs
(
'id'
)
var
treeTab
=
layui
.
treeTab
var
table
=
layui
.
table
var
laypage
=
layui
.
laypage
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'entmicroName'
,
'staffJob'
,
'roleName'
,
'roleCode'
,
'merchantName'
,
'createdAccount'
]
var
employeeData
=
{}
var
visibleInferiorMerName
=
$
(
'#visibleInferiorMerName'
)
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'request'
,
'helper'
,
'treeTab'
,
'table'
,
'laypage'
],
function
()
{
/** 变量 */
var
$
=
layui
.
$
var
request
=
layui
.
request
var
helper
=
layui
.
helper
var
id
=
qs
(
'id'
)
var
treeTab
=
layui
.
treeTab
var
table
=
layui
.
table
var
laypage
=
layui
.
laypage
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'entmicroName'
,
'staffJob'
,
'roleName'
,
'roleCode'
,
'merchantName'
,
'createdAccount'
]
var
employeeData
=
{}
var
visibleInferiorMerName
=
$
(
'#visibleInferiorMerName'
)
var
recordPage
=
{
pageNum
:
1
,
pageSize
:
10
}
var
recordPageOptions
=
{
elem
:
'recordPage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
recordPage
.
pageNum
=
obj
.
curr
recordPage
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getRecordTable
()
}
var
recordPage
=
{
pageNum
:
1
,
pageSize
:
10
}
var
recordPageOptions
=
{
elem
:
'recordPage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
recordPage
.
pageNum
=
obj
.
curr
recordPage
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getRecordTable
()
}
}
}
var
recordTable
=
table
.
render
({
elem
:
'#recordTable'
,
page
:
false
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
[
[
{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'operator'
,
title
:
'登录账户'
,
align
:
'center'
},
{
field
:
'productName'
,
title
:
'登录产品'
,
align
:
'center'
},
{
field
:
'ip'
,
title
:
'登录IP'
,
align
:
'center'
},
{
field
:
'modifyContent'
,
title
:
'修改内容'
,
align
:
'center'
,
width
:
220
},
{
field
:
'userName'
,
title
:
'操作人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'createdTime'
,
title
:
'操作时间'
,
align
:
'center'
,
width
:
200
}
]
var
recordTable
=
table
.
render
({
elem
:
'#recordTable'
,
page
:
false
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
[
[
{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'operator'
,
title
:
'登录账户'
,
align
:
'center'
},
{
field
:
'productName'
,
title
:
'登录产品'
,
align
:
'center'
},
{
field
:
'ip'
,
title
:
'登录IP'
,
align
:
'center'
},
{
field
:
'modifyContent'
,
title
:
'修改内容'
,
align
:
'center'
,
width
:
220
},
{
field
:
'userName'
,
title
:
'操作人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'createdTime'
,
title
:
'操作时间'
,
align
:
'center'
,
width
:
200
}
]
})
]
})
/** 调用方法 */
getById
()
getRecordTable
()
/** 调用方法 */
getById
()
getRecordTable
()
/** 触发事件 */
$
(
'#return'
).
on
(
'click'
,
function
()
{
if
(
window
.
location
.
hash
)
{
window
.
history
.
back
(
-
1
)
window
.
location
.
hash
=
''
}
/** 触发事件 */
$
(
'#return'
).
on
(
'click'
,
function
()
{
if
(
window
.
location
.
hash
)
{
window
.
history
.
back
(
-
1
)
})
window
.
location
.
hash
=
''
}
window
.
history
.
back
(
-
1
)
})
$
(
'#basicBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#basic'
).
scrollIntoView
(
true
)
})
$
(
'#basicBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#basic'
).
scrollIntoView
(
true
)
})
$
(
'#accountAuthBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#accountAuth'
).
scrollIntoView
(
true
)
})
$
(
'#accountAuthBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#accountAuth'
).
scrollIntoView
(
true
)
})
$
(
'#recordBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#record'
).
scrollIntoView
(
true
)
})
$
(
'#recordBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#record'
).
scrollIntoView
(
true
)
})
/** 定义方法 */
// 查询员工详情
function
getById
()
{
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
employeeData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
employeeData
[
basicArr
[
i
]]
?
employeeData
[
basicArr
[
i
]]
:
'无'
)
}
if
(
employeeData
.
visibleInferiorMerName
)
{
var
visibleName
=
employeeData
.
visibleInferiorMerName
.
split
(
','
)
$
.
each
(
visibleName
,
function
(
idx
,
i
)
{
visibleInferiorMerName
.
append
(
'<li class="visibleMerchant">'
+
i
+
'</li>'
)
})
}
else
{
visibleInferiorMerName
.
remove
()
}
// 账户权限
var
authList
=
employeeData
.
accountTypeTreeResponseList
console
.
log
(
authList
)
if
(
authList
&&
authList
.
length
!=
0
)
{
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
var
menuData
=
[]
// for (var i = 0; i < item.products)
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
})
console
.
log
(
authList
)
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
}
/** 定义方法 */
// 查询员工详情
function
getById
()
{
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
employeeData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
employeeData
[
basicArr
[
i
]]
?
employeeData
[
basicArr
[
i
]]
:
'无'
)
}
})
}
// 修改记录
function
getRecordTable
(
isResetPageNum
)
{
var
params
=
{
bussinessId
:
id
,
moduleName
:
'员工模块'
,
pageNum
:
recordPage
.
pageNum
,
pageSize
:
recordPage
.
pageSize
,
method
:
'cn.com.glsx.merchants.menu.findLog'
}
request
(
params
,
function
(
res
)
{
var
data
=
res
.
data
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
recordPage
.
pageSize
*
(
recordPage
.
pageNum
-
1
)
data
.
data
[
index
].
modifyContent
=
item
.
module
+
'-'
+
item
.
action
})
var
options
=
{
data
:
data
.
data
if
(
employeeData
.
visibleInferiorMerName
)
{
var
visibleName
=
employeeData
.
visibleInferiorMerName
.
split
(
','
)
$
.
each
(
visibleName
,
function
(
idx
,
i
)
{
visibleInferiorMerName
.
append
(
'<li class="visibleMerchant">'
+
i
+
'</li>'
)
})
}
else
{
visibleInferiorMerName
.
remove
()
}
recordPageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
recordPageOptions
.
curr
=
1
// 账户权限
var
authList
=
employeeData
.
accountTypeTreeResponseList
if
(
authList
&&
authList
.
length
!=
0
)
{
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
var
menuData
=
[]
// for (var i = 0; i < item.products)
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
})
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
}
laypage
.
render
(
recordPageOptions
)
recordTable
.
reload
(
options
)
})
}
})
}
// 修改记录
function
getRecordTable
(
isResetPageNum
)
{
var
params
=
{
bussinessId
:
id
,
moduleName
:
'员工模块'
,
pageNum
:
recordPage
.
pageNum
,
pageSize
:
recordPage
.
pageSize
,
method
:
'cn.com.glsx.merchants.menu.findLog'
}
})
</script>
</body>
</html>
request
(
params
,
function
(
res
)
{
var
data
=
res
.
data
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
recordPage
.
pageSize
*
(
recordPage
.
pageNum
-
1
)
data
.
data
[
index
].
modifyContent
=
item
.
module
+
'-'
+
item
.
action
})
var
options
=
{
data
:
data
.
data
}
recordPageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
recordPageOptions
.
curr
=
1
}
laypage
.
render
(
recordPageOptions
)
recordTable
.
reload
(
options
)
})
}
})
</script>
</body>
</html>
\ No newline at end of file
html/employee/index.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/employee.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<title>
员工管理
</title>
</head>
<style>
xm-select
>
.xm-body
.scroll-body
{
width
:
300px
;
}
xm-select
:hover
{
border
:
1px
solid
#5850ff
!important
;
}
.hide
{
display
:
none
;
}
.show
{
display
:
inline-block
;
}
</style>
<body>
<div
id=
"app"
>
<main>
<div>
<div
class=
"search-block"
>
<!-- layui-form-pane -->
<form
action=
""
class=
"layui-form"
lay-filter=
"employeeForm"
>
<div
class=
"layui-form-item"
>
<div
class=
"twocol"
>
<div
class=
"layui-inline"
pane
id=
"addEl"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal createBtn"
id=
"addEmployee"
>
<i
class=
"layui-icon layui-icon-addition"
></i>
<span>
创建员工
</span>
</button>
</div>
<div
class=
"layui-inline merchantNames"
pane
>
<label
class=
"layui-form-label"
>
商户名称
</label>
<div
class=
"layui-input-block"
>
<!-- <select name="merchantId" id="merchantName" lay-verify="required"></select> -->
<div
id=
"merchantNameSelect"
style=
"width: 300px"
class=
"xm-select-demo"
></div>
</div>
</div>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/employee.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<title>
员工管理
</title>
</head>
<style>
xm-select
>
.xm-body
.scroll-body
{
width
:
300px
;
}
xm-select
:hover
{
border
:
1px
solid
#5850ff
!important
;
}
.hide
{
display
:
none
;
}
.show
{
display
:
inline-block
;
}
</style>
<body>
<div
id=
"app"
>
<main>
<div>
<div
class=
"search-block"
>
<!-- layui-form-pane -->
<form
action=
""
class=
"layui-form"
lay-filter=
"employeeForm"
>
<div
class=
"layui-form-item"
>
<div
class=
"twocol"
>
<div
class=
"layui-inline"
pane
id=
"addEl"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal createBtn"
id=
"addEmployee"
>
<i
class=
"layui-icon layui-icon-addition"
></i>
<span>
创建员工
</span>
</button>
</div>
</div>
<div
class=
"divideLine"
></div>
<div
class=
"layui-form-item secondInput"
>
<div
class=
"layui-inline creater"
>
<label
class=
"layui-form-label"
>
创建者
</label>
<div
class=
"layui-inline merchantNames"
pane
>
<label
class=
"layui-form-label"
>
商户名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"createdName"
required
lay-verify=
"required"
placeholder=
"请输入创建者"
autocomplete=
"off"
class=
"layui-input"
/>
<!-- <select name="merchantId" id="merchantName" lay-verify="required"></select> -->
<div
id=
"merchantNameSelect"
style=
"width: 300px"
class=
"xm-select-demo"
></div>
</div>
</div>
<div
class=
"layui-inline roleId hide"
pane
>
<label
class=
"layui-form-label"
>
角色
</label>
<div
class=
"layui-input-block"
>
<select
name=
"roleId"
id=
"roleId"
lay-verify=
"required"
placeholder=
"请选择状态"
></select>
</div>
</div>
</div>
<div
class=
"divideLine"
></div>
<div
class=
"layui-form-item secondInput"
>
<div
class=
"layui-inline creater"
>
<label
class=
"layui-form-label"
>
创建者
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"createdName"
required
lay-verify=
"required"
placeholder=
"请输入创建者"
autocomplete=
"off"
class=
"layui-input"
/>
</div>
<div
class=
"layui-inline status"
pane
>
<label
class=
"layui-form-label"
>
状态
</label
>
<div
class=
"layui-input-block"
>
<select
name=
"status"
id=
"status"
lay-verify=
"required"
placeholder=
"请选择状态"
></select
>
<
/div
>
</div
>
<div
class=
"layui-inline roleId hide"
pane
>
<label
class=
"layui-form-label"
>
角色
</label
>
<div
class=
"layui-input-block"
>
<
select
name=
"roleId"
id=
"roleId"
lay-verify=
"required"
placeholder=
"请选择状态"
></select
>
</div>
<div
class=
"layui-inline"
pane
>
<div
class=
"layui-input-inline updateSelectAngle"
style=
"width: 100px"
>
<select
name=
"type"
lay-verify=
"required"
placeholder=
"员工姓名/手机号"
>
<option
value=
"0"
>
员工姓名
</option>
<option
value=
"1"
>
手机号
</option>
</select>
</div>
<div
class=
"layui-input-inline"
style=
"width: 250px"
>
<input
type=
"text"
name=
"keywords"
required
lay-verify=
"required"
placeholder=
"请输入"
autocomplete=
"off"
class=
"layui-input updateCircleAngle"
/>
</div>
</div>
<div
class=
"layui-inline status"
pane
>
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-block"
>
<select
name=
"status"
id=
"status"
lay-verify=
"required"
placeholder=
"请选择状态"
></select>
</div>
<div
class=
"layui-inline"
style=
"float: right"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal searchInputBtn"
id=
"employeeSearch"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal exportInputBtn"
id=
"employeeExport"
>
导出
</button>
</div>
<div
class=
"layui-inline"
pane
>
<div
class=
"layui-input-inline updateSelectAngle"
style=
"width: 100px"
>
<select
name=
"type"
lay-verify=
"required"
placeholder=
"员工姓名/手机号"
>
<option
value=
"0"
>
员工姓名
</option>
<option
value=
"1"
>
手机号
</option>
</select>
</div>
<div
class=
"layui-input-inline"
style=
"width: 250px"
>
<input
type=
"text"
name=
"keywords"
required
lay-verify=
"required"
placeholder=
"请输入"
autocomplete=
"off"
class=
"layui-input updateCircleAngle"
/>
</div>
</div>
<div
class=
"layui-inline"
style=
"float: right"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal searchInputBtn"
id=
"employeeSearch"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal exportInputBtn"
id=
"employeeExport"
>
导出
</button>
</div>
</form>
<!-- 表格 -->
<div
class=
"table-page"
>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
<div
id=
"employeePage"
class=
"align-left"
></div>
</div>
</form>
<!-- 表格 -->
<div
class=
"table-page"
>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
<div
id=
"employeePage"
class=
"align-left"
></div>
</div>
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'table'
,
'request'
,
'form'
,
'helper'
,
'laypage'
,
'xmSelect'
],
function
()
{
var
request
=
layui
.
request
var
table
=
layui
.
table
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
// var isDxternal = isAppend()
// if (isDxternal) {
// $('#addEl').remove()
// }
var
roleId
=
$
(
'#roleId'
)
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
console
.
log
(
'accountInfo'
,
accountInfo
)
if
(
accountInfo
)
{
if
(
accountInfo
.
merchantAccountLevel
==
4
)
{
$
(
'.merchantNames'
).
addClass
(
'hide'
)
}
$
(
'.creater'
).
addClass
(
'hide'
)
$
(
'.roleId'
).
removeClass
(
'hide'
)
$
(
'.roleId'
).
addClass
(
'show'
)
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'table'
,
'request'
,
'form'
,
'helper'
,
'laypage'
,
'xmSelect'
],
function
()
{
var
request
=
layui
.
request
var
table
=
layui
.
table
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
// var isDxternal = isAppend()
// if (isDxternal) {
// $('#addEl').remove()
// }
var
roleId
=
$
(
'#roleId'
)
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
if
(
accountInfo
)
{
if
(
accountInfo
.
merchantAccountLevel
==
4
)
{
$
(
'.merchantNames'
).
addClass
(
'hide'
)
}
// 商户名称列表
var
merchantName
=
$
(
'#merchantName'
)
var
status
=
$
(
'#status'
)
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
120
,
align
:
'center'
},
// { field: 'staffCode', title: '员工号', align: 'center' },
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录手机号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'entmicroName'
,
title
:
'企微号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
,
width
:
80
},
{
field
:
'createdAccount'
,
title
:
'创建者'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'商户名(商户号)'
,
align
:
'center'
,
width
:
160
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
90
},
{
title
:
'操作'
,
width
:
160
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
var
colums
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
180
,
align
:
'center'
},
// { field: 'staffCode', title: '员工号', align: 'center' },
{
field
:
'entmicroName'
,
title
:
'员工企微号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录手机号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'merchantName'
,
title
:
'所属门店'
,
align
:
'center'
,
width
:
125
,
hide
:
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
},
{
field
:
'belongingEntmicroName'
,
title
:
'所属企微'
,
align
:
'center'
,
width
:
125
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
180
},
{
title
:
'操作'
,
width
:
160
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
//创建table实例
var
employeeTable
=
table
.
render
({
elem
:
'#employeeTable'
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
accountInfo
?
[
colums
]
:
[
cols
],
done
:
function
(
res
,
curr
,
count
)
{
$
(
'.switch'
).
hover
(
function
()
{
// 鼠标移入
layer
.
tips
(
'<span style="color:#333333;font-size: 14px;font-weight: 400;">启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:\n\
$
(
'.creater'
).
addClass
(
'hide'
)
$
(
'.roleId'
).
removeClass
(
'hide'
)
$
(
'.roleId'
).
addClass
(
'show'
)
}
// 商户名称列表
var
merchantName
=
$
(
'#merchantName'
)
var
status
=
$
(
'#status'
)
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
120
,
align
:
'center'
},
// { field: 'staffCode', title: '员工号', align: 'center' },
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录手机号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'entmicroName'
,
title
:
'企微号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
,
width
:
80
},
{
field
:
'createdAccount'
,
title
:
'创建者'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'商户名(商户号)'
,
align
:
'center'
,
width
:
160
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
90
},
{
title
:
'操作'
,
width
:
160
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
var
colums
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
180
,
align
:
'center'
},
// { field: 'staffCode', title: '员工号', align: 'center' },
{
field
:
'entmicroName'
,
title
:
'员工企微号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
},
{
field
:
'staffPhone'
,
title
:
'登录手机号'
,
align
:
'center'
,
width
:
125
},
{
field
:
'merchantName'
,
title
:
'所属门店'
,
align
:
'center'
,
width
:
125
,
hide
:
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
},
{
field
:
'belongingEntmicroName'
,
title
:
'所属企微'
,
align
:
'center'
,
width
:
125
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
180
},
{
title
:
'操作'
,
width
:
160
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
//创建table实例
var
employeeTable
=
table
.
render
({
elem
:
'#employeeTable'
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
accountInfo
?
[
colums
]
:
[
cols
],
done
:
function
(
res
,
curr
,
count
)
{
$
(
'.switch'
).
hover
(
function
()
{
// 鼠标移入
layer
.
tips
(
'<span style="color:#333333;font-size: 14px;font-weight: 400;">启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:\n\
1. 角色管理-创建角色;\n\
2. 选择员工账户-修改角色</span>'
,
this
,
{
tips
:
[
4
,
'#fff'
]
}
)
},
function
()
{
// 鼠标移出
}
)
}
})
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
this
,
{
tips
:
[
4
,
'#fff'
]
}
)
},
function
()
{
// 鼠标移出
}
)
}
})
var
pageOptions
=
{
elem
:
'employeePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
)
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
limit
)
//得到每页显示的条数
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
getTabelList
(
employeeTable
,
getSearch
())
// 移入移出
}
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'employeePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
getTabelList
(
employeeTable
,
getSearch
())
// 移入移出
}
}
}
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
clickClose
:
true
,
filterable
:
true
,
radio
:
true
,
data
:
[],
on
:
function
(
data
)
{
console
.
log
(
data
)
if
(
data
.
isAdd
)
{
var
id
=
data
.
change
[
0
].
id
findRoleList
(
id
)
}
else
{
roleId
.
empty
()
form
.
render
(
'select'
)
}
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
clickClose
:
true
,
filterable
:
true
,
radio
:
true
,
data
:
[],
on
:
function
(
data
)
{
if
(
data
.
isAdd
)
{
var
id
=
data
.
change
[
0
].
id
findRoleList
(
id
)
}
else
{
roleId
.
empty
()
form
.
render
(
'select'
)
}
})
}
})
// 初始化
init
()
// 初始化
init
()
/** table工具条事件 */
table
.
on
(
'tool(employeeTool)'
,
function
(
obj
)
{
var
data
=
obj
.
data
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
go
(
'employee'
,
'add'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
})
}
else
if
(
layEvent
===
'del'
)
{
layer
.
confirm
(
'是否确认删除该员工?'
,
{
title
:
''
,
closeBtn
:
0
},
function
(
index
)
{
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
var
params
=
{
method
:
'cn.com.glsx.merchants.staff.deleteStaff'
,
id
:
data
.
id
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
close
(
index
)
console
.
log
(
'shanchu'
)
getTabelList
(
employeeTable
)
}
})
//向服务端发送删除指令
})
}
else
if
(
layEvent
===
'updateTime'
)
{
console
.
log
(
data
.
id
,
data
.
effectiveTime
)
layer
.
open
({
type
:
2
,
title
:
''
,
closeBtn
:
0
,
area
:
[
'560px'
,
'230px'
],
fixed
:
false
,
//不固定
// maxmin: true,
btn
:
[
'确定'
,
'取消'
],
content
:
'validPeriod.html?id='
+
data
.
id
+
'&effectiveTime='
+
data
.
effectiveTime
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
body
.
find
(
'#periodVerifyBtn'
).
click
()
},
end
:
function
()
{
var
isRefresh
=
helper
.
store
.
get
(
'isRefresh'
)
if
(
isRefresh
)
{
getTabelList
(
employeeTable
)
layer
.
msg
(
'修改成功'
,
{
icon
:
1
})
}
helper
.
store
.
remove
(
'isRefresh'
)
}
})
}
})
//监听性别操作
form
.
on
(
'switch(sexDemo)'
,
function
(
obj
)
{
console
.
log
(
obj
,
obj
.
elem
.
checked
)
if
(
this
.
value
==
'-'
)
{
obj
.
elem
.
checked
=
!
obj
.
elem
.
checked
form
.
render
(
'checkbox'
)
layer
.
msg
(
'您还未给该员工设置“角色”!\n\
设置角色:员工账户管理-修改-角色权限'
,
{
time
:
2000
})
}
else
{
const
param
=
{
id
:
obj
.
elem
.
dataset
.
id
,
status
:
obj
.
elem
.
checked
?
0
:
2
/** table工具条事件 */
table
.
on
(
'tool(employeeTool)'
,
function
(
obj
)
{
var
data
=
obj
.
data
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
go
(
'employee'
,
'add'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
})
}
else
if
(
layEvent
===
'del'
)
{
layer
.
confirm
(
'是否确认删除该员工?'
,
{
title
:
''
,
closeBtn
:
0
},
function
(
index
)
{
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
var
params
=
{
method
:
'cn.com.glsx.merchants.staff.deleteStaff'
,
id
:
data
.
id
}
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.updateStatus'
},
param
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
,
true
)
layer
.
close
(
index
)
getTabelList
(
employeeTable
)
}
})
}
})
/** 手动触发事件 */
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
console
.
log
(
searchData
)
getTabelList
(
employeeTable
,
searchData
,
true
)
})
// 新增点击事件
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
go
(
'employee'
,
'add'
)
})
// 导出
$
(
'#employeeExport'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.exportData'
},
searchData
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
window
.
open
(
res
.
data
)
}
//向服务端发送删除指令
})
})
/** 定义方法 */
// 初始化方法
function
init
()
{
findAllMerchant
()
findAllDictData
()
getTabelList
(
employeeTable
)
}
// 获取table列表接口
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
page
.
pageNum
,
pageSize
:
page
.
pageSize
,
method
:
'cn.com.glsx.merchants.staff.findStaffByPage'
}
else
if
(
layEvent
===
'updateTime'
)
{
layer
.
open
({
type
:
2
,
title
:
''
,
closeBtn
:
0
,
area
:
[
'560px'
,
'230px'
],
fixed
:
false
,
//不固定
// maxmin: true,
btn
:
[
'确定'
,
'取消'
],
content
:
'validPeriod.html?id='
+
data
.
id
+
'&effectiveTime='
+
data
.
effectiveTime
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
body
.
find
(
'#periodVerifyBtn'
).
click
()
},
search
)
request
(
params
,
function
(
res
)
{
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
var
options
=
{
data
:
data
.
data
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
pageOptions
.
curr
=
1
}
laypage
.
render
(
pageOptions
)
employeeTable
.
reload
(
options
)
})
}
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
.
data
)
if
(
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
)
{
console
.
log
(
result
.
data
[
0
].
id
)
findRoleList
(
result
.
data
[
0
].
id
)
}
else
{
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
paging
:
result
.
data
.
length
>
20
})
end
:
function
()
{
var
isRefresh
=
helper
.
store
.
get
(
'isRefresh'
)
if
(
isRefresh
)
{
getTabelList
(
employeeTable
)
layer
.
msg
(
'修改成功'
,
{
icon
:
1
})
}
helper
.
store
.
remove
(
'isRefresh'
)
}
})
}
})
// 查询角色权限列表
function
findRoleList
(
merchantId
)
{
var
params
=
{
method
:
'org.ore.api.role.list'
,
id
:
merchantId
,
delFlag
:
0
}
//监听性别操作
form
.
on
(
'switch(sexDemo)'
,
function
(
obj
)
{
if
(
this
.
value
==
'-'
)
{
obj
.
elem
.
checked
=
!
obj
.
elem
.
checked
form
.
render
(
'checkbox'
)
layer
.
msg
(
'您还未给该员工设置“角色”!\n\
设置角色:员工账户管理-修改-角色权限'
,
{
time
:
2000
})
}
else
{
const
param
=
{
id
:
obj
.
elem
.
dataset
.
id
,
status
:
obj
.
elem
.
checked
?
0
:
2
}
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.updateStatus'
},
param
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
var
list
=
res
.
data
roleId
.
empty
()
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
roleId
.
append
(
new
Option
(
item
.
roleName
,
item
.
id
))
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
form
.
render
(
'select'
)
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
,
true
)
}
})
}
})
// 搜索
function
getSearch
()
{
var
formVal
=
form
.
val
(
'employeeForm'
)
var
searchData
=
helper
.
clone
(
false
,
formVal
)
if
(
searchData
.
type
==
0
)
{
searchData
.
staffName
=
formVal
.
keywords
searchData
.
staffPhone
=
''
}
else
if
(
searchData
.
type
==
1
)
{
searchData
.
staffName
=
''
searchData
.
staffPhone
=
formVal
.
keywords
}
else
{
searchData
.
staffName
=
''
searchData
.
staffPhone
=
''
/** 手动触发事件 */
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
,
true
)
})
// 新增点击事件
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
go
(
'employee'
,
'add'
)
})
// 导出
$
(
'#employeeExport'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.exportData'
},
searchData
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
window
.
open
(
res
.
data
)
}
delete
searchData
.
type
delete
searchData
.
keywords
return
searchData
}
})
})
function
findAllDictData
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllDictData'
,
dictType
:
'staff_status'
/** 定义方法 */
// 初始化方法
function
init
()
{
findAllMerchant
()
findAllDictData
()
getTabelList
(
employeeTable
)
}
// 获取table列表接口
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
page
.
pageNum
,
pageSize
:
page
.
pageSize
,
method
:
'cn.com.glsx.merchants.staff.findStaffByPage'
},
search
)
request
(
params
,
function
(
res
)
{
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
var
options
=
{
data
:
data
.
data
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
var
list
=
res
.
data
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
status
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
pageOptions
.
curr
=
1
}
laypage
.
render
(
pageOptions
)
employeeTable
.
reload
(
options
)
})
}
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
if
(
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
)
{
findRoleList
(
result
.
data
[
0
].
id
)
}
else
{
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
paging
:
result
.
data
.
length
>
20
})
form
.
render
(
'select'
)
}
})
}
})
}
// 查询角色权限列表
function
findRoleList
(
merchantId
)
{
var
params
=
{
method
:
'org.ore.api.role.list'
,
id
:
merchantId
,
delFlag
:
0
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
var
list
=
res
.
data
roleId
.
empty
()
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
roleId
.
append
(
new
Option
(
item
.
roleName
,
item
.
id
))
})
form
.
render
(
'select'
)
}
})
}
// 搜索
function
getSearch
()
{
var
formVal
=
form
.
val
(
'employeeForm'
)
var
searchData
=
helper
.
clone
(
false
,
formVal
)
if
(
searchData
.
type
==
0
)
{
searchData
.
staffName
=
formVal
.
keywords
searchData
.
staffPhone
=
''
}
else
if
(
searchData
.
type
==
1
)
{
searchData
.
staffName
=
''
searchData
.
staffPhone
=
formVal
.
keywords
}
else
{
searchData
.
staffName
=
''
searchData
.
staffPhone
=
''
}
})
</script>
<script
type=
"text/html"
id=
"employeeBar"
>
delete
searchData
.
type
delete
searchData
.
keywords
return
searchData
}
function
findAllDictData
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllDictData'
,
dictType
:
'staff_status'
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
var
list
=
res
.
data
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
status
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
})
form
.
render
(
'select'
)
}
})
}
})
</script>
<script
type=
"text/html"
id=
"employeeBar"
>
<
div
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"detail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
...
...
@@ -456,11 +452,13 @@
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"updateTime"
>
修改账户有效期
<
/a
>
<
/div> --
>
</script>
<script
type=
"text/html"
id=
"switchTpl"
>
<script
type=
"text/html"
id=
"switchTpl"
>
<!--
这里的
checked
的状态只是演示
-->
<
div
class
=
"switch"
>
<
input
type
=
"checkbox"
name
=
"sex"
value
=
"{{d.roleName}}"
data
-
id
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"开|关"
lay
-
filter
=
"sexDemo"
{{
d
.
status
==
0
?
'checked'
:
''
}}
>
<
/div
>
</script>
</body>
</html>
<
div
class
=
"switch"
>
<
input
type
=
"checkbox"
name
=
"sex"
value
=
"{{d.roleName}}"
data
-
id
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"开|关"
lay
-
filter
=
"sexDemo"
{{
d
.
status
==
0
?
'checked'
:
''
}}
>
<
/div
>
</script>
</body>
</html>
\ No newline at end of file
html/employee/validPeriod.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
.valid-period
{
text-align
:
center
;
padding
:
20px
20px
;
background-color
:
#ffffff
;
}
</style>
<title>
修改有效期
</title>
</head>
<body>
<div
id=
"app"
>
<main
class=
"valid-period"
>
<form
class=
"layui-form"
lay-filter=
"periodFilter"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-label required"
style=
"width: 120px"
>
账户有效期:
</div>
<div
class=
"layui-input-inline"
style=
"width: auto"
>
<select
name=
"effectiveTime"
id=
"periodSelect"
required
lay-verify=
"required"
>
<option
value=
""
>
请选择
</option>
</select>
<p
class=
"input-downtips"
>
(注:永久有效不超过所属工厂商户的有效期)
</p>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none"
></button>
<!-- <div class="layui-form-item" style="padding: 40px 20px;">
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
.valid-period
{
text-align
:
center
;
padding
:
20px
20px
;
background-color
:
#ffffff
;
}
</style>
<title>
修改有效期
</title>
</head>
<body>
<div
id=
"app"
>
<main
class=
"valid-period"
>
<form
class=
"layui-form"
lay-filter=
"periodFilter"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-label required"
style=
"width: 120px"
>
账户有效期:
</div>
<div
class=
"layui-input-inline"
style=
"width: auto"
>
<select
name=
"effectiveTime"
id=
"periodSelect"
required
lay-verify=
"required"
>
<option
value=
""
>
请选择
</option>
</select>
<p
class=
"input-downtips"
>
(注:永久有效不超过所属工厂商户的有效期)
</p>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none"
></button>
<!-- <div class="layui-form-item" style="padding: 40px 20px;">
<div class="layui-input-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="validSubmit">立即提交</button>
<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary">重置</button>
</div>
</div> -->
</div>
</form>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'request'
,
'helper'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
</div>
</form>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'request'
,
'helper'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
vaildData
=
{
id
:
getQueryString
(
'id'
),
effectiveTime
:
getQueryString
(
'effectiveTime'
)
}
var
vaildData
=
{
id
:
getQueryString
(
'id'
),
effectiveTime
:
getQueryString
(
'effectiveTime'
)
}
getVaildPeriod
()
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
console
.
log
(
data
.
field
,
vaildData
)
// 调接口
var
params
=
{
method
:
'cn.com.glsx.merchants.staff.updateValPerByStaffId'
,
effectiveTime
:
data
.
field
.
effectiveTime
,
id
:
vaildData
.
id
getVaildPeriod
()
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
// 调接口
var
params
=
{
method
:
'cn.com.glsx.merchants.staff.updateValPerByStaffId'
,
effectiveTime
:
data
.
field
.
effectiveTime
,
id
:
vaildData
.
id
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
return
false
})
return
false
})
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
])
}
return
null
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
])
}
return
null
}
// 获取有效期
function
getVaildPeriod
()
{
request
(
{
method
:
'cn.com.glsx.merchants.menu.findAllDictData'
,
dictType
:
'staff_validity_period'
},
function
(
res
)
{
if
(
res
.
code
===
'0'
)
{
baseData
.
effectiveTimeList
=
res
.
data
var
periodSelect
=
$
(
'#periodSelect'
)
$
.
each
(
baseData
.
effectiveTimeList
,
function
(
index
,
item
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
})
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
vaildData
.
effectiveTime
})
console
.
log
(
vaildData
.
effectiveTime
)
form
.
render
(
'select'
)
}
// 获取有效期
function
getVaildPeriod
()
{
request
(
{
method
:
'cn.com.glsx.merchants.menu.findAllDictData'
,
dictType
:
'staff_validity_period'
},
function
(
res
)
{
if
(
res
.
code
===
'0'
)
{
baseData
.
effectiveTimeList
=
res
.
data
var
periodSelect
=
$
(
'#periodSelect'
)
$
.
each
(
baseData
.
effectiveTimeList
,
function
(
index
,
item
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
})
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
vaildData
.
effectiveTime
})
form
.
render
(
'select'
)
}
)
}
})
</script>
</body>
</html>
}
)
}
})
</script>
</body>
</html>
\ No newline at end of file
html/merchant/add.html
View file @
a710fcd
...
...
@@ -624,7 +624,6 @@
format
:
'yyyy-MM-dd'
,
min
:
'2021-09-30'
,
done
:
function
(
value
,
date
)
{
console
.
log
(
value
,
date
)
expireDate
.
config
.
min
=
date
lay
(
'#effectiveStarttime'
).
html
(
value
)
}
...
...
@@ -715,7 +714,6 @@
form
.
on
(
'submit(handleFirstSubmit)'
,
function
(
data
)
{
// document.querySelector('#basic').scrollIntoView(true)
console
.
log
(
data
)
var
formData
=
data
.
field
var
params
=
{
isloginName
:
0
...
...
@@ -996,7 +994,6 @@
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
startTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1004,7 +1001,6 @@
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1012,7 +1008,6 @@
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1504,7 +1499,6 @@
},
// tab Change
tabChange
:
function
(
name
,
id
)
{
console
.
log
(
name
,
id
)
element
.
tabChange
(
name
,
id
)
if
(
name
==
'roleAuth'
)
{
$
(
`#nomenu
${
id
}
`
).
html
(
'请选择产品'
)
...
...
@@ -1547,16 +1541,13 @@
// 产品复选框change事件
form
.
on
(
'checkbox(filter)'
,
function
(
data
)
{
console
.
log
(
data
,
'33333333333'
)
var
roleId
=
+
data
.
elem
.
dataset
.
id
var
projectId
=
data
.
value
var
isAdd
=
data
.
elem
.
checked
var
filterName
=
'treeTab'
+
roleId
console
.
log
(
roleId
,
projectId
,
isAdd
)
// merchantProTreeResponses
var
changeObj
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
.
find
(
i
=>
i
.
productId
==
projectId
)
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
console
.
log
(
changeObj
,
products
,
roleId
,
treeData
)
if
(
isAdd
)
{
// 新增
active
.
treeTabAdd
(
...
...
@@ -1586,7 +1577,6 @@
})
}
else
{
// 删除
console
.
log
(
treeData
,
Object
.
keys
(
treeData
).
length
)
var
productId
=
'tab_'
+
roleId
+
'_'
+
changeObj
.
productId
active
.
tabDelete
(
filterName
,
productId
)
if
(
Object
.
keys
(
treeData
).
length
!=
0
)
{
...
...
@@ -1626,38 +1616,17 @@
menuFunTreeData
=
res
.
data
var
accountType
=
$
(
'#accountType'
)
accountType
.
empty
()
console
.
log
(
menuFunTreeData
)
menuFunTreeData
.
forEach
((
item
,
index
)
=>
{
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
accountType
.
append
(
str
)
if
(
merchantId
)
{
console
.
log
(
check_arr
)
check_arr
.
forEach
(
i
=>
{
if
(
i
.
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
i
var
id
=
item
.
accounttypeId
console
.
log
(
'productData'
,
productData
)
str
.
attr
(
'checked'
,
true
)
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
active
.
tabAdd
(
obj
,
productData
.
products
)
// productData.products.forEach(j => {
// console.log(j, item)
// var products = item.products.find(n => n.productId == j.productId)
// console.log(products)
// active.treeTabAdd(
// {
// name: j.productName,
// value: j.productId
// },
// item.accounttypeId,
// products.merchantProTreeResponses,
// j.menuIds
// )
// })
// var filterName = 'treeTab' + item.accounttypeId
// var productId = 'tab_' + item.accounttypeId + '_' + productData.products[0].productId
// console.log(filterName, productId)
// active.tabChange(filterName, productId)
}
})
}
...
...
@@ -1697,7 +1666,6 @@
for
(
var
key
in
treeData
)
{
var
accountObj
=
treeData
[
key
]
var
productList
=
[]
console
.
log
(
accountObj
)
if
(
Object
.
keys
(
accountObj
).
length
!=
0
)
{
for
(
var
i
in
accountObj
)
{
var
productObj
=
accountObj
[
i
]
...
...
@@ -1797,7 +1765,6 @@
$
(
'#confirm'
).
on
(
'click'
,
function
()
{
getAuthList
()
console
.
log
(
requestList
)
if
(
requestList
.
length
!=
0
)
{
var
params
=
{
merchantId
:
merchantId
,
...
...
html/merchant/addSubMerchant.html
View file @
a710fcd
...
...
@@ -531,7 +531,6 @@
// 1-基本信息;2-权限树
var
step
=
1
var
merchantId
=
null
console
.
log
(
qs
(
'parentId'
))
var
parentMerchantId
=
null
var
accountTypeVisible
=
false
// 是否工厂
...
...
@@ -625,7 +624,6 @@
format
:
'yyyy-MM-dd'
,
min
:
helper
.
dateFormat
(
new
Date
()),
done
:
function
(
value
,
date
)
{
console
.
log
(
value
,
date
,
helper
.
dateFormat
(
new
Date
()))
date
.
month
=
date
.
month
-
1
date
.
date
=
date
.
date
+
1
$
(
'#expireDate'
).
val
(
''
)
...
...
@@ -721,7 +719,6 @@
// select 选择触发
form
.
on
(
'select(accountLevel)'
,
function
(
data
)
{
console
.
log
(
data
.
value
,
accountInfo
)
if
(
!
accountInfo
)
{
if
(
data
.
value
==
4
)
{
$
(
'#effectiveShowEl'
).
removeClass
(
'hide'
)
...
...
@@ -729,7 +726,6 @@
$
(
'#effectiveStarttime'
).
attr
(
'lay-verify'
,
'required'
)
$
(
'#expireDate'
).
attr
(
'lay-verify'
,
'required'
)
}
else
{
console
.
log
(
'jinlai'
)
$
(
'#effectiveShowEl'
).
removeClass
(
'show'
)
$
(
'#effectiveShowEl'
).
addClass
(
'hide'
)
$
(
'#effectiveStarttime'
).
removeAttr
(
'lay-verify'
)
...
...
@@ -739,7 +735,6 @@
})
form
.
on
(
'submit(handleFirstSubmit)'
,
function
(
data
)
{
// document.querySelector('#basic').scrollIntoView(true)
console
.
log
(
data
)
var
formData
=
data
.
field
var
params
=
{
isloginName
:
0
...
...
@@ -1024,7 +1019,6 @@
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
startTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
removeAttr
(
'disabled'
)
...
...
@@ -1033,7 +1027,6 @@
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
removeAttr
(
'disabled'
)
...
...
@@ -1042,7 +1035,6 @@
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
$
(
'#expireDate'
).
removeAttr
(
'disabled'
)
...
...
@@ -1530,7 +1522,6 @@
},
// tab Change
tabChange
:
function
(
name
,
id
)
{
console
.
log
(
name
,
id
)
element
.
tabChange
(
name
,
id
)
if
(
name
==
'roleAuth'
)
{
$
(
`#nomenu
${
id
}
`
).
html
(
'请选择产品'
)
...
...
@@ -1573,16 +1564,13 @@
// 产品复选框change事件
form
.
on
(
'checkbox(filter)'
,
function
(
data
)
{
console
.
log
(
data
,
'33333333333'
)
var
roleId
=
+
data
.
elem
.
dataset
.
id
var
projectId
=
data
.
value
var
isAdd
=
data
.
elem
.
checked
var
filterName
=
'treeTab'
+
roleId
console
.
log
(
roleId
,
projectId
,
isAdd
)
// merchantProTreeResponses
var
changeObj
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
.
find
(
i
=>
i
.
productId
==
projectId
)
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
console
.
log
(
changeObj
,
products
,
roleId
,
treeData
)
if
(
isAdd
)
{
// 新增
active
.
treeTabAdd
(
...
...
@@ -1612,7 +1600,6 @@
})
}
else
{
// 删除
console
.
log
(
treeData
,
Object
.
keys
(
treeData
).
length
)
var
productId
=
'tab_'
+
roleId
+
'_'
+
changeObj
.
productId
active
.
tabDelete
(
filterName
,
productId
)
if
(
Object
.
keys
(
treeData
).
length
!=
0
)
{
...
...
@@ -1652,38 +1639,17 @@
menuFunTreeData
=
res
.
data
var
accountType
=
$
(
'#accountType'
)
accountType
.
empty
()
console
.
log
(
menuFunTreeData
)
menuFunTreeData
.
forEach
((
item
,
index
)
=>
{
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
accountType
.
append
(
str
)
if
(
merchantId
)
{
console
.
log
(
check_arr
)
check_arr
.
forEach
(
i
=>
{
if
(
i
.
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
i
var
id
=
item
.
accounttypeId
console
.
log
(
'productData'
,
productData
)
str
.
attr
(
'checked'
,
true
)
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
active
.
tabAdd
(
obj
,
productData
.
products
)
// productData.products.forEach(j => {
// console.log(j, item)
// var products = item.products.find(n => n.productId == j.productId)
// console.log(products)
// active.treeTabAdd(
// {
// name: j.productName,
// value: j.productId
// },
// item.accounttypeId,
// products.merchantProTreeResponses,
// j.menuIds
// )
// })
// var filterName = 'treeTab' + item.accounttypeId
// var productId = 'tab_' + item.accounttypeId + '_' + productData.products[0].productId
// console.log(filterName, productId)
// active.tabChange(filterName, productId)
}
})
}
...
...
@@ -1800,7 +1766,6 @@
}
else
{
params
.
accountTypes
=
JSON
.
stringify
([])
}
console
.
log
(
requestList
,
params
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
...
...
html/merchant/detail.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/merchant.css"
/>
<title>
商户管理
</title>
<style>
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
.pull-right
{
float
:
right
;
}
.merchant-headerMsg
{
display
:
flex
;
}
.merchant-content
#secondmerchantName
{
margin-left
:
15px
;
width
:
240px
;
height
:
24px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
line-height
:
24px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.merchant-content
>
div
:not
(
:first-child
)
{
margin-left
:
15px
;
height
:
20px
;
font-size
:
12px
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
20px
;
}
.layui-form
{
margin-top
:
20px
;
}
.wrapper-merchant
{
background-color
:
#f4f5fa
;
display
:
flex
;
}
.merchant-left
{
padding-top
:
15px
;
min-height
:
calc
(
100vh
-
200px
);
background-color
:
#fff
;
width
:
340px
;
margin-right
:
20px
;
box-sizing
:
border-box
;
overflow
:
auto
;
}
.ztree
.wrapper-tree
{
overflow-y
:
auto
;
}
.wrapper-tree
::-webkit-scrollbar
{
display
:
none
;
}
.wrapper-tree
.node_name
{
display
:
inline-block
;
max-width
:
235px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.detail
.wrapper-tree
{
margin-left
:
0
;
}
.merchant-right
{
padding-top
:
15px
;
overflow-x
:
auto
;
/* max-width: calc(100vw - 340px - 20px); */
background-color
:
#fff
;
padding-left
:
20px
;
padding-right
:
20px
;
box-sizing
:
border-box
;
}
.merchant-right
>
div
:first-child
{
/* position: relative;
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/merchant.css"
/>
<title>
商户管理
</title>
<style>
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
.pull-right
{
float
:
right
;
}
.merchant-headerMsg
{
display
:
flex
;
}
.merchant-content
#secondmerchantName
{
margin-left
:
15px
;
width
:
240px
;
height
:
24px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
line-height
:
24px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.merchant-content
>
div
:not
(
:first-child
)
{
margin-left
:
15px
;
height
:
20px
;
font-size
:
12px
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
20px
;
}
.layui-form
{
margin-top
:
20px
;
}
.wrapper-merchant
{
background-color
:
#f4f5fa
;
display
:
flex
;
}
.merchant-left
{
padding-top
:
15px
;
min-height
:
calc
(
100vh
-
200px
);
background-color
:
#fff
;
width
:
340px
;
margin-right
:
20px
;
box-sizing
:
border-box
;
overflow
:
auto
;
}
.ztree
.wrapper-tree
{
overflow-y
:
auto
;
}
.wrapper-tree
::-webkit-scrollbar
{
display
:
none
;
}
.wrapper-tree
.node_name
{
display
:
inline-block
;
max-width
:
235px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.detail
.wrapper-tree
{
margin-left
:
0
;
}
.merchant-right
{
padding-top
:
15px
;
overflow-x
:
auto
;
/* max-width: calc(100vw - 340px - 20px); */
background-color
:
#fff
;
padding-left
:
20px
;
padding-right
:
20px
;
box-sizing
:
border-box
;
}
.merchant-right
>
div
:first-child
{
/* position: relative;
height: 40px;
line-height: 40px; */
display
:
flex
;
align-items
:
flex-start
;
justify-content
:
space-between
;
}
.layui-form-label
{
width
:
130px
!important
;
}
.merchant-right
.companyName
{
display
:
inline-block
;
max-width
:
300px
;
height
:
36px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
/* line-height: 22px; */
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.merchant-right
.emloyeeListText
{
display
:
inline-block
;
height
:
36px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
/* line-height: 22px; */
}
.merchant-right
.layui-btn
{
/* position: absolute;
display
:
flex
;
align-items
:
flex-start
;
justify-content
:
space-between
;
}
.layui-form-label
{
width
:
130px
!important
;
}
.merchant-right
.companyName
{
display
:
inline-block
;
max-width
:
300px
;
height
:
36px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
/* line-height: 22px; */
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
word-break
:
break-all
;
}
.merchant-right
.emloyeeListText
{
display
:
inline-block
;
height
:
36px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#333333
;
/* line-height: 22px; */
}
.merchant-right
.layui-btn
{
/* position: absolute;
right: 0px; */
margin-left
:
20px
;
}
margin-left
:
20px
;
}
/* .merchant-right .layui-input-inline {
/* .merchant-right .layui-input-inline {
position: absolute;
right: 70px;
} */
.updateRecord
{
text-align
:
left
;
color
:
#999
;
background-color
:
#fff
;
padding
:
0
20px
;
}
.updateRecord
{
text-align
:
left
;
color
:
#999
;
background-color
:
#fff
;
padding
:
0
20px
;
}
.mb21
{
margin-bottom
:
21px
;
}
.mb21
{
margin-bottom
:
21px
;
}
/* .tabmutiple-content-wrap {
/* .tabmutiple-content-wrap {
background-color: #f4f6fc;
padding-top: 0 0 10px;
margin: 0 20px;
...
...
@@ -165,735 +177,743 @@
.layui-this {
background-color: #fff;
} */
.tabmutiple-content-wrap
{
background-color
:
#f4f6fc
;
padding
:
0
0
1px
;
margin
:
0
20px
;
border-radius
:
4px
;
}
.tabmutiple-content
{
margin
:
0
10px
;
/* background-color: #f4f6fc; */
}
.layui-tab-title
.layui-this
{
transform
:
none
;
}
.layui-tab-title
{
background-color
:
#f4f6fc
;
}
.layui-tab-card
>
.layui-tab-title
li
{
margin-left
:
0
;
}
.outtitle
{
margin-left
:
-10px
;
}
.powerlimt
.layui-tab-content
{
background-color
:
#fff
;
}
.powerlimt
.layui-this
{
/* background-color: #fff; */
border
:
2px
solid
#fff
;
/* border-top-left-radius: 4px;
.tabmutiple-content-wrap
{
background-color
:
#f4f6fc
;
padding
:
0
0
1px
;
margin
:
0
20px
;
border-radius
:
4px
;
}
.tabmutiple-content
{
margin
:
0
10px
;
/* background-color: #f4f6fc; */
}
.layui-tab-title
.layui-this
{
transform
:
none
;
}
.layui-tab-title
{
background-color
:
#f4f6fc
;
}
.layui-tab-card
>
.layui-tab-title
li
{
margin-left
:
0
;
}
.outtitle
{
margin-left
:
-10px
;
}
.powerlimt
.layui-tab-content
{
background-color
:
#fff
;
}
.powerlimt
.layui-this
{
/* background-color: #fff; */
border
:
2px
solid
#fff
;
/* border-top-left-radius: 4px;
border-top-right-radius: 4px; */
}
.fixed-btn-block
{
position
:
fixed
;
bottom
:
0
;
/* padding: 14px; */
width
:
100%
;
border-top
:
1px
solid
#eee
;
background-color
:
#ffffff
;
}
.fixed-btn
{
/* width: 140px; */
height
:
28px
;
line-height
:
28px
;
font-size
:
12px
;
}
.threeWrap
{
background-color
:
#f4f6fc
;
}
/* 新增样式 */
.MsgWrap
{
position
:
relative
;
background-color
:
#fff
;
margin-bottom
:
20px
;
/* min-height: 300px; */
}
.powerlimt
{
background-color
:
#fff
;
padding-bottom
:
30px
;
}
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.companyMsg
.layui-word-aux
{
color
:
#999
!important
;
padding-left
:
20px
!important
;
padding-right
:
5px
!important
;
padding-top
:
6px
;
}
.AccountMsg
.layui-word-aux
{
color
:
#999
!important
;
padding-left
:
20px
!important
;
padding-right
:
5px
!important
;
padding-top
:
6px
;
}
.account-type-span
{
display
:
inline-block
;
/* width: 100px; */
/* height: 32px; */
padding
:
9px
15px
;
background-color
:
#f3f2ff
;
border-radius
:
4px
;
color
:
#5850ff
;
line-height
:
14px
;
margin-right
:
10px
;
margin-bottom
:
10px
;
}
.detail-content
{
padding
:
30px
0
;
}
.updateRecord
.layui-table-view
.layui-table
{
overflow-y
:
scroll
;
}
.updateRecord
.layui-table-body
{
overflow-y
:
scroll
;
}
</style>
</head>
<body>
<div
id=
"app"
>
<main
class=
"bg-white wrapper detail"
>
<div
class=
"layui-tab layui-top-tab layui-tab-brief bg-detail"
>
<ul
class=
"layui-tab-title"
>
<li
class=
"layui-this"
style=
"padding: 0; width: 90px; margin-right: 20px"
>
商户信息
</li>
<li
style=
"padding: 0; width: 90px; margin-right: 20px"
>
上级/下级商户
</li>
<li
style=
"padding: 0; width: 90px"
>
修改记录
</li>
</ul>
<div
class=
"layui-tab-content clearfix m-t-md"
>
<div
class=
"layui-tab-item layui-show threeWrap"
>
<div
class=
"MsgWrap AccountMsg layui-row"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title"
>
账户信息
</h3>
<div
class=
"detail-content clearfix"
>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
登录账户名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"merchantLoginAccount"
></div>
</div>
}
.fixed-btn-block
{
position
:
fixed
;
bottom
:
0
;
/* padding: 14px; */
width
:
100%
;
border-top
:
1px
solid
#eee
;
background-color
:
#ffffff
;
}
.fixed-btn
{
/* width: 140px; */
height
:
28px
;
line-height
:
28px
;
font-size
:
12px
;
}
.threeWrap
{
background-color
:
#f4f6fc
;
}
/* 新增样式 */
.MsgWrap
{
position
:
relative
;
background-color
:
#fff
;
margin-bottom
:
20px
;
/* min-height: 300px; */
}
.powerlimt
{
background-color
:
#fff
;
padding-bottom
:
30px
;
}
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.companyMsg
.layui-word-aux
{
color
:
#999
!important
;
padding-left
:
20px
!important
;
padding-right
:
5px
!important
;
padding-top
:
6px
;
}
.AccountMsg
.layui-word-aux
{
color
:
#999
!important
;
padding-left
:
20px
!important
;
padding-right
:
5px
!important
;
padding-top
:
6px
;
}
.account-type-span
{
display
:
inline-block
;
/* width: 100px; */
/* height: 32px; */
padding
:
9px
15px
;
background-color
:
#f3f2ff
;
border-radius
:
4px
;
color
:
#5850ff
;
line-height
:
14px
;
margin-right
:
10px
;
margin-bottom
:
10px
;
}
.detail-content
{
padding
:
30px
0
;
}
.updateRecord
.layui-table-view
.layui-table
{
overflow-y
:
scroll
;
}
.updateRecord
.layui-table-body
{
overflow-y
:
scroll
;
}
</style>
</head>
<body>
<div
id=
"app"
>
<main
class=
"bg-white wrapper detail"
>
<div
class=
"layui-tab layui-top-tab layui-tab-brief bg-detail"
>
<ul
class=
"layui-tab-title"
>
<li
class=
"layui-this"
style=
"padding: 0; width: 90px; margin-right: 20px"
>
商户信息
</li>
<li
style=
"padding: 0; width: 90px; margin-right: 20px"
>
上级/下级商户
</li>
<li
style=
"padding: 0; width: 90px"
>
修改记录
</li>
</ul>
<div
class=
"layui-tab-content clearfix m-t-md"
>
<div
class=
"layui-tab-item layui-show threeWrap"
>
<div
class=
"MsgWrap AccountMsg layui-row"
>
<div
class=
"grayLine"
></div>
<h3
class=
"content-title"
>
账户信息
</h3>
<div
class=
"detail-content clearfix"
>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
登录账户名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"merchantLoginAccount"
></div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21
layui-col-md5"
>
<label
class=
"layui-form-label"
>
账户等级:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"accountLevelName"
></div
>
</div>
</div
>
<div
class=
"
layui-col-md5"
>
<div
class=
"layui-form-item mb21 layui-col-md5"
>
<label
class=
"layui-form-label"
>
账户等级:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-word-aux"
id=
"accountLevelName"
><
/div>
</div>
</div>
<!-- <div class="layui-form-item">
</div>
<!-- <div class="layui-form-item">
<label class="layui-form-label">账户类型:</label>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="accountTypeNames"></div>
</div>
</div> -->
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
开通模式:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"merchantModelName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
开通模式:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"merchantModelName"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
账户状态:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"statusName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
账户状态:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"statusName"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
关联企业微信名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"entmicroName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label"
>
关联企业微信名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"entmicroName"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"effectiveTimeName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"effectiveTimeName"
></div>
</div>
</div>
<div
class=
"layui-col-md12"
>
<div
class=
"layui-form-item
"
>
<label
class=
"layui-form-label"
>
账户类型:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"accountAuth"
></div
>
</div>
</div
>
<div
class=
"layui-col-md12
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户类型:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-word-aux"
id=
"accountAuth"
><
/div>
</div>
</div>
</div>
</div>
<div
class=
"MsgWrap powerlimt"
>
<h3
class=
"content-title"
>
功能权限
</h3
>
<div
class=
"tabmutiple-content-wrap"
>
<div
class=
"layui-tab tabmutiple-content"
lay-filter=
"roleAuth
"
>
<ul
class=
"layui-tab-title outtitle"
></ul
>
<div
class=
"layui-tab-content"
></div
>
</div>
</div
>
<div
class=
"MsgWrap powerlimt"
>
<h3
class=
"content-title"
>
功能权限
</h3
>
<div
class=
"tabmutiple-content-wrap
"
>
<div
class=
"layui-tab tabmutiple-content"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title outtitle"
></ul
>
<
div
class=
"layui-tab-content"
><
/div>
</div>
</div>
<div
class=
"MsgWrap companyMsg clearfix"
style=
"margin-bottom: 100px"
>
<div
class=
"grayLine"
></div
>
<h3
class=
"content-title"
>
企业信息
</h3
>
<div
class=
"detail-content clearfix"
>
<div
class=
"layui-col-md5
"
>
<div
class=
"layui-form-item
"
>
<label
class=
"layui-form-label"
>
商户名称:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-word-aux"
id=
"merchantName"
></div
>
</div>
</div
>
<div
class=
"MsgWrap companyMsg clearfix"
style=
"margin-bottom: 100px"
>
<div
class=
"grayLine"
></div
>
<h3
class=
"content-title"
>
企业信息
</h3
>
<div
class=
"detail-content clearfix
"
>
<div
class=
"layui-col-md5
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
商户名称:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-word-aux"
id=
"merchantName"
><
/div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item
"
>
<label
class=
"layui-form-label"
>
简称:
</label
>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid --
>
<div
class=
"layui-word-aux"
id=
"merchantAbbreviation"
></div
>
</div>
</div
>
<div
class=
"layui-col-md5
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
简称:
</label
>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid --
>
<
div
class=
"layui-word-aux"
id=
"merchantAbbreviation"
><
/div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item
"
>
<label
class=
"layui-form-label"
>
商户类型:
</label
>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid --
>
<div
class=
"layui-word-aux"
id=
"merchantTypeName"
></div
>
</div>
</div
>
<div
class=
"layui-col-md5
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
商户类型:
</label
>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid --
>
<
div
class=
"layui-word-aux"
id=
"merchantTypeName"
><
/div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
id=
"orgTxt"
>
身份证:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantOrgcode"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
id=
"orgTxt"
>
身份证:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantOrgcode"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
地址:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantAddress"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
地址:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantAddress"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系人:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantLegalPerson"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系人:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantLegalPerson"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系电话:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantLegalPersonPhone"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系电话:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantLegalPersonPhone"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
营业范围:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"businessScopName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
营业范围:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"businessScopName"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantBrandName"
></div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"merchantBrandName"
></div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"wrapper-merchant"
>
<div
class=
"merchant-left"
>
<div
class=
"merchant-headerMsg"
>
<div
class=
"merchantImg"
><img
src=
"../../css/img/merchantImg.png"
alt=
""
/></div>
<div
class=
"merchant-content"
>
<div
id=
"secondmerchantName"
></div>
<div>
商户号:
<span
id=
"secondmerchantId"
></span>
</div>
<div>
您共有
<span
id=
"numberOfSubMerchants"
></span>
个子商户,共有
<span
id=
"numberOfStores"
></span>
家门店
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"wrapper-merchant"
>
<div
class=
"merchant-left"
>
<div
class=
"merchant-headerMsg"
>
<div
class=
"merchantImg"
><img
src=
"../../css/img/merchantImg.png"
alt=
""
/></div>
<div
class=
"merchant-content"
>
<div
id=
"secondmerchantName"
></div>
<div>
商户号:
<span
id=
"secondmerchantId"
></span>
</div>
</div>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-inline"
>
<div
class=
"layui-input-inline"
style=
"width: 232px"
>
<input
class=
"layui-input"
id=
"treeInput"
placeholder=
"请输入"
name=
"nameVal"
/>
</div>
<button
type=
"button"
id=
"merchantBtn"
class=
"layui-btn"
>
查询
</button>
<div>
您共有
<span
id=
"numberOfSubMerchants"
></span>
个子商户,共有
<span
id=
"numberOfStores"
></span>
家门店
</div>
</form>
<ul
id=
"merchantTree"
class=
"ztree wrapper-tree"
></ul>
</div>
</div>
<div
class=
"merchant-right"
>
<div
>
<div
style=
"display: flex
"
>
<span
id=
"companyName"
class=
"companyName"
></span
>
<
span
class=
"emloyeeListText"
>
员工列表
</span
>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-inline
"
>
<div
class=
"layui-input-inline"
style=
"width: 232px"
>
<
input
class=
"layui-input"
id=
"treeInput"
placeholder=
"请输入"
name=
"nameVal"
/
>
</div>
<button
type=
"button"
id=
"merchantBtn"
class=
"layui-btn"
>
查询
</button>
</div>
</form>
<ul
id=
"merchantTree"
class=
"ztree wrapper-tree"
></ul>
</div>
<div
class=
"merchant-right"
>
<div>
<div
style=
"display: flex"
>
<span
id=
"companyName"
class=
"companyName"
></span>
<span
class=
"emloyeeListText"
>
员工列表
</span>
</div>
<div>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
</div>
<button
class=
"layui-btn"
id=
"tableSearch"
>
查询
</button>
<div>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
</div>
<button
class=
"layui-btn"
id=
"tableSearch"
>
查询
</button>
</div>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
</div>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
</div>
</div>
<div
class=
"layui-tab-item updateRecord"
>
<table
class=
"layui-table"
id=
"recordTable"
></table>
<div
id=
"recordPage"
class=
"align-left"
style=
"padding-left: 20px; margin-top: 20px"
></div>
</div>
</div>
<div
class=
"footer-close fixed-btn-block"
>
<button
class=
"layui-btn layui-btn-normal btn-one"
id=
"closeEl"
>
关闭
</button>
<div
class=
"layui-tab-item updateRecord"
>
<table
class=
"layui-table"
id=
"recordTable"
></table>
<div
id=
"recordPage"
class=
"align-left"
style=
"padding-left: 20px; margin-top: 20px"
></div>
</div>
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'request'
,
'gtree'
,
'helper'
,
'table'
,
'form'
,
'treeTab'
,
'laypage'
],
function
()
{
var
$
=
layui
.
$
var
request
=
layui
.
request
var
tree
=
layui
.
gtree
var
helper
=
layui
.
helper
var
table
=
layui
.
table
var
form
=
layui
.
form
var
treeTab
=
layui
.
treeTab
var
laypage
=
layui
.
laypage
var
merchantId
=
qs
(
'merchantId'
)
var
parentId
=
''
var
merchantForm
=
{}
var
templateData
=
{}
var
treeData
=
{}
var
menuFunTreeData
=
[]
var
basicArr
=
[
'merchantLoginAccount'
,
'accountTypeNames'
,
'accountLevelName'
,
'effectiveTimeName'
,
'merchantName'
,
'merchantAbbreviation'
,
'merchantTypeName'
,
'merchantOrgcode'
,
'merchantAddress'
,
'merchantLegalPerson'
,
'merchantLegalPersonPhone'
,
'businessScopName'
,
'merchantBrandName'
,
'merchantModelName'
,
'statusName'
,
'entmicroName'
]
var
roleData
=
{}
var
accountAuth
=
[]
var
recordPage
=
{
pageNum
:
1
,
pageSize
:
10
}
var
recordPageOptions
=
{
elem
:
'recordPage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
recordPage
.
pageNum
=
obj
.
curr
recordPage
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getThirdTable
()
}
<div
class=
"footer-close fixed-btn-block"
>
<button
class=
"layui-btn layui-btn-normal btn-one"
id=
"closeEl"
>
关闭
</button>
</div>
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'request'
,
'gtree'
,
'helper'
,
'table'
,
'form'
,
'treeTab'
,
'laypage'
],
function
()
{
var
$
=
layui
.
$
var
request
=
layui
.
request
var
tree
=
layui
.
gtree
var
helper
=
layui
.
helper
var
table
=
layui
.
table
var
form
=
layui
.
form
var
treeTab
=
layui
.
treeTab
var
laypage
=
layui
.
laypage
var
merchantId
=
qs
(
'merchantId'
)
var
parentId
=
''
var
merchantForm
=
{}
var
templateData
=
{}
var
treeData
=
{}
var
menuFunTreeData
=
[]
var
basicArr
=
[
'merchantLoginAccount'
,
'accountTypeNames'
,
'accountLevelName'
,
'effectiveTimeName'
,
'merchantName'
,
'merchantAbbreviation'
,
'merchantTypeName'
,
'merchantOrgcode'
,
'merchantAddress'
,
'merchantLegalPerson'
,
'merchantLegalPersonPhone'
,
'businessScopName'
,
'merchantBrandName'
,
'merchantModelName'
,
'statusName'
,
'entmicroName'
]
var
roleData
=
{}
var
accountAuth
=
[]
var
recordPage
=
{
pageNum
:
1
,
pageSize
:
10
}
var
recordPageOptions
=
{
elem
:
'recordPage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
recordPage
.
pageNum
=
obj
.
curr
recordPage
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getThirdTable
()
}
}
}
var
recordTable
=
table
.
render
({
elem
:
'#recordTable'
,
page
:
false
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
[
[
{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'operator'
,
title
:
'登录账户'
,
align
:
'center'
},
{
field
:
'productName'
,
title
:
'登录产品'
,
align
:
'center'
,
width
:
180
},
{
field
:
'ip'
,
title
:
'登录IP'
,
align
:
'center'
,
width
:
180
},
{
field
:
'modifyContent'
,
title
:
'修改内容'
,
align
:
'center'
,
width
:
180
},
{
field
:
'userName'
,
title
:
'操作人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'createdTime'
,
title
:
'操作时间'
,
align
:
'center'
,
width
:
180
}
]
var
recordTable
=
table
.
render
({
elem
:
'#recordTable'
,
page
:
false
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
[
[
{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'operator'
,
title
:
'登录账户'
,
align
:
'center'
},
{
field
:
'productName'
,
title
:
'登录产品'
,
align
:
'center'
,
width
:
180
},
{
field
:
'ip'
,
title
:
'登录IP'
,
align
:
'center'
,
width
:
180
},
{
field
:
'modifyContent'
,
title
:
'修改内容'
,
align
:
'center'
,
width
:
180
},
{
field
:
'userName'
,
title
:
'操作人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'createdTime'
,
title
:
'操作时间'
,
align
:
'center'
,
width
:
180
}
]
})
init
()
]
})
function
init
()
{
getFirstInfo
()
findMenuFunTreeByMerId
()
getSecondInfo
()
getSecondTree
()
getSecondTable
()
getThirdTable
()
}
function
btnClick
()
{
console
.
log
(
'jjj'
)
init
()
function
init
()
{
getFirstInfo
()
findMenuFunTreeByMerId
()
getSecondInfo
()
getSecondTree
()
getSecondTable
()
getThirdTable
()
}
// 查询角色详情
function
getFirstInfo
()
{
var
params
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantDetail'
}
// 查询角色详情
function
getFirstInfo
()
{
var
params
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantDetail'
}
request
(
params
,
function
(
res
)
{
// businessScopeCustomize
if
(
res
.
code
==
'0'
)
{
roleData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
if
(
basicArr
[
i
]
==
'businessScopName'
&&
roleData
.
businessScopeCustomize
)
{
roleData
.
businessScopName
=
roleData
.
businessScopName
?
roleData
.
businessScopName
+
','
+
roleData
.
businessScopeCustomize
:
roleData
.
businessScopeCustomize
}
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
?
roleData
[
basicArr
[
i
]]
:
'-'
)
request
(
params
,
function
(
res
)
{
// businessScopeCustomize
if
(
res
.
code
==
'0'
)
{
roleData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
if
(
basicArr
[
i
]
==
'businessScopName'
&&
roleData
.
businessScopeCustomize
)
{
roleData
.
businessScopName
=
roleData
.
businessScopName
?
roleData
.
businessScopName
+
','
+
roleData
.
businessScopeCustomize
:
roleData
.
businessScopeCustomize
}
if
(
roleData
.
merchantType
==
2
)
{
$
(
'#orgTxt'
).
text
(
'组织机构代码:'
)
}
// var effectiveTimeNameEl = $('#effectiveTimeName')
// if (roleData.merchantAccountLevel == 4) { // 门店
// if (roleData.status == 1 || roleData.status == 5) {
// effectiveTimeNameEl.text('-')
// } else {
// effectiveTimeNameEl.text(roleData.effectiveTimeName)
// }
// } else { // 工厂省代市代
// if (roleData.status == 1 || roleData.status == 4) {
// effectiveTimeNameEl.text('-')
// } else {
// effectiveTimeNameEl.text(roleData.effectiveTimeName)
// }
// }
// callback(roleData.accountTypes)
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
?
roleData
[
basicArr
[
i
]]
:
'-'
)
}
})
}
// 获取功能权限树
function
findMenuFunTreeByMerId
()
{
const
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
id
:
merchantId
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
&&
res
.
data
&&
res
.
data
.
length
!=
0
)
{
var
authList
=
res
.
data
console
.
log
(
authList
)
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
accountAuth
.
push
(
item
.
accounttypeName
)
$
(
'#accountAuth'
).
append
(
'<span class="account-type-span">'
+
item
.
accounttypeName
+
'</span>'
)
var
menuData
=
[]
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
else
{
}
})
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
if
(
roleData
.
merchantType
==
2
)
{
$
(
'#orgTxt'
).
text
(
'组织机构代码:'
)
}
})
}
// var effectiveTimeNameEl = $('#effectiveTimeName')
// if (roleData.merchantAccountLevel == 4) { // 门店
// if (roleData.status == 1 || roleData.status == 5) {
// effectiveTimeNameEl.text('-')
// } else {
// effectiveTimeNameEl.text(roleData.effectiveTimeName)
// }
// } else { // 工厂省代市代
// if (roleData.status == 1 || roleData.status == 4) {
// effectiveTimeNameEl.text('-')
// } else {
// effectiveTimeNameEl.text(roleData.effectiveTimeName)
// }
// }
// callback(roleData.accountTypes)
}
})
}
// 上下级商户 - 信息
function
getSecondInfo
()
{
request
(
{
method
:
'cn.com.glsx.merchants.menu.findSubordinateRelationship'
,
id
:
merchantId
},
function
(
res
)
{
console
.
log
(
res
.
data
)
var
data
=
res
.
data
$
(
'#secondmerchantName'
).
text
(
data
.
merchantName
?
data
.
merchantName
:
'-'
)
$
(
'#secondmerchantName'
).
attr
(
'title'
,
data
.
merchantName
)
$
(
'#secondmerchantId'
).
text
(
data
.
merchantNo
?
data
.
merchantNo
:
'-'
)
$
(
'#numberOfSubMerchants'
).
text
(
data
.
numberOfSubMerchants
>
0
?
data
.
numberOfSubMerchants
:
0
)
$
(
'#numberOfStores'
).
text
(
data
.
numberOfStores
>
0
?
data
.
numberOfStores
:
0
)
$
(
'#companyName'
).
html
(
data
.
merchantName
)
$
(
'#companyName'
).
attr
(
'title'
,
data
.
merchantName
)
}
)
// 获取功能权限树
function
findMenuFunTreeByMerId
()
{
const
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
id
:
merchantId
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
&&
res
.
data
&&
res
.
data
.
length
!=
0
)
{
var
authList
=
res
.
data
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
accountAuth
.
push
(
item
.
accounttypeName
)
$
(
'#accountAuth'
).
append
(
'<span class="account-type-span">'
+
item
.
accounttypeName
+
'</span>'
)
var
menuData
=
[]
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
else
{
}
})
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
}
})
}
var
all_nodes
=
null
var
treeObj
=
null
// 上下级商户 - 树
function
getSecondTree
()
{
var
treeParams
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
// 上下级商户 - 信息
function
getSecondInfo
()
{
request
(
{
method
:
'cn.com.glsx.merchants.menu.findSubordinateRelationship'
,
id
:
merchantId
},
function
(
res
)
{
var
data
=
res
.
data
$
(
'#secondmerchantName'
).
text
(
data
.
merchantName
?
data
.
merchantName
:
'-'
)
$
(
'#secondmerchantName'
).
attr
(
'title'
,
data
.
merchantName
)
$
(
'#secondmerchantId'
).
text
(
data
.
merchantNo
?
data
.
merchantNo
:
'-'
)
$
(
'#numberOfSubMerchants'
).
text
(
data
.
numberOfSubMerchants
>
0
?
data
.
numberOfSubMerchants
:
0
)
$
(
'#numberOfStores'
).
text
(
data
.
numberOfStores
>
0
?
data
.
numberOfStores
:
0
)
$
(
'#companyName'
).
html
(
data
.
merchantName
)
$
(
'#companyName'
).
attr
(
'title'
,
data
.
merchantName
)
}
request
(
treeParams
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
treeObj
=
tree
.
create
(
'merchantTree'
,
res
.
data
,
null
,
{
check
:
{
enable
:
false
}
})
treeObj
.
expandAll
(
true
)
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
var
targetNode
=
treeObj
.
getNodeByParam
(
'id'
,
merchantId
)
treeObj
.
selectNode
(
targetNode
)
bindEvent
()
}
})
}
)
}
function
bindEvent
()
{
$
(
'#merchantBtn'
).
on
(
'click'
,
function
()
{
var
txt
=
$
(
'#treeInput'
).
val
()
if
(
!
txt
)
{
treeObj
.
showNodes
(
all_nodes
)
var
targetNode
=
treeObj
.
getNodeByParam
(
'id'
,
merchantId
)
treeObj
.
selectNode
(
all_nodes
[
0
])
}
else
{
var
nodesList
=
treeObj
.
getNodesByParamFuzzy
(
'label'
,
txt
)
show_nodes
=
helper
.
findShowNode
(
nodesList
,
all_nodes
)
treeObj
.
hideNodes
(
all_nodes
)
treeObj
.
showNodes
(
show_nodes
)
treeObj
.
selectNode
(
nodesList
[
0
])
}
})
return
false
var
all_nodes
=
null
var
treeObj
=
null
// 上下级商户 - 树
function
getSecondTree
()
{
var
treeParams
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
}
// 列表配置
var
subMerchantTable
=
table
.
render
({
elem
:
'#subMerchantTable'
,
page
:
true
,
height
:
'full-300'
,
cols
:
[
[
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
200
,
align
:
'center'
},
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
,
width
:
200
},
{
field
:
'staffPhone'
,
title
:
'登录账户'
,
width
:
180
,
align
:
'center'
},
{
field
:
'entmicroName'
,
title
:
'企微号'
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
width
:
260
,
align
:
'center'
request
(
treeParams
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
treeObj
=
tree
.
create
(
'merchantTree'
,
res
.
data
,
null
,
{
check
:
{
enable
:
false
}
]
]
})
// table搜索
$
(
'#tableSearch'
).
on
(
'click'
,
function
()
{
var
search
=
$
(
'#tableSearchForm'
).
val
()
console
.
log
(
search
)
getSecondTable
({
keyword
:
search
})
return
false
})
treeObj
.
expandAll
(
true
)
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
var
targetNode
=
treeObj
.
getNodeByParam
(
'id'
,
merchantId
)
treeObj
.
selectNode
(
targetNode
)
bindEvent
()
}
})
}
$
(
'#closeEl'
).
on
(
'click'
,
function
()
{
go
(
'merchant'
,
'index'
)
function
bindEvent
()
{
$
(
'#merchantBtn'
).
on
(
'click'
,
function
()
{
var
txt
=
$
(
'#treeInput'
).
val
()
if
(
!
txt
)
{
treeObj
.
showNodes
(
all_nodes
)
var
targetNode
=
treeObj
.
getNodeByParam
(
'id'
,
merchantId
)
treeObj
.
selectNode
(
all_nodes
[
0
])
}
else
{
var
nodesList
=
treeObj
.
getNodesByParamFuzzy
(
'label'
,
txt
)
show_nodes
=
helper
.
findShowNode
(
nodesList
,
all_nodes
)
treeObj
.
hideNodes
(
all_nodes
)
treeObj
.
showNodes
(
show_nodes
)
treeObj
.
selectNode
(
nodesList
[
0
])
}
})
return
false
}
// 获取table列表接口
function
getSecondTable
(
search
,
isResetPageNum
)
{
var
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
// 列表配置
var
subMerchantTable
=
table
.
render
({
elem
:
'#subMerchantTable'
,
page
:
true
,
height
:
'full-300'
,
cols
:
[
[
{
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
merchantId
:
merchantId
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
search
)
request
(
params
,
function
(
res
)
{
// console.log(res)
var
data
=
res
.
data
var
options
=
{
data
:
data
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
200
,
align
:
'center'
},
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
,
width
:
200
},
{
field
:
'staffPhone'
,
title
:
'登录账户'
,
width
:
180
,
align
:
'center'
},
{
field
:
'entmicroName'
,
title
:
'企微号'
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
width
:
260
,
align
:
'center'
}
subMerchantTable
.
reload
(
options
)
// setTimeout(getTableNewHeight, 3000)
})
}
]
]
})
// table搜索
$
(
'#tableSearch'
).
on
(
'click'
,
function
()
{
var
search
=
$
(
'#tableSearchForm'
).
val
()
getSecondTable
({
keyword
:
search
})
return
false
})
$
(
'#closeEl'
).
on
(
'click'
,
function
()
{
go
(
'merchant'
,
'index'
)
})
// 修改记录
function
getThirdTable
(
isResetPageNum
)
{
var
params
=
{
bussinessId
:
merchantId
,
moduleName
:
'商户模块'
,
pageNum
:
recordPage
.
pageNum
,
pageSize
:
recordPage
.
pageSize
,
method
:
'cn.com.glsx.merchants.menu.findLog'
// 获取table列表接口
function
getSecondTable
(
search
,
isResetPageNum
)
{
var
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
merchantId
:
merchantId
},
search
)
request
(
params
,
function
(
res
)
{
var
data
=
res
.
data
var
options
=
{
data
:
data
}
request
(
params
,
function
(
res
)
{
var
data
=
res
.
data
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
recordPage
.
pageSize
*
(
recordPage
.
pageNum
-
1
)
data
.
data
[
index
].
modifyContent
=
item
.
module
+
'-'
+
item
.
action
})
var
options
=
{
data
:
data
.
data
}
recordPageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
recordPageOptions
.
curr
=
1
}
laypage
.
render
(
recordPageOptions
)
recordTable
.
reload
(
options
)
})
subMerchantTable
.
reload
(
options
)
// setTimeout(getTableNewHeight, 3000)
})
}
// 修改记录
function
getThirdTable
(
isResetPageNum
)
{
var
params
=
{
bussinessId
:
merchantId
,
moduleName
:
'商户模块'
,
pageNum
:
recordPage
.
pageNum
,
pageSize
:
recordPage
.
pageSize
,
method
:
'cn.com.glsx.merchants.menu.findLog'
}
})
</script>
</body>
</html>
request
(
params
,
function
(
res
)
{
var
data
=
res
.
data
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
item
.
index
=
index
+
1
+
recordPage
.
pageSize
*
(
recordPage
.
pageNum
-
1
)
data
.
data
[
index
].
modifyContent
=
item
.
module
+
'-'
+
item
.
action
})
var
options
=
{
data
:
data
.
data
}
recordPageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
recordPageOptions
.
curr
=
1
}
laypage
.
render
(
recordPageOptions
)
recordTable
.
reload
(
options
)
})
}
})
</script>
</body>
</html>
\ No newline at end of file
html/merchant/edit.html
View file @
a710fcd
...
...
@@ -525,7 +525,6 @@
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
var
merchantAccountLevel
=
qs
(
'merchantAccountLevel'
)
var
model
=
qs
(
'model'
)
console
.
log
(
merchantAccountLevel
==
4
,
!
accountInfo
,
qs
(
'status'
)
==
1
)
if
(
merchantAccountLevel
==
4
&&
!
accountInfo
&&
qs
(
'status'
)
==
1
)
{
// 上级是市代,子商户为门店,显示 有效期
$
(
'#effectiveShowEl'
).
removeClass
(
'hide'
)
...
...
@@ -617,7 +616,6 @@
format
:
'yyyy-MM-dd'
,
min
:
helper
.
dateFormat
(
new
Date
()),
done
:
function
(
value
,
date
)
{
console
.
log
(
value
,
date
,
helper
.
dateFormat
(
new
Date
()))
date
.
month
=
date
.
month
-
1
date
.
date
=
date
.
date
+
1
$
(
'#expireDate'
).
val
(
''
)
...
...
@@ -646,7 +644,6 @@
// tab 切换
element
.
on
(
'tab(editTab)'
,
function
(
val
)
{
console
.
log
(
'-------'
,
val
)
})
// 校验
...
...
@@ -683,7 +680,6 @@
}
},
hasModify
:
function
(
value
)
{
console
.
log
(
value
,
'=================----------==========='
)
},
otherReq
:
function
(
value
,
item
)
{
var
verifyName
=
$
(
item
).
attr
(
'name'
),
...
...
@@ -718,7 +714,6 @@
})
form
.
on
(
'submit(handleFirstSubmit)'
,
function
(
data
)
{
console
.
log
(
data
)
var
formData
=
data
.
field
basicSubmited
=
true
var
params
=
{
...
...
@@ -840,7 +835,6 @@
}
else
{
params
.
status
=
1
}
console
.
log
(
params
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
// if (editLevel == 3) {
...
...
@@ -1012,13 +1006,11 @@
layer
.
close
(
index
)
},
function
()
{
console
.
log
(
'11111'
)
element
.
tabChange
(
'editTab'
,
1
)
step
=
1
}
)
}
else
{
console
.
log
(
'fou'
)
element
.
tabChange
(
'editTab'
,
1
)
step
=
1
init
()
...
...
@@ -1031,7 +1023,6 @@
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
startTime
))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1039,7 +1030,6 @@
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1047,7 +1037,6 @@
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
var
startTime
=
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
$
(
'#effectiveStarttime'
).
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
...
...
@@ -1150,11 +1139,6 @@
// baseIsShow(false)
// treeIsShow(true)
}
console
.
log
(
model
)
// if (qs('status') == 1 && !helper.store.get('accountInfo') && isFactory) {
// $('#merchantModel').removeClass('hide')
// $('#merchantModel').addClass('show')
// }
if
(
!
accountInfo
&&
isFactory
)
{
if
(
qs
(
'status'
)
==
1
)
{
$
(
'#merchantModel'
).
removeClass
(
'hide'
)
...
...
@@ -1284,7 +1268,6 @@
getMerchantApi
(
merchantId
,
function
(
res
)
{
form
.
val
(
'merchantForm'
,
res
.
data
)
merchantForm
=
res
.
data
console
.
log
(
merchantForm
)
if
(
!
isFactory
)
{
merchantForm
.
channelId
=
parentInfo
.
channelId
}
...
...
@@ -1635,16 +1618,13 @@
// 产品复选框change事件
form
.
on
(
'checkbox(filter)'
,
function
(
data
)
{
console
.
log
(
data
,
'33333333333'
)
var
roleId
=
+
data
.
elem
.
dataset
.
id
var
projectId
=
data
.
value
var
isAdd
=
data
.
elem
.
checked
var
filterName
=
'treeTab'
+
roleId
console
.
log
(
roleId
,
projectId
,
isAdd
)
// merchantProTreeResponses
var
changeObj
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
.
find
(
i
=>
i
.
productId
==
projectId
)
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
console
.
log
(
changeObj
,
products
,
roleId
,
treeData
)
if
(
isAdd
)
{
// 新增
active
.
treeTabAdd
(
...
...
@@ -1674,7 +1654,6 @@
})
}
else
{
// 删除
console
.
log
(
treeData
,
Object
.
keys
(
treeData
).
length
)
var
productId
=
'tab_'
+
roleId
+
'_'
+
changeObj
.
productId
active
.
tabDelete
(
filterName
,
productId
)
if
(
Object
.
keys
(
treeData
).
length
!=
0
)
{
...
...
@@ -1714,24 +1693,20 @@
menuFunTreeData
=
res
.
data
var
accountType
=
$
(
'#accountType'
)
accountType
.
empty
()
console
.
log
(
menuFunTreeData
)
menuFunTreeData
.
forEach
((
item
,
index
)
=>
{
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
accountType
.
append
(
str
)
if
(
merchantId
)
{
console
.
log
(
check_arr
)
check_arr
.
forEach
(
i
=>
{
if
(
i
.
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
i
var
id
=
item
.
accounttypeId
console
.
log
(
'productData'
,
productData
)
str
.
attr
(
'checked'
,
true
)
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
active
.
tabAdd
(
obj
,
productData
.
products
)
if
(
productData
.
products
&&
productData
.
products
.
length
!=
0
)
{
productData
.
products
.
forEach
(
j
=>
{
var
products
=
item
.
products
.
find
(
n
=>
n
.
productId
==
j
.
productId
)
console
.
log
(
products
)
if
(
products
)
{
active
.
treeTabAdd
(
{
...
...
@@ -1753,7 +1728,6 @@
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
productData
.
products
[
0
].
productId
console
.
log
(
filterName
,
productId
)
active
.
tabChange
(
filterName
,
productId
)
}
}
...
...
@@ -1792,11 +1766,9 @@
// 获取角色权限数据requestList
function
getAuthList
()
{
requestList
=
[]
console
.
log
(
treeData
)
for
(
var
key
in
treeData
)
{
var
accountObj
=
treeData
[
key
]
var
productList
=
[]
console
.
log
(
accountObj
)
// 判断是否为空
if
(
Object
.
keys
(
accountObj
).
length
!=
0
)
{
for
(
var
i
in
accountObj
)
{
var
productObj
=
accountObj
[
i
]
...
...
@@ -1896,7 +1868,7 @@
})
function
submitAuth
()
{
if
(
!
accountInfo
&&
merchantAccountLevel
==
4
&&
!
merchantForm
.
effectiveStarttime
)
{
if
(
!
accountInfo
&&
merchantAccountLevel
==
4
&&
!
merchantForm
.
effectiveStarttime
)
{
layer
.
msg
(
'请去“修改基本信息”填写账户有效期'
,
{
icon
:
2
})
...
...
@@ -1915,7 +1887,6 @@
}
else
{
params
.
status
=
merchantForm
.
status
}
console
.
log
(
params
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
...
...
html/merchant/index.html
View file @
a710fcd
...
...
@@ -169,16 +169,16 @@
</div>
</div>
<!-- <div id="model"> -->
<div
id=
"model"
class=
"layui-inline
accountType
"
>
<label
class=
"
input-before-name
"
>
账户类型:
</label>
<div
id=
"model"
class=
"layui-inline"
>
<label
class=
"
layui-form-label
"
>
账户类型:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"accounttypeId"
id=
"accountTypeIdEl"
>
<option
value=
""
>
全部
</option>
</select>
</div>
</div>
<div
class=
"layui-inline
mode
"
>
<label
class=
"
input-before-name
"
>
模式:
</label>
<div
class=
"layui-inline"
>
<label
class=
"
layui-form-label
"
>
模式:
</label>
<div
class=
"layui-input-inline"
style=
"width: 246px"
>
<select
name=
"merchantModel"
id=
"searchModelEl"
>
<option
value=
""
>
全部
</option>
...
...
@@ -191,7 +191,7 @@
<input
class=
"layui-input"
type=
"text"
style=
"width: 36
5px; margin-left: 45
px;"
style=
"width: 36
7px; margin-left: 40
px;"
name=
"merchantName"
placeholder=
"请输入商户名称/关联的企业微信名"
onkeydown=
"if (event.keyCode == 13) {event.keyCode = 0;event.returnValue = false;}"
...
...
@@ -255,7 +255,6 @@
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
console
.
log
(
'accountInfo'
,
accountInfo
)
window
.
isDxternal
=
accountInfo
?
1
:
2
// 1 SCRM, default 运营平台
var
baseData
=
{
statusList
:
[],
...
...
@@ -501,7 +500,6 @@
table
.
on
(
'tool(merchant-table-filter)'
,
function
(
obj
)
{
var
eventName
=
obj
.
event
var
row
=
obj
.
data
console
.
log
(
row
.
merchantAccountLevel
)
switch
(
eventName
)
{
// 查看
case
'handleDetail'
:
...
...
@@ -559,7 +557,6 @@
break
// 修改账户有效期
case
'handleVaildPeriod'
:
// console.log(row)
var
area
=
[
'560px'
,
'230px'
]
if
(
row
.
merchantAccountLevel
==
4
)
{
area
=
[
'750px'
,
'450px'
]
...
...
@@ -638,7 +635,6 @@
method
:
'cn.com.glsx.merchants.menu.findMerchantByPage'
}
var
searchData
=
$
(
'#searchForm [name]'
).
serializeArray
()
// console.log(searchData)
$
.
each
(
searchData
,
function
()
{
if
(
this
.
name
==
'merchantLoginAccount'
)
{
var
attrName
=
params
.
accountOrPhone
==
'0'
?
'merchantLoginAccount'
:
'merchantLegalPersonPhone'
...
...
@@ -647,7 +643,6 @@
params
[
this
.
name
]
=
this
.
value
}
})
// console.log(params)
request
(
params
,
function
(
res
)
{
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
$
.
each
(
data
.
data
,
function
(
index
,
item
)
{
...
...
@@ -679,7 +674,6 @@
}
}
else
{
// 下级商户
// console.log(item)
item
.
btn
.
edit
=
true
item
.
btn
.
editPeriod
=
true
// 直属门店
...
...
html/merchant/validPeriodForm.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
#app
{
padding
:
0
;
}
.valid-period
{
/* width: 560px;
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
#app
{
padding
:
0
;
}
.valid-period
{
/* width: 560px;
height: 230px; */
text-align
:
center
;
/* padding: 20px 20px; */
background-color
:
#ffffff
;
}
.layui-form-label
{
width
:
120px
;
}
.hide
{
display
:
none
;
}
</style>
<title>
修改有效期
</title>
</head>
<body>
<div
id=
"app"
>
<main
class=
"valid-period"
>
<form
class=
"layui-form"
lay-filter=
"periodFilter"
>
<div
id=
"merchantEl"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"2"
title=
"启用"
/>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"4"
title=
"禁用"
/>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none"
></button>
</div>
<div
class=
"layui-form-item"
>
<p
class=
"input-downtips"
id=
"tips"
></p>
text-align
:
center
;
/* padding: 20px 20px; */
background-color
:
#ffffff
;
}
.layui-form-label
{
width
:
120px
;
}
.hide
{
display
:
none
;
}
</style>
<title>
修改有效期
</title>
</head>
<body>
<div
id=
"app"
>
<main
class=
"valid-period"
>
<form
class=
"layui-form"
lay-filter=
"periodFilter"
>
<div
id=
"merchantEl"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"2"
title=
"启用"
/>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"4"
title=
"禁用"
/>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none"
></button>
</div>
<div
id=
"storeEl"
class=
"layui-form-item hide
"
>
<
label
class=
"layui-form-label"
>
账户有效期:
</label
>
<div
class=
"layui-inline"
>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"effectiveStarttime"
disabled
class=
"layui-input"
name=
"effectiveStarttime"
placeholder=
"开始时间"
/
>
</div
>
<div
class=
"layui-form-mid"
>
-
</div
>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"expireDate"
class=
"layui-input"
name=
"expireDate"
placeholder=
"结束时间"
/>
</div
>
<div
class=
"layui-form-item
"
>
<
p
class=
"input-downtips"
id=
"tips"
></p
>
</div
>
</div
>
<div
id=
"storeEl"
class=
"layui-form-item hide"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label
>
<div
class=
"layui-inline"
>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"effectiveStarttime"
disabled
class=
"layui-input"
name=
"effectiveStarttime"
placeholder=
"开始时间"
/
>
</div>
<div>
<button
id=
"sevenday"
type=
"button"
class=
"layui-btn btn-no-border"
>
续7天
</button>
<button
id=
"oneyear"
type=
"button"
class=
"layui-btn btn-no-border"
>
续1年
</button>
<button
id=
"twoyears"
type=
"button"
class=
"layui-btn btn-no-border"
>
续2年
</button>
<div
class=
"layui-form-mid"
>
-
</div>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"expireDate"
class=
"layui-input"
name=
"expireDate"
placeholder=
"结束时间"
/>
</div>
</div>
</form>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'helper'
,
'request'
,
'laydate'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
laydate
=
layui
.
laydate
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
merchantAccountLevel
=
getQueryString
(
'merchantAccountLevel'
)
var
vaildData
=
{
id
:
getQueryString
(
'id'
)
}
var
storeEl
=
$
(
'#storeEl'
)
var
merchantEl
=
$
(
'#merchantEl'
)
var
expireDateEl
=
$
(
'#expireDate'
)
var
effectiveStarttimeEl
=
$
(
'#effectiveStarttime'
)
var
overdue
=
false
if
(
merchantAccountLevel
==
4
)
{
storeEl
.
show
()
merchantEl
.
hide
()
if
(
getQueryString
(
'expireDate'
)
!=
'-'
&&
getQueryString
(
'effectiveStarttime'
)
!=
'-'
)
{
vaildData
.
expireDate
=
getQueryString
(
'expireDate'
)
vaildData
.
effectiveStarttime
=
getQueryString
(
'effectiveStarttime'
)
console
.
log
(
111111111111
,
getQueryString
(
'expireDate'
))
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
if
(
overdue
)
{
$
(
'#effectiveStarttime'
).
removeAttr
(
'disabled'
)
}
form
.
val
(
'periodFilter'
,
{
expireDate
:
getQueryString
(
'expireDate'
),
effectiveStarttime
:
getQueryString
(
'effectiveStarttime'
)
})
}
else
{
<div>
<button
id=
"sevenday"
type=
"button"
class=
"layui-btn btn-no-border"
>
续7天
</button>
<button
id=
"oneyear"
type=
"button"
class=
"layui-btn btn-no-border"
>
续1年
</button>
<button
id=
"twoyears"
type=
"button"
class=
"layui-btn btn-no-border"
>
续2年
</button>
</div>
</div>
</form>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'helper'
,
'request'
,
'laydate'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
laydate
=
layui
.
laydate
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
merchantAccountLevel
=
getQueryString
(
'merchantAccountLevel'
)
var
vaildData
=
{
id
:
getQueryString
(
'id'
)
}
var
storeEl
=
$
(
'#storeEl'
)
var
merchantEl
=
$
(
'#merchantEl'
)
var
expireDateEl
=
$
(
'#expireDate'
)
var
effectiveStarttimeEl
=
$
(
'#effectiveStarttime'
)
var
overdue
=
false
if
(
merchantAccountLevel
==
4
)
{
storeEl
.
show
()
merchantEl
.
hide
()
if
(
getQueryString
(
'expireDate'
)
!=
'-'
&&
getQueryString
(
'effectiveStarttime'
)
!=
'-'
)
{
vaildData
.
expireDate
=
getQueryString
(
'expireDate'
)
vaildData
.
effectiveStarttime
=
getQueryString
(
'effectiveStarttime'
)
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
if
(
overdue
)
{
$
(
'#effectiveStarttime'
).
removeAttr
(
'disabled'
)
}
}
else
{
setText
(
2
)
console
.
log
(
getQueryString
(
'status'
))
vaildData
.
effectiveTime
=
getQueryString
(
'status'
)
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
getQueryString
(
'status'
)
expireDate
:
getQueryString
(
'expireDate'
),
effectiveStarttime
:
getQueryString
(
'effectiveStarttime'
)
})
}
else
{
$
(
'#effectiveStarttime'
).
removeAttr
(
'disabled'
)
}
var
effectiveStarttime
=
laydate
.
render
({
elem
:
'#effectiveStarttime'
,
format
:
'yyyy-MM-dd'
,
min
:
helper
.
dateFormat
(
new
Date
()),
done
:
function
(
value
,
date
)
{
// effectiveStarttime.config.min = helper.dateFormat(new Date())
console
.
log
(
value
,
date
)
date
.
month
=
date
.
month
-
1
date
.
date
=
date
.
date
+
1
expireDate
.
config
.
min
=
date
$
(
'#expireDate'
).
val
(
''
)
lay
(
'#effectiveStarttime'
).
html
(
value
)
}
})
var
expireDate
=
laydate
.
render
({
elem
:
'#expireDate'
,
format
:
'yyyy-MM-dd'
,
btns
:
[
'clear'
,
'confirm'
],
min
:
`
${
new
Date
().
getFullYear
()}
-
${
new
Date
().
getMonth
()
+
1
}
-
${
new
Date
().
getDate
()
+
1
}
`
})
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
console
.
log
(
helper
.
dateFormat
(
startTime
),
endTime
)
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
startTime
))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
}
else
{
setText
(
2
)
vaildData
.
effectiveTime
=
getQueryString
(
'status'
)
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
getQueryString
(
'status'
)
})
}
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
})
var
effectiveStarttime
=
laydate
.
render
({
elem
:
'#effectiveStarttime'
,
format
:
'yyyy-MM-dd'
,
min
:
helper
.
dateFormat
(
new
Date
()),
done
:
function
(
value
,
date
)
{
// effectiveStarttime.config.min = helper.dateFormat(new Date())
date
.
month
=
date
.
month
-
1
date
.
date
=
date
.
date
+
1
expireDate
.
config
.
min
=
date
$
(
'#expireDate'
).
val
(
''
)
lay
(
'#effectiveStarttime'
).
html
(
value
)
}
})
var
expireDate
=
laydate
.
render
({
elem
:
'#expireDate'
,
format
:
'yyyy-MM-dd'
,
btns
:
[
'clear'
,
'confirm'
],
min
:
`
${
new
Date
().
getFullYear
()}
-
${
new
Date
().
getMonth
()
+
1
}
-
${
new
Date
().
getDate
()
+
1
}
`
})
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
console
.
log
(
helper
.
dateFormat
(
endTime
))
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
})
// 1-草稿;2-正常;3-注销;4-过期
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
if
(
merchantAccountLevel
==
4
)
{
if
(
data
.
field
.
effectiveStarttime
&&
data
.
field
.
expireDate
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveStarttime
:
new
Date
(
data
.
field
.
effectiveStarttime
),
expireDate
:
new
Date
(
data
.
field
.
expireDate
)
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
$
(
'#sevenday'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
*
1
+
86400
*
7
*
1000
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
startTime
))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
})
$
(
'#oneyear'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
1
)
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
})
$
(
'#twoyears'
).
on
(
'click'
,
function
()
{
const
startDate
=
getStartTime
(
vaildData
.
expireDate
).
startDate
const
overdue
=
getStartTime
(
vaildData
.
expireDate
).
overdue
var
startTime
=
new
Date
(
startDate
.
setHours
(
0
,
0
,
0
,
0
))
var
endTime
=
startTime
.
setFullYear
(
startTime
.
getFullYear
()
+
2
)
if
(
overdue
)
effectiveStarttimeEl
.
val
(
helper
.
dateFormat
(
new
Date
(
new
Date
().
setHours
(
0
,
0
,
0
,
0
))))
expireDateEl
.
val
(
helper
.
dateFormat
(
endTime
))
})
// 1-草稿;2-正常;3-注销;4-过期
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
if
(
merchantAccountLevel
==
4
)
{
if
(
data
.
field
.
effectiveStarttime
&&
data
.
field
.
expireDate
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveStarttime
:
new
Date
(
data
.
field
.
effectiveStarttime
),
expireDate
:
new
Date
(
data
.
field
.
expireDate
)
}
}
else
{
if
(
data
.
field
.
effectiveTime
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveTime
:
data
.
field
.
effectiveTime
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
}
}
else
{
if
(
data
.
field
.
effectiveTime
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveTime
:
data
.
field
.
effectiveTime
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
}
}
return
false
})
return
false
})
// 触发单选框
form
.
on
(
'radio(radio)'
,
function
(
data
)
{
setText
(
data
.
value
)
})
// 触发单选框
form
.
on
(
'radio(radio)'
,
function
(
data
)
{
setText
(
data
.
value
)
})
function
setText
(
value
)
{
if
(
value
==
2
)
{
$
(
'#tips'
).
text
(
'启用商户,其下级商户也会启用,但门店账户由门店本身的有效期控制。'
)
}
else
if
(
value
==
4
)
{
$
(
'#tips'
).
text
(
'禁用商户,其下级商户及门店全部禁止登录。'
)
}
function
setText
(
value
)
{
if
(
value
==
2
)
{
$
(
'#tips'
).
text
(
'启用商户,其下级商户也会启用,但门店账户由门店本身的有效期控制。'
)
}
else
if
(
value
==
4
)
{
$
(
'#tips'
).
text
(
'禁用商户,其下级商户及门店全部禁止登录。'
)
}
}
function
getStartTime
(
time
)
{
var
expireDate
=
new
Date
(
time
)
var
currentDate
=
new
Date
()
if
(
expireDate
.
getTime
()
>
currentDate
.
getTime
())
{
return
{
startDate
:
expireDate
,
overdue
:
false
}
}
else
{
return
{
startDate
:
currentDate
,
overdue
:
true
}
function
getStartTime
(
time
)
{
var
expireDate
=
new
Date
(
time
)
var
currentDate
=
new
Date
()
if
(
expireDate
.
getTime
()
>
currentDate
.
getTime
())
{
return
{
startDate
:
expireDate
,
overdue
:
false
}
}
else
{
return
{
startDate
:
currentDate
,
overdue
:
true
}
}
}
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
])
}
return
null
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
])
}
})
</script>
</body>
</html>
return
null
}
})
</script>
</body>
</html>
\ No newline at end of file
html/role/add.html
View file @
a710fcd
...
...
@@ -234,7 +234,6 @@
clickClose
:
true
,
data
:
[],
on
:
function
(
data
)
{
console
.
log
(
data
)
merchantId
=
data
.
change
[
0
].
id
findMenuFunTreeByMerId
(
merchantId
)
}
...
...
@@ -321,11 +320,7 @@
laytpl
(
getTpl
).
render
(
templateData
,
function
(
html
)
{
view
.
innerHTML
=
html
})
// var productList = []
// var products = []
console
.
log
(
productList
)
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
id
).
products
console
.
log
(
products
)
products
.
forEach
(
i
=>
{
var
str
=
$
(
'<input lay-filter="filter" data-id="'
+
id
+
'" type="checkbox" name="check['
+
id
+
']" value="'
+
i
.
productId
+
'" title="'
+
i
.
productName
+
'" lay-skin="primary" />'
)
$
(
'#project'
+
id
).
append
(
str
)
...
...
@@ -380,7 +375,6 @@
},
// tab Change
tabChange
:
function
(
name
,
id
)
{
console
.
log
(
name
,
id
)
element
.
tabChange
(
name
,
id
)
if
(
name
==
'roleAuth'
)
{
$
(
`#nomenu
${
id
}
`
).
html
(
'请选择产品'
)
...
...
@@ -390,7 +384,6 @@
$
(
`#nodata
${
accounttypeId
}
`
).
removeClass
(
'show'
)
$
(
`#nodata
${
accounttypeId
}
`
).
addClass
(
'hide'
)
$
(
`#nomenu
${
accounttypeId
}
`
).
html
(
'暂无可选择的菜单功能'
)
console
.
log
(
menuFunTreeData
)
menuFunTreeData
.
forEach
(
item
=>
{
if
(
item
.
accounttypeId
==
accounttypeId
)
{
item
.
products
.
forEach
(
i
=>
{
...
...
@@ -419,7 +412,6 @@
* defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3])
*/
treeTabAdd
:
function
(
item
,
id
,
treeListData
,
defaultList
)
{
console
.
log
(
item
,
id
,
treeListData
,
defaultList
)
var
productId
=
'tab_'
+
id
+
'_'
+
item
.
value
var
filterName
=
'treeTab'
+
id
// 过滤器的名称 lay-filter
element
.
tabAdd
(
filterName
,
{
...
...
@@ -434,7 +426,6 @@
treeData
[
id
][
item
.
value
].
id
=
productId
// 渲染模版的数据
treeData
[
id
][
item
.
value
].
productId
=
item
.
value
laytpl
(
getTreeTpl
).
render
(
treeData
[
id
][
item
.
value
],
function
(
html
)
{
console
.
log
(
treeView
)
treeView
.
innerHTML
=
html
})
// var treeListData = []
...
...
@@ -466,16 +457,13 @@
}
// 产品复选框change事件
form
.
on
(
'checkbox(filter)'
,
function
(
data
)
{
console
.
log
(
data
,
'33333333333'
)
var
roleId
=
+
data
.
elem
.
dataset
.
id
var
projectId
=
data
.
value
var
isAdd
=
data
.
elem
.
checked
var
filterName
=
'treeTab'
+
roleId
console
.
log
(
roleId
,
projectId
,
isAdd
)
// merchantProTreeResponses
var
changeObj
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
.
find
(
i
=>
i
.
productId
==
projectId
)
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
roleId
).
products
console
.
log
(
changeObj
,
products
,
roleId
,
treeData
)
if
(
isAdd
)
{
// 新增
active
.
treeTabAdd
(
...
...
@@ -488,7 +476,6 @@
)
}
else
{
// 删除
console
.
log
(
treeData
,
Object
.
keys
(
treeData
).
length
)
var
productId
=
'tab_'
+
roleId
+
'_'
+
changeObj
.
productId
active
.
tabDelete
(
filterName
,
productId
)
if
(
Object
.
keys
(
treeData
).
length
!=
0
)
{
...
...
@@ -507,17 +494,14 @@
// 复选框的change事件
form
.
on
(
'checkbox(switch)'
,
function
(
data
)
{
console
.
log
(
data
,
'111111111'
,
treeData
)
if
(
data
.
elem
.
checked
)
{
var
obj
=
{
title
:
data
.
elem
.
title
,
value
:
data
.
elem
.
value
}
check_arr
.
push
({
accounttypeId
:
data
.
elem
.
value
})
active
.
tabAdd
(
obj
)
console
.
log
(
check_arr
)
treeData
[
+
data
.
elem
.
value
]
=
{}
}
else
{
console
.
log
(
11222
)
for
(
var
i
in
check_arr
)
{
var
id
=
check_arr
[
i
].
accounttypeId
if
(
check_arr
[
i
].
accounttypeId
==
data
.
elem
.
value
)
{
...
...
@@ -527,7 +511,6 @@
}
delete
treeData
[
data
.
elem
.
value
]
}
console
.
log
(
treeData
)
if
(
check_arr
.
length
!=
0
)
{
active
.
tabChange
(
'roleAuth'
,
check_arr
[
0
].
accounttypeId
)
}
...
...
@@ -536,7 +519,6 @@
// 表单提交
form
.
on
(
'submit(roleSubmit)'
,
function
(
data
)
{
console
.
log
(
data
.
value
,
check_arr
,
treeData
)
if
(
check_arr
.
length
==
0
)
{
layer
.
msg
(
'请选择角色权限'
,
{
icon
:
2
...
...
@@ -550,7 +532,6 @@
// select 选择触发
form
.
on
(
'select(merchants)'
,
function
(
data
)
{
console
.
log
(
data
.
value
,
check_arr
,
treeData
)
check_arr
.
forEach
(
item
=>
{
active
.
tabDelete
(
'roleAuth'
,
item
.
accounttypeId
)
})
...
...
@@ -563,7 +544,6 @@
// 存草稿
$
(
'#draft'
).
on
(
'click'
,
function
()
{
var
formVal
=
form
.
val
(
'roleForm'
)
console
.
log
(
formVal
)
if
(
!
formVal
.
merchantId
)
{
layer
.
msg
(
'请选择所属商户'
,
{
icon
:
2
...
...
@@ -592,7 +572,6 @@
merchantId
:
merchantId
,
delFlag
:
delFlag
}
console
.
log
(
requestList
)
let
hasProduct
=
requestList
.
some
(
item
=>
item
.
productList
.
length
!=
0
)
// 找这个数组里面是否有空值,然后判断是否为草稿,
if
(
delFlag
==
1
)
{
// 草稿
...
...
@@ -633,7 +612,6 @@
}
var
params
=
helper
.
clone
(
true
,
formVal
,
otherParams
)
delete
params
.
select
console
.
log
(
params
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
...
...
@@ -654,28 +632,22 @@
if
(
res
.
code
==
'0'
)
{
// callback(res.data)
menuFunTreeData
=
res
.
data
console
.
log
(
res
.
data
)
var
accountType
=
$
(
'#accountType'
)
accountType
.
empty
()
menuFunTreeData
.
forEach
((
item
,
index
)
=>
{
var
str
=
$
(
'<input lay-filter="switch" type="checkbox" name="accounttypeId" value="'
+
item
.
accounttypeId
+
'" title="'
+
item
.
accounttypeName
+
'" />'
)
accountType
.
append
(
str
)
if
(
roleid
)
{
console
.
log
(
check_arr
)
check_arr
.
forEach
(
i
=>
{
if
(
i
.
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
i
var
id
=
item
.
accounttypeId
console
.
log
(
'productData'
,
productData
)
str
.
attr
(
'checked'
,
true
)
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
active
.
tabAdd
(
obj
,
productData
.
productList
)
console
.
log
(
productData
.
productList
)
if
(
productData
.
productList
&&
productData
.
productList
.
length
!=
0
)
{
productData
.
productList
.
forEach
(
j
=>
{
console
.
log
(
j
,
item
)
var
products
=
item
.
products
.
find
(
n
=>
n
.
productId
==
j
.
productId
)
console
.
log
(
products
)
active
.
treeTabAdd
(
{
name
:
j
.
productName
,
...
...
@@ -695,7 +667,6 @@
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
productData
.
productList
[
0
].
productId
console
.
log
(
filterName
,
productId
)
active
.
tabChange
(
filterName
,
productId
)
}
else
{
treeData
[
productData
.
accounttypeId
]
=
{}
...
...
@@ -777,12 +748,10 @@
// 获取角色权限数据requestList
function
getAuthList
()
{
requestList
=
[]
console
.
log
(
treeData
,
check_arr
)
// check_arr.forEach(i => {
for
(
var
key
in
treeData
)
{
var
accountObj
=
treeData
[
key
]
var
productList
=
[]
console
.
log
(
treeData
)
// if (i.accounttypeId == key) {
// if (Object.keys(accountObj).length != 0) {
for
(
var
i
in
accountObj
)
{
...
...
@@ -823,7 +792,6 @@
}
})
$
.
each
(
functionIdLists
,
function
(
idx
,
m
)
{
// console.log(m)
functionIdList
.
push
({
id
:
m
.
parentId
,
menuId
:
m
.
superParentId
...
...
@@ -863,7 +831,6 @@
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
...
...
html/role/detail.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<title>
角色管理
</title>
</head>
<style>
.sub-bg-white
{
background-color
:
#f4f5fa
;
padding-top
:
8px
;
/* height: 100%; */
padding-bottom
:
100px
;
}
.tabmutiple-content-wrap
{
background-color
:
#f4f6fc
;
padding
:
0
0
1px
;
margin
:
0
20px
;
}
.tabmutiple-content
{
margin
:
0
10px
;
background-color
:
#f4f6fc
;
}
.layui-tab-content
{
background-color
:
#fff
;
}
.layui-tab-title
{
background-color
:
#f4f6fc
;
}
.outtitle
{
margin-left
:
-10px
;
}
.layui-this
{
background-color
:
#fff
;
border
:
2px
solid
#fff
;
}
.layui-tab-title
.layui-this
{
transform
:
none
;
}
.layui-tab-card
>
.layui-tab-title
li
{
margin-left
:
0
;
}
.topwrap
{
margin
:
0
20px
0
;
background-color
:
#fff
;
position
:
relative
;
}
.topwrap
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.bottomwrap
{
margin
:
20px
20px
0
;
background-color
:
#fff
;
/* height: 100%; */
padding-bottom
:
30px
;
}
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"bg-white wrapper detail"
>
<div
class=
"sub-bg-white"
>
<div
class=
"topwrap"
>
<div
class=
"grayLine"
></div>
<div
class=
"content-title"
>
<span>
角色基本信息
</span>
<div
class=
"title-right"
id=
"merchantName"
></div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleName"
></div>
</div>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<title>
角色管理
</title>
</head>
<style>
.sub-bg-white
{
background-color
:
#f4f5fa
;
padding-top
:
8px
;
/* height: 100%; */
padding-bottom
:
100px
;
}
.tabmutiple-content-wrap
{
background-color
:
#f4f6fc
;
padding
:
0
0
1px
;
margin
:
0
20px
;
}
.tabmutiple-content
{
margin
:
0
10px
;
background-color
:
#f4f6fc
;
}
.layui-tab-content
{
background-color
:
#fff
;
}
.layui-tab-title
{
background-color
:
#f4f6fc
;
}
.outtitle
{
margin-left
:
-10px
;
}
.layui-this
{
background-color
:
#fff
;
border
:
2px
solid
#fff
;
}
.layui-tab-title
.layui-this
{
transform
:
none
;
}
.layui-tab-card
>
.layui-tab-title
li
{
margin-left
:
0
;
}
.topwrap
{
margin
:
0
20px
0
;
background-color
:
#fff
;
position
:
relative
;
}
.topwrap
.grayLine
{
position
:
absolute
;
left
:
0
;
top
:
48px
;
background-color
:
#d8d8d8
;
width
:
100%
;
height
:
1px
;
}
.bottomwrap
{
margin
:
20px
20px
0
;
background-color
:
#fff
;
/* height: 100%; */
padding-bottom
:
30px
;
}
.show
{
display
:
inline-block
;
}
.hide
{
display
:
none
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"bg-white wrapper detail"
>
<div
class=
"sub-bg-white"
>
<div
class=
"topwrap"
>
<div
class=
"grayLine"
></div>
<div
class=
"content-title"
>
<span>
角色基本信息
</span>
<div
class=
"title-right"
id=
"merchantName"
></div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleName"
></div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色号:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleCode"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色号:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"roleCode"
><
/div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色说明:
</label
>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleDescription"
></div
>
</div>
</div
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色说明:
</label
>
<div
class=
"layui-input-block"
>
<
div
class=
"layui-form-mid layui-word-aux"
id=
"roleDescription"
><
/div>
</div>
</div>
</div>
<div
class=
"bottomwrap"
>
<h3
class=
"content-title layui-form"
>
角色权限
<!-- <select id="accountType" name="accountType" lay-filter="accountSelect">
<div
class=
"bottomwrap"
>
<h3
class=
"content-title layui-form"
>
角色权限
<!-- <select id="accountType" name="accountType" lay-filter="accountSelect">
</select> -->
</h3>
<div
class=
"tabmutiple-content-wrap"
>
<div
class=
"layui-tab tabmutiple-content"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title outtitle"
></ul>
<div
class=
"layui-tab-content"
></div>
</div>
</h3>
<div
class=
"tabmutiple-content-wrap"
>
<div
class=
"layui-tab tabmutiple-content"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title outtitle"
></ul>
<div
class=
"layui-tab-content"
></div>
</div>
</div>
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal btn-one"
id=
"return"
>
关闭
</button>
</div>
</div>
</main
>
</div
>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script
>
<script
src=
"/js/load.js"
></script
>
<
script
>
layui
.
use
([
'request'
,
'helper'
,
'form'
,
'treeTab'
],
function
()
{
var
request
=
layui
.
request
var
helper
=
layui
.
helper
var
form
=
layui
.
form
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
var
treeTab
=
layui
.
treeTab
var
roleid
=
qs
(
'id'
)
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'roleName'
,
'roleCode'
,
'roleDescription'
,
'merchantName'
]
var
roleData
=
{}
var
menuFunTreeData
=
[]
var
templateData
=
{}
var
treeData
=
{}
// 查询角色详情
getById
()
findMenuFunTreeByRoleId
()
$
(
'#return'
).
on
(
'click'
,
function
()
{
window
.
history
.
back
()
}
)
<div
class=
"footer-close"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal btn-one"
id=
"return"
>
关闭
</button
>
</div
>
</div
>
<
/main
>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'request'
,
'helper'
,
'form'
,
'treeTab'
],
function
()
{
var
request
=
layui
.
request
var
helper
=
layui
.
helper
var
form
=
layui
.
form
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
var
treeTab
=
layui
.
treeTab
var
roleid
=
qs
(
'id'
)
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'roleName'
,
'roleCode'
,
'roleDescription'
,
'merchantName'
]
var
roleData
=
{}
var
menuFunTreeData
=
[]
var
templateData
=
{}
var
treeData
=
{}
// 查询角色详情
getById
()
findMenuFunTreeByRoleId
(
)
function
getById
()
{
var
params
=
{
id
:
roleid
,
method
:
'org.ore.api.role.getById'
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
console
.
log
(
roleData
)
roleData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
||
'无'
)
}
// callback(roleData.responseList)
}
})
}
$
(
'#return'
).
on
(
'click'
,
function
()
{
window
.
history
.
back
()
})
function
findMenuFunTreeByRoleId
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByRoleId'
,
id
:
roleid
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
&&
res
.
data
&&
res
.
data
.
length
!=
0
)
{
var
authList
=
res
.
data
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
var
menuData
=
[]
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
})
console
.
log
(
authList
)
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
function
getById
()
{
var
params
=
{
id
:
roleid
,
method
:
'org.ore.api.role.getById'
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
roleData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
||
'无'
)
}
})
// callback(roleData.responseList)
}
})
}
function
findMenuFunTreeByRoleId
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByRoleId'
,
id
:
roleid
}
})
</script>
<!-- <script type="text/html" id="treeAuth">
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
&&
res
.
data
&&
res
.
data
.
length
!=
0
)
{
var
authList
=
res
.
data
$
.
each
(
authList
,
function
(
index
,
item
)
{
treeTab
.
tabAdd
(
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
},
true
)
var
menuData
=
[]
if
(
item
.
products
&&
item
.
products
.
length
!=
0
)
{
$
.
each
(
item
.
products
,
function
(
idx
,
m
)
{
treeTab
.
treeTabDetail
(
{
name
:
m
.
productName
,
value
:
m
.
productId
},
item
.
accounttypeId
,
m
.
merchantProTreeResponses
)
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
treeTab
.
tabChange
(
filterName
,
productId
)
}
})
treeTab
.
tabChange
(
'roleAuth'
,
authList
[
0
].
accounttypeId
)
}
})
}
})
</script>
<!-- <script type="text/html" id="treeAuth">
<ul id="tree_{{d.id}}" class="ztree wrapper-tree"></ul>
<div class="layui-no-data show" id="nomenu{{d.id}}">
<div class="no-data">
...
...
@@ -212,5 +222,6 @@
</div>
</div>
</script> -->
</body>
</html>
</body>
</html>
\ No newline at end of file
html/role/index.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<title>
角色管理
</title>
</head>
<style>
xm-select
>
.xm-body
.scroll-body
{
width
:
300px
;
}
xm-select
:hover
{
border
:
1px
solid
#5850ff
!important
;
}
.hide
{
display
:
none
;
}
.show
{
display
:
inline-block
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"bg-white"
>
<div>
<div
class=
"search-block"
>
<form
action=
""
class=
"layui-form"
lay-filter=
"roleForm"
>
<div
class=
"layui-form-item"
>
<div
class=
"twocol"
>
<div
class=
"layui-inline"
pane
id=
"addEl"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal createBtn"
id=
"addRole"
>
<i
class=
"layui-icon layui-icon-addition"
style=
"vertical-align: top"
></i>
<span>
创建角色
</span>
</button>
</div>
<div
class=
"layui-inline companyName"
pane
>
<label
class=
"layui-form-label"
>
商户名称
</label>
<div
class=
"layui-input-block"
>
<!-- <select name="merchantId" id="merchantName" lay-verify="required"></select> -->
<div
id=
"merchantNameSelect"
style=
"width: 300px"
class=
"xm-select-demo"
></div>
</div>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"广联帐户管理中心-员工管理"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<title>
角色管理
</title>
</head>
<style>
xm-select
>
.xm-body
.scroll-body
{
width
:
300px
;
}
xm-select
:hover
{
border
:
1px
solid
#5850ff
!important
;
}
.hide
{
display
:
none
;
}
.show
{
display
:
inline-block
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"bg-white"
>
<div>
<div
class=
"search-block"
>
<form
action=
""
class=
"layui-form"
lay-filter=
"roleForm"
>
<div
class=
"layui-form-item"
>
<div
class=
"twocol"
>
<div
class=
"layui-inline"
pane
id=
"addEl"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal createBtn"
id=
"addRole"
>
<i
class=
"layui-icon layui-icon-addition"
style=
"vertical-align: top"
></i>
<span>
创建角色
</span>
</button>
</div>
<div
class=
"layui-inline companyName"
pane
>
<label
class=
"layui-form-label"
>
商户名称
</label>
<div
class=
"layui-input-block"
>
<!-- <select name="merchantId" id="merchantName" lay-verify="required"></select> -->
<div
id=
"merchantNameSelect"
style=
"width: 300px"
class=
"xm-select-demo"
></div>
</div>
</div>
</div>
</div>
<div
class=
"divideLine"
></div>
<div
class=
"layui-form-item secondInput"
>
<div
class=
"layui-inline"
>
<!-- <label class="layui-form-label">状态</label> -->
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-inline"
style=
"margin-left: 0"
>
<select
name=
"delFlag"
id=
"status"
lay-verify=
"required"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
草稿
</option>
<option
value=
"0"
>
正常
</option>
</select>
</div>
<div
class=
"divideLine"
></div>
<div
class=
"layui-form-item secondInput"
>
<div
class=
"layui-inline"
>
<!-- <label class="layui-form-label">状态</label> -->
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-inline"
style=
"margin-left: 0"
>
<select
name=
"delFlag"
id=
"status"
lay-verify=
"required"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
草稿
</option>
<option
value=
"0"
>
正常
</option>
</select>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
角色名称
</label
>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"roleName"
placeholder=
"请输入角色名称"
autocomplete=
"off"
class=
"layui-input"
/
>
<
/div
>
</div
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
角色名称
</label
>
<div
class=
"layui-input-inline"
>
<
input
type=
"text"
name=
"roleName"
placeholder=
"请输入角色名称"
autocomplete=
"off"
class=
"layui-input"
/
>
</div>
</div>
<div
class=
"layui-inline"
style=
"float: right"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"roleSearch"
>
查询
</button>
</div>
<div
class=
"layui-inline"
style=
"float: right"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"roleSearch"
>
查询
</button>
</div>
</form>
<div
class=
"table-page"
>
<table
id=
"roleTable"
lay-filter=
"roleTool"
></table>
<div
id=
"rolePage"
class=
"align-left"
></div>
</div>
</form>
<div
class=
"table-page"
>
<table
id=
"roleTable"
lay-filter=
"roleTool"
></table>
<div
id=
"rolePage"
class=
"align-left"
></div>
</div>
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
,
'laypage'
,
'xmSelect'
],
function
()
{
var
request
=
layui
.
request
var
table
=
layui
.
table
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
// 商户名称列表
var
merchantName
=
$
(
'#merchantName'
)
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
if
(
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
)
{
$
(
'.companyName'
).
addClass
(
'hide'
)
}
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'所属商户名'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
,
width
:
100
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
},
{
fixed
:
'right'
,
title
:
'操作'
,
minWidth
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
var
colums
=
[
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
//创建table实例
var
roleTable
=
table
.
render
({
elem
:
'#roleTable'
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
?
[
colums
]
:
[
cols
]
})
</div>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
,
'laypage'
,
'xmSelect'
],
function
()
{
var
request
=
layui
.
request
var
table
=
layui
.
table
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
// 商户名称列表
var
merchantName
=
$
(
'#merchantName'
)
var
accountInfo
=
helper
.
store
.
get
(
'accountInfo'
)
if
(
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
)
{
$
(
'.companyName'
).
addClass
(
'hide'
)
}
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'所属商户名'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
,
width
:
100
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
},
{
fixed
:
'right'
,
title
:
'操作'
,
minWidth
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
var
colums
=
[
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
60
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'createdTime'
,
title
:
'创建时间'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
//创建table实例
var
roleTable
=
table
.
render
({
elem
:
'#roleTable'
,
skin
:
'nob'
,
height
:
'full-300'
,
cols
:
accountInfo
&&
accountInfo
.
merchantAccountLevel
==
4
?
[
colums
]
:
[
cols
]
})
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'rolePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
)
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
limit
)
//得到每页显示的条数
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getTabelList
(
roleTable
,
form
.
val
(
'roleForm'
))
}
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'rolePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
//do something
getTabelList
(
roleTable
,
form
.
val
(
'roleForm'
))
}
}
}
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
filterable
:
true
,
clickClose
:
true
,
radio
:
true
,
data
:
[]
})
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
init
()
function
init
()
{
findAllMerchant
()
getTabelList
(
roleTable
)
}
// 获取table列表接口
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
page
.
pageNum
,
pageSize
:
page
.
pageSize
,
method
:
'org.ore.api.role.page'
},
name
:
'merchantId'
,
filterable
:
true
,
clickClose
:
true
,
radio
:
true
,
data
:
[]
search
)
request
(
params
,
function
(
res
)
{
// var data = res.data
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
var
options
=
{
data
:
data
.
data
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
pageOptions
.
curr
=
1
}
laypage
.
render
(
pageOptions
)
roleTable
.
reload
(
options
)
})
init
()
function
init
()
{
findAllMerchant
()
getTabelList
(
roleTable
)
}
// 获取table列表接口
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
page
.
pageNum
,
pageSize
:
page
.
pageSize
,
method
:
'org.ore.api.role.page'
},
search
)
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
// var data = res.data
var
data
=
helper
.
formateNullFieldData
(
res
.
data
)
var
options
=
{
data
:
data
.
data
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
pageOptions
.
curr
=
1
}
laypage
.
render
(
pageOptions
)
roleTable
.
reload
(
options
)
})
}
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
paging
:
result
.
data
.
length
>
20
})
// var list = result.data
// list.unshift('')
// $.each(list, function (index, item) {
// merchantName.append(new Option(item.merchantName, item.id))
// })
// form.render('select')
}
})
}
// table工具条事件
table
.
on
(
'tool(roleTool)'
,
function
(
obj
)
{
var
data
=
obj
.
data
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
go
(
'role'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
var
params
=
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
}
go
(
'role'
,
'add'
,
params
)
}
else
if
(
layEvent
===
'del'
)
{
layer
.
confirm
(
'是否确认删除该角色?'
,
function
(
index
)
{
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
var
params
=
{
method
:
'org.ore.api.role.deleteById'
,
id
:
data
.
id
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
close
(
index
)
console
.
log
(
'shanchu'
)
getTabelList
(
roleTable
)
}
})
}
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
merchantNameSelect
.
update
({
data
:
result
.
data
,
autoRow
:
true
,
paging
:
result
.
data
.
length
>
20
})
// var list = result.data
// list.unshift('')
// $.each(list, function (index, item) {
// merchantName.append(new Option(item.merchantName, item.id))
// })
// form.render('select')
}
})
// 新增点击事件
$
(
'#addRole'
).
on
(
'click'
,
function
()
{
go
(
'role'
,
'add'
)
})
// 查询事件
$
(
'#roleSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
form
.
val
(
'roleForm'
)
console
.
log
(
searchData
)
getTabelList
(
roleTable
,
searchData
,
true
)
})
}
// table工具条事件
table
.
on
(
'tool(roleTool)'
,
function
(
obj
)
{
var
data
=
obj
.
data
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
go
(
'role'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
var
params
=
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
,
merchantName
:
data
.
merchantName
}
go
(
'role'
,
'add'
,
params
)
}
else
if
(
layEvent
===
'del'
)
{
layer
.
confirm
(
'是否确认删除该角色?'
,
function
(
index
)
{
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
var
params
=
{
method
:
'org.ore.api.role.deleteById'
,
id
:
data
.
id
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
close
(
index
)
getTabelList
(
roleTable
)
}
})
})
}
})
</script>
<script
type=
"text/html"
id=
"roleBar"
>
// 新增点击事件
$
(
'#addRole'
).
on
(
'click'
,
function
()
{
go
(
'role'
,
'add'
)
})
// 查询事件
$
(
'#roleSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
form
.
val
(
'roleForm'
)
getTabelList
(
roleTable
,
searchData
,
true
)
})
})
</script>
<script
type=
"text/html"
id=
"roleBar"
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"detail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
{{
#
if
(
d
.
delFlag
==
1
){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
{{
#
}
}}
</script>
</body>
</html>
</body>
</html>
\ No newline at end of file
html/role/tree.html
View file @
a710fcd
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
.valid-period
{
text-align
:
center
;
padding
:
20px
20px
;
background-color
:
#ffffff
;
}
</style>
<title>
tree
</title>
</head>
<body>
<div
id=
"app"
>
<main>
fdasfda
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
console
.
log
(
qs
(
'id'
))
</script>
</body>
</html>
<head>
<meta
charset=
"utf-8"
/>
<meta
content=
"IE=edge"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"修改有效期"
/>
<meta
name=
"author"
content=
"GLSX Web Team"
/>
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,商户管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
.valid-period
{
text-align
:
center
;
padding
:
20px
20px
;
background-color
:
#ffffff
;
}
</style>
<title>
tree
</title>
</head>
<body>
<div
id=
"app"
>
<main>
fdasfda
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
</script>
</body>
</html>
\ No newline at end of file
js/gtree.js
View file @
a710fcd
...
...
@@ -28,8 +28,7 @@ layui.define(['ztree'], function (exports) {
}
}
function
zTreeOnExpand
(
event
,
treeId
,
treeNode
)
{
console
.
log
(
treeNode
)
treeNode
.
check
=
true
treeNode
.
check
=
true
}
var
setting
=
{
view
:
{
...
...
@@ -63,8 +62,8 @@ layui.define(['ztree'], function (exports) {
if
(
selfSetting
)
Object
.
assign
(
setting
,
selfSetting
)
inst
=
tree
.
init
(
$treeDom
,
setting
,
nodes
)
inst
.
expandAll
(
true
)
inst
.
checkNodes
=
function
(
checked
)
{
inst
.
checkNodes
=
function
(
checked
)
{
var
nodesLevel1
=
this
.
getNodes
()
var
nodesAll
=
this
.
transformToArray
(
nodesLevel1
)
for
(
var
i
=
0
;
i
<=
nodesAll
.
length
;
i
++
)
{
...
...
js/helper.js
View file @
a710fcd
...
...
@@ -128,7 +128,6 @@ layui.define(['store'], function (exports) {
}
function
dateFormat
(
time
,
fmt
=
'YYYY-mm-dd'
)
{
console
.
log
(
time
,
'============'
)
var
time
=
new
Date
(
time
)
let
ret
;
const
opt
=
{
...
...
@@ -141,10 +140,10 @@ layui.define(['store'], function (exports) {
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for
(
let
k
in
opt
)
{
ret
=
new
RegExp
(
"("
+
k
+
")"
).
exec
(
fmt
);
if
(
ret
)
{
fmt
=
fmt
.
replace
(
ret
[
1
],
(
ret
[
1
].
length
==
1
)
?
(
opt
[
k
])
:
(
opt
[
k
].
padStart
(
ret
[
1
].
length
,
"0"
)))
};
ret
=
new
RegExp
(
"("
+
k
+
")"
).
exec
(
fmt
);
if
(
ret
)
{
fmt
=
fmt
.
replace
(
ret
[
1
],
(
ret
[
1
].
length
==
1
)
?
(
opt
[
k
])
:
(
opt
[
k
].
padStart
(
ret
[
1
].
length
,
"0"
)))
};
};
return
fmt
;
}
...
...
js/treeTab.js
View file @
a710fcd
...
...
@@ -97,7 +97,6 @@ layui.define(['element', 'laytpl', 'gtree', 'xmSelect'], function (exports) {
// tab Change
tabChange
:
function
(
name
,
id
)
{
element
.
tabChange
(
name
,
id
)
console
.
log
(
name
,
id
)
if
(
name
==
'roleAuth'
)
{
$
(
`#nomenu
${
id
}
`
).
html
(
'暂无数据'
)
}
else
{
...
...
@@ -105,7 +104,6 @@ layui.define(['element', 'laytpl', 'gtree', 'xmSelect'], function (exports) {
const
productId
=
id
.
split
(
'_'
)[
2
]
$
(
`#nodata
${
accounttypeId
}
`
).
removeClass
(
'show'
)
$
(
`#nodata
${
accounttypeId
}
`
).
addClass
(
'hide'
)
console
.
log
(
menuFunTreeData
)
menuFunTreeData
.
forEach
(
item
=>
{
if
(
item
.
accounttypeId
==
accounttypeId
)
{
item
.
products
.
forEach
(
i
=>
{
...
...
@@ -134,7 +132,6 @@ layui.define(['element', 'laytpl', 'gtree', 'xmSelect'], function (exports) {
* defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3])
*/
treeTabAdd
:
function
(
item
,
id
,
products
,
defaultList
)
{
console
.
log
(
defaultList
)
var
productId
=
'tab_'
+
id
+
'_'
+
item
.
value
var
filterName
=
'treeTab'
+
id
// 过滤器的名称 lay-filter
element
.
tabAdd
(
filterName
,
{
...
...
@@ -164,10 +161,9 @@ layui.define(['element', 'laytpl', 'gtree', 'xmSelect'], function (exports) {
treeListData
=
i
.
merchantProTreeResponses
}
})
console
.
log
(
'treeListData'
,
treeListData
)
var
treedom
=
'tree_'
+
productId
treeData
[
id
][
item
.
value
].
treeObj
=
tree
.
create
(
treedom
,
treeListData
,
{
chkDisabled
:
true
})
},
treeTabDetail
:
function
(
item
,
id
,
productTreeList
)
{
var
productId
=
'tab_'
+
id
+
'_'
+
item
.
value
...
...
@@ -199,13 +195,12 @@ layui.define(['element', 'laytpl', 'gtree', 'xmSelect'], function (exports) {
enable
:
false
}
})
console
.
log
(
productTreeList
)
if
(
productTreeList
&&
productTreeList
.
length
!=
0
)
{
$
(
`#nomenu
${
productId
}
`
).
removeClass
(
'show'
)
$
(
`#nomenu
${
productId
}
`
).
addClass
(
'hide'
)
// } else {
// $(`#nodata${id}`).removeClass('hide')
// $(`#nodata${id}`).addClass('show')
// } else {
// $(`#nodata${id}`).removeClass('hide')
// $(`#nodata${id}`).addClass('show')
}
}
}
...
...
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