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 f2f0598b
authored
Oct 27, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加角色员工 所属商户搜索功能
1 parent
b07f6443
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
36 deletions
html/employee/add.html
html/role/add.html
html/role/index.html
html/employee/add.html
View file @
f2f0598
...
@@ -111,6 +111,10 @@
...
@@ -111,6 +111,10 @@
margin
:
8px
20px
0
;
margin
:
8px
20px
0
;
/* height: 100%; */
/* height: 100%; */
}
}
.xm-select-demo
,
xm-select
>
.xm-body
.scroll-body
{
width
:
360px
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
@@ -129,9 +133,10 @@
...
@@ -129,9 +133,10 @@
<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"
id=
"merchantBox"
>
<div
class=
"layui-input-block"
id=
"merchantBox"
>
<div
id=
"merchantSelect"
class=
"hide"
>
<!-- <div id="merchantSelect" class="hide"> -->
<select
id=
"merchantName"
name=
"merchantId"
lay-filter=
"merchants"
lay-verify=
"required"
autocomplete=
"off"
placeholder=
"请选择商户名称"
required
></select>
<!-- <select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select> -->
</div>
<div
id=
"merchantNameSelect"
class=
"xm-select-demo"
></div>
<!-- </div> -->
<div
class=
"hide"
id=
"merchantIdText"
style=
"line-height: 36px"
></div>
<div
class=
"hide"
id=
"merchantIdText"
style=
"line-height: 36px"
></div>
</div>
</div>
</div>
</div>
...
@@ -217,7 +222,7 @@
...
@@ -217,7 +222,7 @@
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
//Demo
//Demo
layui
.
use
([
'form'
,
'upload'
,
'gtree'
,
'request'
,
'helper'
],
function
()
{
layui
.
use
([
'form'
,
'upload'
,
'gtree'
,
'request'
,
'helper'
,
'xmSelect'
],
function
()
{
// var merchantId = qs('merchantId')
// var merchantId = qs('merchantId')
var
id
=
qs
(
'id'
)
var
id
=
qs
(
'id'
)
var
form
=
layui
.
form
var
form
=
layui
.
form
...
@@ -226,6 +231,7 @@
...
@@ -226,6 +231,7 @@
var
request
=
layui
.
request
var
request
=
layui
.
request
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
$
=
layui
.
$
var
$
=
layui
.
$
var
xmSelect
=
layui
.
xmSelect
var
merchantFileRequest
=
{}
var
merchantFileRequest
=
{}
var
all_nodes
=
[]
var
all_nodes
=
[]
var
employeeForm
=
{}
var
employeeForm
=
{}
...
@@ -241,6 +247,22 @@
...
@@ -241,6 +247,22 @@
// merchantAccountLevel: 1,
// merchantAccountLevel: 1,
// merchantId: 81
// merchantId: 81
// }
// }
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
filterable
:
true
,
radio
:
true
,
data
:
[],
on
:
function
(
data
)
{
console
.
log
(
data
)
merchantId
=
data
.
change
[
0
].
id
getList
(
merchantId
)
}
})
if
(
accountInfo
&&
!
id
)
{
if
(
accountInfo
&&
!
id
)
{
$
(
'#btnGroup'
).
addClass
(
'show'
)
$
(
'#btnGroup'
).
addClass
(
'show'
)
}
}
...
@@ -251,10 +273,11 @@
...
@@ -251,10 +273,11 @@
$
(
'#merchantIdText'
).
text
(
qs
(
'merchantName'
))
$
(
'#merchantIdText'
).
text
(
qs
(
'merchantName'
))
$
(
'#merchantIdText'
).
removeClass
(
'hide'
)
$
(
'#merchantIdText'
).
removeClass
(
'hide'
)
$
(
'#merchantIdText'
).
addClass
(
'show'
)
$
(
'#merchantIdText'
).
addClass
(
'show'
)
$
(
'#merchantNameSelect'
).
addClass
(
'hide'
)
}
else
{
}
else
{
var
str
=
//
var str =
'<div id="merchantSelect" class="hide"><select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select></div>'
//
'<div id="merchantSelect" class="hide"><select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select></div>'
$
(
'#merchantBox'
).
append
(
str
)
//
$('#merchantBox').append(str)
if
(
qs
(
'id'
))
{
if
(
qs
(
'id'
))
{
// 判断是否是编辑
// 判断是否是编辑
resetpsw
.
removeClass
(
'hide'
)
resetpsw
.
removeClass
(
'hide'
)
...
@@ -263,14 +286,10 @@
...
@@ -263,14 +286,10 @@
getList
(
qs
(
'merchantId'
))
getList
(
qs
(
'merchantId'
))
$
(
'#addUpdateTitle'
).
text
(
'修改员工'
)
$
(
'#addUpdateTitle'
).
text
(
'修改员工'
)
}
}
findAllMerchant
(
function
(
result
)
{
findAllMerchant
(
function
(
result
)
{})
if
(
result
)
{
$
(
'#merchantSelect'
).
removeClass
(
'hide'
)
$
(
'#merchantSelect'
).
addClass
(
'show'
)
}
})
}
}
/** 手动触发事件 */
/** 手动触发事件 */
// 上传图片
// 上传图片
$
(
'.upload'
).
on
(
'change'
,
function
(
e
)
{
$
(
'.upload'
).
on
(
'change'
,
function
(
e
)
{
...
@@ -335,6 +354,7 @@
...
@@ -335,6 +354,7 @@
// 提交表单
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
console
.
log
(
data
)
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
layer
.
msg
(
'可见商户必选'
,
{
layer
.
msg
(
'可见商户必选'
,
{
icon
:
2
icon
:
2
...
@@ -362,6 +382,7 @@
...
@@ -362,6 +382,7 @@
}
}
var
params
=
helper
.
clone
(
true
,
data
.
field
,
otherParams
)
var
params
=
helper
.
clone
(
true
,
data
.
field
,
otherParams
)
delete
params
.
merhcnatImg
delete
params
.
merhcnatImg
console
.
log
(
params
)
request
(
params
,
function
(
result
)
{
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
if
(
result
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
layer
.
msg
(
'操作成功'
,
{
...
@@ -434,13 +455,19 @@
...
@@ -434,13 +455,19 @@
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
console
.
log
(
result
.
data
)
var
list
=
result
.
data
merchantNameSelect
.
update
({
list
.
unshift
(
''
)
data
:
result
.
data
,
$
.
each
(
list
,
function
(
index
,
item
)
{
autoRow
:
true
,
merchantName
.
append
(
new
Option
(
item
.
merchantName
,
item
.
id
))
paging
:
result
.
data
.
length
>
20
})
})
form
.
render
(
'select'
)
merchantNameSelect
.
setValue
([
merchantId
])
// var list = result.data
// list.unshift('')
// $.each(list, function (index, item) {
// merchantName.append(new Option(item.merchantName, item.id))
// })
// form.render('select')
callback
(
true
)
callback
(
true
)
}
}
})
})
...
...
html/role/add.html
View file @
f2f0598
...
@@ -107,6 +107,10 @@
...
@@ -107,6 +107,10 @@
.layui-no-data
.no-data
div
{
.layui-no-data
.no-data
div
{
margin-top
:
12px
;
margin-top
:
12px
;
}
}
.xm-select-demo
,
xm-select
>
.xm-body
.scroll-body
{
width
:
360px
;
}
</style>
</style>
</head>
</head>
...
@@ -129,6 +133,7 @@
...
@@ -129,6 +133,7 @@
<!-- <div id="merchantSelect" class="hide">
<!-- <div id="merchantSelect" class="hide">
<select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select>
<select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select>
</div> -->
</div> -->
<div
id=
"merchantNameSelect"
class=
"xm-select-demo"
></div>
<div
class=
"hide"
id=
"merchantIdText"
style=
"line-height: 36px"
></div>
<div
class=
"hide"
id=
"merchantIdText"
style=
"line-height: 36px"
></div>
</div>
</div>
</div>
</div>
...
@@ -173,15 +178,32 @@
...
@@ -173,15 +178,32 @@
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
layui
.
use
([
'form'
,
'element'
,
'request'
,
'laytpl'
,
'xmSelect'
,
'gtree'
,
'helper'
],
function
()
{
layui
.
use
([
'form'
,
'element'
,
'request'
,
'laytpl'
,
'xmSelect'
,
'gtree'
,
'helper'
,
'xmSelect'
],
function
()
{
// var merchantId = qs('merchantId')
// var merchantId = qs('merchantId')
var
roleid
=
qs
(
'id'
)
var
roleid
=
qs
(
'id'
)
var
element
=
layui
.
element
var
element
=
layui
.
element
var
form
=
layui
.
form
var
form
=
layui
.
form
var
arr_box
=
[]
var
arr_box
=
[]
var
$
=
layui
.
$
var
$
=
layui
.
$
var
xmSelect
=
layui
.
xmSelect
var
request
=
layui
.
request
var
request
=
layui
.
request
var
merchantId
=
''
var
merchantId
=
''
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
filterable
:
true
,
radio
:
true
,
data
:
[],
on
:
function
(
data
)
{
console
.
log
(
data
)
merchantId
=
data
.
change
[
0
].
id
findMenuFunTreeByMerId
(
merchantId
)
}
})
if
(
roleid
)
{
if
(
roleid
)
{
$
(
'#roleTitle'
).
append
(
'修改角色'
)
$
(
'#roleTitle'
).
append
(
'修改角色'
)
getById
(
roleid
)
getById
(
roleid
)
...
@@ -192,9 +214,9 @@
...
@@ -192,9 +214,9 @@
$
(
'#roleTitle'
).
append
(
'新增角色'
)
$
(
'#roleTitle'
).
append
(
'新增角色'
)
$
(
'#draft'
).
removeClass
(
'hide'
)
$
(
'#draft'
).
removeClass
(
'hide'
)
$
(
'#draft'
).
addClass
(
'show'
)
$
(
'#draft'
).
addClass
(
'show'
)
var
str
=
//
var str =
'<div id="merchantSelect" class="hide"><select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select></div>'
//
'<div id="merchantSelect" class="hide"><select id="merchantName" name="merchantId" lay-filter="merchants" lay-verify="required" autocomplete="off" placeholder="请选择商户名称" required></select></div>'
$
(
'#merchantBox'
).
append
(
str
)
//
$('#merchantBox').append(str)
findAllMerchant
()
findAllMerchant
()
$
(
'#merchantSelect'
).
removeClass
(
'hide'
)
$
(
'#merchantSelect'
).
removeClass
(
'hide'
)
$
(
'#merchantSelect'
).
addClass
(
'show'
)
$
(
'#merchantSelect'
).
addClass
(
'show'
)
...
@@ -776,12 +798,18 @@
...
@@ -776,12 +798,18 @@
request
(
params
,
function
(
result
)
{
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
console
.
log
(
result
)
var
list
=
result
.
data
merchantNameSelect
.
update
({
list
.
unshift
(
''
)
data
:
result
.
data
,
$
.
each
(
list
,
function
(
index
,
item
)
{
autoRow
:
true
,
merchantName
.
append
(
new
Option
(
item
.
merchantName
,
item
.
id
))
paging
:
result
.
data
.
length
>
20
})
})
form
.
render
(
'select'
)
merchantNameSelect
.
setValue
([
merchantId
])
// var list = result.data
// list.unshift('')
// $.each(list, function(index, item) {
// merchantName.append(new Option(item.merchantName, item.id))
// })
// form.render('select')
}
}
})
})
}
}
...
...
html/role/index.html
View file @
f2f0598
...
@@ -11,6 +11,14 @@
...
@@ -11,6 +11,14 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/commonResetIndex.css"
/>
<title>
角色管理
</title>
<title>
角色管理
</title>
</head>
</head>
<style>
xm-select
>
.xm-body
.scroll-body
{
width
:
300px
;
}
xm-select
:hover
{
border
:
1px
solid
#5850ff
!important
;
}
</style>
<body>
<body>
<div
id=
"app"
>
<div
id=
"app"
>
<main
class=
"bg-white"
>
<main
class=
"bg-white"
>
...
@@ -29,7 +37,8 @@
...
@@ -29,7 +37,8 @@
<div
class=
"layui-inline companyName"
pane
>
<div
class=
"layui-inline companyName"
pane
>
<label
class=
"layui-form-label"
>
商户名称
</label>
<label
class=
"layui-form-label"
>
商户名称
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<select
name=
"merchantId"
id=
"merchantName"
lay-verify=
"required"
></select>
<!-- <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>
</div>
...
@@ -71,12 +80,13 @@
...
@@ -71,12 +80,13 @@
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
,
'laypage'
],
function
()
{
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
,
'laypage'
,
'xmSelect'
],
function
()
{
var
request
=
layui
.
request
var
request
=
layui
.
request
var
table
=
layui
.
table
var
table
=
layui
.
table
var
form
=
layui
.
form
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
laypage
=
layui
.
laypage
var
xmSelect
=
layui
.
xmSelect
var
$
=
layui
.
$
var
$
=
layui
.
$
// 商户名称列表
// 商户名称列表
var
merchantName
=
$
(
'#merchantName'
)
var
merchantName
=
$
(
'#merchantName'
)
...
@@ -131,6 +141,19 @@
...
@@ -131,6 +141,19 @@
}
}
}
}
}
}
var
merchantNameSelect
=
xmSelect
.
render
({
el
:
'#merchantNameSelect'
,
prop
:
{
name
:
'merchantName'
,
value
:
'id'
},
name
:
'merchantId'
,
filterable
:
true
,
radio
:
true
,
data
:
[]
})
init
()
init
()
function
init
()
{
function
init
()
{
findAllMerchant
()
findAllMerchant
()
...
@@ -168,12 +191,17 @@
...
@@ -168,12 +191,17 @@
request
(
params
,
function
(
result
)
{
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
console
.
log
(
result
)
var
list
=
result
.
data
merchantNameSelect
.
update
({
list
.
unshift
(
''
)
data
:
result
.
data
,
$
.
each
(
list
,
function
(
index
,
item
)
{
autoRow
:
true
,
merchantName
.
append
(
new
Option
(
item
.
merchantName
,
item
.
id
))
paging
:
result
.
data
.
length
>
20
})
})
form
.
render
(
'select'
)
// var list = result.data
// list.unshift('')
// $.each(list, function (index, item) {
// merchantName.append(new Option(item.merchantName, item.id))
// })
// form.render('select')
}
}
})
})
}
}
...
...
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