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 8fde78b2
authored
Sep 26, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改角色和员工列表页
1 parent
9b05ed52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
282 additions
and
125 deletions
html/employee/add.html
html/employee/index.html
html/merchant/add.html
html/merchant/index.html
html/role/index.html
js/load.js
html/employee/add.html
View file @
8fde78b
...
@@ -135,8 +135,12 @@
...
@@ -135,8 +135,12 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
角色权限:
</label>
<label
class=
"layui-form-label required"
>
角色权限:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
style=
"position: relative"
>
<select
name=
"roleIds"
id=
"roleAuth"
lay-verify=
"required"
></select>
<select
name=
"roleIds"
id=
"roleAuth"
lay-verify=
"required"
></select>
<div
id=
"btnGroup"
class=
"layui-btn-group hide"
style=
"position: absolute; top: 0; right: -170px;"
>
<button
type=
"button"
class=
"layui-btn"
id=
"refresh"
>
刷新
</button>
<button
type=
"button"
class=
"layui-btn"
id=
"addRole"
>
创建角色
</button>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
@@ -205,7 +209,11 @@
...
@@ -205,7 +209,11 @@
var
merchantId
=
''
var
merchantId
=
''
var
visibleMerchant
=
{}
var
visibleMerchant
=
{}
pwd
.
attr
(
'readonly'
,
false
)
pwd
.
attr
(
'readonly'
,
false
)
var
user
=
helper
.
store
.
get
(
'user'
)
console
.
log
(
user
)
if
(
user
.
accountLevel
==
4
)
{
$
(
'#btnGroup'
).
addClass
(
'show'
)
}
// 判断是从商户过来还是员工
// 判断是从商户过来还是员工
if
(
qs
(
'channel'
))
{
if
(
qs
(
'channel'
))
{
getList
(
qs
(
'merchantId'
))
getList
(
qs
(
'merchantId'
))
...
@@ -275,6 +283,20 @@
...
@@ -275,6 +283,20 @@
pwd
.
val
(
''
)
pwd
.
val
(
''
)
})
})
// 刷新
$
(
'#refresh'
).
on
(
'click'
,
function
()
{
if
(
!
merchantId
)
{
layer
.
msg
(
'请选择所属商户!'
)
}
else
{
findRoleList
(
merchantId
)
}
})
// 创建角色
$
(
'#addRole'
).
on
(
'click'
,
function
()
{
go
(
'role'
,
'add'
,
null
,
true
)
})
// 提交表单
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
...
@@ -389,6 +411,7 @@
...
@@ -389,6 +411,7 @@
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
var
list
=
res
.
data
var
list
=
res
.
data
roleAuth
.
empty
()
list
.
unshift
(
''
)
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
$
.
each
(
list
,
function
(
index
,
item
)
{
roleAuth
.
append
(
new
Option
(
item
.
roleName
,
item
.
id
))
roleAuth
.
append
(
new
Option
(
item
.
roleName
,
item
.
id
))
...
...
html/employee/index.html
View file @
8fde78b
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
.selector
{
.selector
{
width
:
110px
;
width
:
110px
;
}
}
.layui-layer-content
{
white-space
:
pre-line
;
}
</style>
</style>
<body>
<body>
...
@@ -102,26 +105,52 @@
...
@@ -102,26 +105,52 @@
// 商户名称列表
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
merchantName
=
$
(
"#merchantName"
)
var
status
=
$
(
'#status'
)
var
status
=
$
(
'#status'
)
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
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'
},
{
field
:
'createdAccount'
,
title
:
'创建者'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'商户名(商户号)'
,
align
:
'center'
,
width
:
160
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
220
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
var
colums
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
120
,
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
:
'entmicroName'
,
title
:
'所属门店'
,
align
:
'center'
,
width
:
125
},
{
field
:
'entmicroName'
,
title
:
'所属企微'
,
align
:
'center'
,
width
:
125
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
220
,
align
:
'left'
,
toolbar
:
'#employeeBar'
},
{
field
:
'statusName'
,
title
:
'启用开关'
,
width
:
85
,
templet
:
'#switchTpl'
,
unresize
:
true
}
]
var
gl
=
false
//创建table实例
//创建table实例
var
employeeTable
=
table
.
render
({
var
employeeTable
=
table
.
render
({
elem
:
'#employeeTable'
,
elem
:
'#employeeTable'
,
skin
:
'nob'
,
skin
:
'nob'
,
cols
:
[
cols
:
gl
?
[
cols
]
:
[
colums
],
[
done
:
function
(
res
,
curr
,
count
)
{
//表头
$
(
'.switch'
).
hover
(
function
()
{
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
// 鼠标移入
{
field
:
'staffName'
,
title
:
'员工姓名'
,
width
:
120
,
align
:
'center'
},
layer
.
tips
(
'启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:\n\
{
field
:
'staffCode'
,
title
:
'员工号'
,
align
:
'center'
},
1. 角色管理-创建角色;\n\
{
field
:
'roleName'
,
title
:
'角色'
,
align
:
'center'
},
2. 选择员工账户-修改角色'
,
this
,
{
tips
:
[
4
,
'#666'
]});
{
field
:
'staffPhone'
,
title
:
'登录手机号'
,
align
:
'center'
,
width
:
125
},
},
function
()
{
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
// 鼠标移出
{
field
:
'createdAccount'
,
title
:
'创建者'
,
align
:
'center'
},
})
{
field
:
'merchantName'
,
title
:
'商户名(商户号)'
,
align
:
'center'
,
width
:
160
},
}
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
220
,
align
:
'left'
,
toolbar
:
'#employeeBar'
}
]
]
})
})
// 分页配置
// 分页配置
...
@@ -143,6 +172,7 @@
...
@@ -143,6 +172,7 @@
//首次不执行
//首次不执行
if
(
!
first
)
{
if
(
!
first
)
{
getTabelList
(
employeeTable
,
getSearch
())
getTabelList
(
employeeTable
,
getSearch
())
// 移入移出
}
}
}
}
}
}
...
@@ -203,6 +233,17 @@
...
@@ -203,6 +233,17 @@
})
})
}
}
})
})
//监听性别操作
form
.
on
(
'switch(sexDemo)'
,
function
(
obj
){
if
(
this
.
value
==
'-'
)
{
obj
.
elem
.
checked
=
false
form
.
render
(
'checkbox'
)
layer
.
msg
(
'您还未给该员工设置“角色”!\n\
设置角色:员工账户管理-修改-角色权限'
,
{
time
:
2000
})
}
})
/** 手动触发事件 */
/** 手动触发事件 */
// 查询事件
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
...
@@ -213,12 +254,6 @@
...
@@ -213,12 +254,6 @@
// 新增点击事件
// 新增点击事件
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
go
(
'employee'
,
'add'
)
go
(
'employee'
,
'add'
)
// var value = merchantName.val()
// if (value) {
// go('employee', 'add', { merchantId: value })
// } else {
// layer.msg('请选择商户')
// }
})
})
// 导出
// 导出
...
@@ -232,6 +267,7 @@
...
@@ -232,6 +267,7 @@
})
})
})
})
/** 定义方法 */
/** 定义方法 */
// 初始化方法
// 初始化方法
function
init
()
{
function
init
()
{
...
@@ -317,15 +353,22 @@
...
@@ -317,15 +353,22 @@
})
})
</script>
</script>
<script
type=
"text/html"
id=
"employeeBar"
>
<script
type=
"text/html"
id=
"employeeBar"
>
<
div
>
<
div
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"detail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"detail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
<
/div
>
<
/div
>
<
div
>
<
div
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"updateTime"
>
修改账户有效期
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"updateTime"
>
修改账户有效期
<
/a
>
<
/div
>
<
/div
>
</script>
</script>
<script
type=
"text/html"
id=
"switchTpl"
>
<!--
这里的
checked
的状态只是演示
-->
<
div
class
=
"switch"
>
<
input
type
=
"checkbox"
name
=
"sex"
value
=
"{{d.roleName}}"
lay
-
skin
=
"switch"
lay
-
text
=
"开|关"
lay
-
filter
=
"sexDemo"
{{
d
.
statusName
==
'1'
?
'checked'
:
''
}}
>
<
/div
>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
\ No newline at end of file
html/merchant/add.html
0 → 100644
View file @
8fde78b
This diff is collapsed.
Click to expand it.
html/merchant/index.html
View file @
8fde78b
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<form
class=
"layui-form layui-form-pane"
lay-filter=
"searchFilter"
id=
"searchForm"
>
<form
class=
"layui-form layui-form-pane"
lay-filter=
"searchFilter"
id=
"searchForm"
>
<div
class=
"layui-inline"
id=
"operateEl"
>
<div
class=
"layui-inline"
id=
"operateEl"
>
<button
class=
"layui-btn"
id=
"addBtn"
>
<button
class=
"layui-btn"
id=
"addBtn"
>
<i
class=
"layui-icon layui-icon-add-circle"
></i>
创建商户
</button>
<i
class=
"layui-icon layui-icon-add-circle"
></i>
创建商户
</button>
<div
class=
"layui-inline channel"
pane
>
<div
class=
"layui-inline channel"
pane
>
<label
class=
"layui-form-label"
>
渠道:
</label>
<label
class=
"layui-form-label"
>
渠道:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
...
@@ -129,17 +129,18 @@
...
@@ -129,17 +129,18 @@
<
div
>
<
div
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleDetail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleDetail"
>
查看
<
/a
>
{{
#
if
((
d
.
btn
.
edit
)){
}}
{{
#
if
((
d
.
btn
.
edit
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleEdit"
>
修改基本信息
<
/a
>
<!--
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleEdit"
>
修改基本信息
<
/a> --
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleEdit"
>
修改
<
/a
>
{{
#
}
}}
{{
#
}
}}
<
/div
>
<
/div
>
<
div
>
<
!--
<
div
>
{{
#
if
((
d
.
btn
.
edit
)){
}}
{{
#
if
((
d
.
btn
.
edit
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAuthority"
>
修改权限
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAuthority"
>
修改权限
<
/a
>
{{
#
}
}}
{{
#
}
}}
{{
#
if
((
d
.
btn
.
editPeriod
)){
}}
{{
#
if
((
d
.
btn
.
editPeriod
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleVaildPeriod"
>
修改账户有效期
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleVaildPeriod"
>
修改账户有效期
<
/a
>
{{
#
}
}}
{{
#
}
}}
<
/div
>
<
/div>
--
>
<
div
>
<
div
>
{{
#
if
((
d
.
btn
.
createStaff
)){
}}
{{
#
if
((
d
.
btn
.
createStaff
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddStaff"
>
创建员工
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddStaff"
>
创建员工
<
/a
>
...
@@ -149,6 +150,10 @@
...
@@ -149,6 +150,10 @@
{{
#
}
}}
{{
#
}
}}
<
/div
>
<
/div
>
</script>
</script>
<script
type=
"text/html"
id=
"vaildPeriod"
>
{{
#
if
((
d
.
btn
.
editPeriod
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleVaildPeriod"
>
修改账户有效期
<
/a
>
{{
#
}
}}
</script>
<script>
<script>
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'laypage'
,
'layer'
],
function
()
{
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'laypage'
,
'layer'
],
function
()
{
var
tree
=
layui
.
gtree
var
tree
=
layui
.
gtree
...
@@ -189,75 +194,143 @@
...
@@ -189,75 +194,143 @@
}
}
}
}
}
}
var
cols
=
[{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'merchantNo'
,
title
:
'商户号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'商户名称'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'模式'
,
align
:
'center'
},
{
field
:
'accountTypeNames'
,
title
:
'账户类型'
,
align
:
'left'
,
width
:
100
,
templet
:
'#accountTypeTpl'
},
{
field
:
'merchantLoginAccount'
,
title
:
'登录账户'
,
align
:
'center'
,
width
:
108
},
{
field
:
'accountLevelName'
,
title
:
'账户等级'
,
align
:
'center'
},
{
field
:
'parentMerchant'
,
title
:
'上级商户'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'账户状态'
,
align
:
'center'
},
{
field
:
'merchantLegalPerson'
,
title
:
'联系人'
,
align
:
'center'
},
{
field
:
'merchantLegalPersonPhone'
,
title
:
'手机号'
,
align
:
'center'
,
width
:
120
},
{
field
:
'merchantLegalPersonPhone'
,
title
:
'关联的企业微信'
,
align
:
'center'
,
width
:
120
// }, {
// field: 'merchantAddress',
// title: '商户地址',
// align: 'center',
// width: 160
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
align
:
'left'
,
title
:
'操作'
,
toolbar
:
'#merchantBtns'
,
width
:
220
// fixed: 'right'
}]
var
colums
=
[{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'merchantName'
,
title
:
'商户名称'
,
align
:
'center'
},
{
field
:
'accountTypeNames'
,
title
:
'账户类型'
,
align
:
'left'
,
width
:
100
,
templet
:
'#accountTypeTpl'
},
{
field
:
'merchantLoginAccount'
,
title
:
'登录账户'
,
align
:
'center'
,
width
:
108
},
{
field
:
'accountLevelName'
,
title
:
'账户等级'
,
align
:
'center'
},
{
field
:
'parentMerchant'
,
title
:
'上级商户'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'账户状态'
,
align
:
'center'
},
{
field
:
'merchantLegalPerson'
,
title
:
'联系人'
,
align
:
'center'
},
{
field
:
'merchantLegalPersonPhone'
,
title
:
'手机号'
,
align
:
'center'
,
width
:
120
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
align
:
'left'
,
title
:
'操作'
,
toolbar
:
'#merchantBtns'
,
width
:
220
// fixed: 'right'
},
{
align
:
'left'
,
title
:
'账户开关'
,
toolbar
:
'#vaildPeriod'
,
width
:
150
// fixed: 'right'
}]
var
gl
=
false
var
merchantTable
=
table
.
render
({
var
merchantTable
=
table
.
render
({
elem
:
'#merchantTable'
,
elem
:
'#merchantTable'
,
page
:
false
,
page
:
false
,
skin
:
'nob'
,
skin
:
'nob'
,
cols
:
[
cols
:
gl
?
[
cols
]
:
[
colums
]
[{
field
:
'index'
,
title
:
'序号'
,
align
:
'center'
,
width
:
60
},
{
field
:
'merchantNo'
,
title
:
'商户号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'商户名称'
,
align
:
'center'
},
{
field
:
'accountTypeNames'
,
title
:
'账户类型'
,
align
:
'left'
,
width
:
100
,
templet
:
'#accountTypeTpl'
},
{
field
:
'merchantLoginAccount'
,
title
:
'登录账户'
,
align
:
'center'
,
width
:
108
},
{
field
:
'accountLevelName'
,
title
:
'账户等级'
,
align
:
'center'
},
{
field
:
'parentMerchant'
,
title
:
'上级商户'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'账户状态'
,
align
:
'center'
},
{
field
:
'merchantLegalPerson'
,
title
:
'联系人'
,
align
:
'center'
},
{
field
:
'merchantLegalPersonPhone'
,
title
:
'手机号'
,
align
:
'center'
,
width
:
120
},
{
field
:
'merchantAddress'
,
title
:
'商户地址'
,
align
:
'center'
,
width
:
160
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
align
:
'left'
,
title
:
'操作'
,
toolbar
:
'#merchantBtns'
,
width
:
220
// fixed: 'right'
}]
]
})
})
table
.
on
(
'tool(merchant-table-filter)'
,
function
(
obj
)
{
table
.
on
(
'tool(merchant-table-filter)'
,
function
(
obj
)
{
...
@@ -300,7 +373,7 @@
...
@@ -300,7 +373,7 @@
// 创建子商户/门店
// 创建子商户/门店
case
'handleAddMerchant'
:
case
'handleAddMerchant'
:
// 1-创建新商户;2-创建子商户;3-修改
// 1-创建新商户;2-创建子商户;3-修改
go
(
'merchant'
,
'
edit
'
,
{
go
(
'merchant'
,
'
add
'
,
{
editLevel
:
2
,
editLevel
:
2
,
parentId
:
row
.
id
,
parentId
:
row
.
id
,
isFactory
:
'false'
,
isFactory
:
'false'
,
...
@@ -351,7 +424,7 @@
...
@@ -351,7 +424,7 @@
$
(
'#addBtn'
).
on
(
'click'
,
function
()
{
$
(
'#addBtn'
).
on
(
'click'
,
function
()
{
// 1-创建新商户;2-创建子商户;3-修改
// 1-创建新商户;2-创建子商户;3-修改
go
(
'merchant'
,
'
edit
'
,
{
go
(
'merchant'
,
'
add
'
,
{
editLevel
:
1
,
editLevel
:
1
,
step
:
1
,
step
:
1
,
isFactory
:
'true'
isFactory
:
'true'
...
@@ -516,7 +589,7 @@
...
@@ -516,7 +589,7 @@
// 功能点按需出现
// 功能点按需出现
function
elRemove
()
{
function
elRemove
()
{
$
(
'#operateEl'
).
remove
()
//
$('#operateEl').remove()
}
}
function
init
()
{
function
init
()
{
...
...
html/role/index.html
View file @
8fde78b
...
@@ -35,11 +35,22 @@
...
@@ -35,11 +35,22 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-block"
>
<select
name=
"status"
id=
"status"
lay-verify=
"required"
>
<option
value=
""
>
全部
</option>
<option
value=
"0"
>
草稿
</option>
<option
value=
"1"
>
启用
</option>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
角色名称
</label>
<label
class=
"layui-form-label"
>
角色名称
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"roleName"
placeholder=
"请输入角色名称"
autocomplete=
"off"
class=
"layui-input"
/>
<input
type=
"text"
name=
"roleName"
placeholder=
"请输入角色名称"
autocomplete=
"off"
class=
"layui-input"
/>
</div>
</div>
</div>
</div>
<div
class=
"layui-inline searchBtn"
pane
>
<div
class=
"layui-inline searchBtn"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"roleSearch"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"roleSearch"
>
查询
</button>
</div>
</div>
...
@@ -65,22 +76,31 @@
...
@@ -65,22 +76,31 @@
var
$
=
layui
.
$
var
$
=
layui
.
$
// 商户名称列表
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
merchantName
=
$
(
"#merchantName"
)
var
cols
=
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'所属商户名'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
var
colums
=
[
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
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'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
var
gl
=
false
//创建table实例
//创建table实例
var
roleTable
=
table
.
render
({
var
roleTable
=
table
.
render
({
elem
:
'#roleTable'
,
elem
:
'#roleTable'
,
skin
:
'nob'
,
skin
:
'nob'
,
cols
:
[
cols
:
gl
?
[
cols
]
:
[
colums
]
[
//表头
{
field
:
''
,
title
:
'序号'
,
type
:
'numbers'
,
width
:
80
},
{
field
:
'roleName'
,
title
:
'角色名称'
,
align
:
'center'
},
{
field
:
'roleCode'
,
title
:
'角色号'
,
align
:
'center'
},
{
field
:
'merchantName'
,
title
:
'所属商户名'
,
align
:
'center'
},
{
field
:
'statusName'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'updatedTime'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
112
},
{
fixed
:
'right'
,
title
:
'操作'
,
width
:
160
,
align
:
'center'
,
toolbar
:
'#roleBar'
}
]
]
})
})
// 分页配置
// 分页配置
...
@@ -179,13 +199,6 @@
...
@@ -179,13 +199,6 @@
// 新增点击事件
// 新增点击事件
$
(
'#addRole'
).
on
(
'click'
,
function
()
{
$
(
'#addRole'
).
on
(
'click'
,
function
()
{
go
(
'role'
,
'add'
)
go
(
'role'
,
'add'
)
// var value = merchantName.val()
// var params = { merchantId: value }
// if (value) {
// go('role', 'add', params)
// } else {
// layer.msg('请选择商户')
// }
})
})
// 查询事件
// 查询事件
$
(
'#roleSearch'
).
on
(
'click'
,
function
()
{
$
(
'#roleSearch'
).
on
(
'click'
,
function
()
{
...
...
js/load.js
View file @
8fde78b
...
@@ -15,10 +15,15 @@
...
@@ -15,10 +15,15 @@
/**
/**
* 跳转方法 TODO
* 跳转方法 TODO
*/
*/
function
go
(
module
,
page
,
params
)
{
function
go
(
module
,
page
,
params
,
blank
)
{
var
_p
=
(
!
params
||
layui
.
$
.
isEmptyObject
(
params
))
?
''
:
genurl
(
params
)
var
_p
=
(
!
params
||
layui
.
$
.
isEmptyObject
(
params
))
?
''
:
genurl
(
params
)
var
href
=
'/html/'
+
module
+
'/'
+
page
+
'.html'
var
href
=
'/html/'
+
module
+
'/'
+
page
+
'.html'
window
.
location
.
href
=
_p
?
href
+
'?'
+
_p
:
href
if
(
blank
)
{
window
.
open
(
href
,
'_blank'
)
}
else
{
window
.
location
.
href
=
_p
?
href
+
'?'
+
_p
:
href
}
}
}
function
loadLayConfig
()
{
function
loadLayConfig
()
{
...
...
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