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 b3900535
authored
Aug 08, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
tijao
1 parent
c1abb457
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
62 deletions
html/employee/add.html
html/employee/index.html
html/role/add.html
html/role/detail.html
html/role/index.html
html/employee/add.html
View file @
b390053
...
...
@@ -139,7 +139,6 @@
//Demo
layui
.
use
([
'form'
,
'upload'
,
'gtree'
,
'request'
,
'helper'
],
function
()
{
console
.
log
(
qs
(
'merchantId'
))
var
merchantId
=
qs
(
'merchantId'
)
var
id
=
qs
(
'id'
)
var
form
=
layui
.
form
...
...
@@ -215,14 +214,12 @@
}
if
(
data
.
merchantFileResponse
)
{
merchantFileRequest
=
{
fileName
:
data
.
merchantFileResponse
.
fileName
,
fileUrl
:
data
.
merchantFileResponse
.
fileUrl
}
$
(
'#img'
).
attr
(
'src'
,
merchantFileRequest
.
fileUrl
)
$
(
'#img'
).
removeClass
(
'hide'
)
$
(
'#img'
).
addClass
(
'show'
)
$
(
'.img-add'
).
removeClass
(
'show'
)
$
(
'.img-add'
).
addClass
(
'hide'
)
}
var
imgEl
=
$
(
'#img'
)
var
addEl
=
$
(
'.img-add'
)
imgEl
.
attr
(
'src'
,
merchantFileRequest
.
fileUrl
)
imgEl
.
removeClass
(
'hide'
)
imgEl
.
addClass
(
'show'
)
addEl
.
removeClass
(
'show'
)
addEl
.
addClass
(
'hide'
)
var
visibleInferiorMerArr
=
data
.
visibleInferiorMer
.
split
(
','
)
$
.
each
(
visibleInferiorMerArr
,
function
(
index
,
item
)
{
visibleInferiorMerArr
[
index
]
=
+
item
...
...
@@ -230,7 +227,7 @@
// var visibleInferiorMerArr = [32, 38]
callback
(
visibleInferiorMerArr
)
}
console
.
log
(
employeeForm
)
console
.
log
(
employeeForm
,
merchantFileRequest
)
form
.
val
(
'employeeForm'
,
employeeForm
)
})
}
...
...
@@ -270,6 +267,7 @@
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
console
.
log
(
id
,
'llll'
)
var
visibleInferiorMer
=
visibleMerchant
.
getCheckedNodes
(
true
).
map
(
function
(
i
)
{
return
i
.
id
}).
join
(
','
)
...
...
@@ -280,14 +278,17 @@
}
if
(
merchantFileRequest
.
fileName
)
{
otherParams
.
merchantFileRequest
=
JSON
.
stringify
(
merchantFileRequest
)
}
else
}
if
(
id
)
{
console
.
log
(
id
)
otherParams
.
id
=
id
otherParams
.
method
=
'cn.com.glsx.merchants.staff.updateStaff'
}
else
{
otherParams
.
method
=
'cn.com.glsx.merchants.staff.saveStaff'
}
var
params
=
helper
.
clone
(
true
,
data
.
field
,
otherParams
)
delete
params
.
merhcnatImg
console
.
log
(
params
)
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
window
.
history
.
back
()
...
...
html/employee/index.html
View file @
b390053
...
...
@@ -38,11 +38,11 @@
<div
class=
"layui-inline"
pane
>
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-block"
>
<select
name=
"status"
lay-verify=
"required"
>
<option
value=
""
>
全部
</option>
<select
name=
"status"
id=
"status"
lay-verify=
"required"
>
<
!-- <
option value="">全部</option>
<option value="0">存草稿</option>
<option value="1">启用</option>
<option
value=
"2"
>
已注销
</option>
<option value="2">已注销</option>
-->
</select>
</div>
</div>
...
...
@@ -78,7 +78,9 @@
var
$
=
layui
.
$
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
status
=
$
(
'#status'
)
findAllMerchant
()
findAllDictData
()
//创建table实例
var
employeeTable
=
table
.
render
({
elem
:
'#employeeTable'
,
...
...
@@ -130,21 +132,6 @@
}
)
}
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
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(employeeTool)'
,
function
(
obj
)
{
var
data
=
obj
.
data
...
...
@@ -197,6 +184,11 @@
})
}
})
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
)
})
// 新增点击事件
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
var
value
=
merchantName
.
val
()
...
...
@@ -216,11 +208,22 @@
}
})
})
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
)
})
// 查询所有商户
function
findAllMerchant
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.menu.findAllMerchant'
}
request
(
params
,
function
(
result
)
{
if
(
result
.
code
==
'0'
)
{
console
.
log
(
result
)
var
list
=
result
.
data
list
.
unshift
(
''
)
$
.
each
(
list
,
function
(
index
,
item
)
{
merchantName
.
append
(
new
Option
(
item
.
merchantName
,
item
.
id
))
})
form
.
render
(
'select'
)
}
})
}
function
getSearch
()
{
var
formVal
=
form
.
val
(
'employeeForm'
)
var
searchData
=
helper
.
clone
(
false
,
formVal
)
...
...
@@ -239,6 +242,22 @@
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"
>
...
...
html/role/add.html
View file @
b390053
...
...
@@ -297,7 +297,7 @@
accountType
.
append
(
str
)
if
(
roleid
)
{
// 角色权限的check
for
(
var
i
=
0
;
i
<
check_arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
check_arr
.
length
;
i
++
)
{
if
(
check_arr
[
i
].
accounttypeId
==
item
.
accounttypeId
)
{
var
productData
=
check_arr
[
i
]
str
.
attr
(
"checked"
,
true
)
...
...
@@ -321,7 +321,6 @@
// 树的回显
}
break
}
if
(
check_arr
.
length
!=
0
)
{
active
.
tabChange
(
'roleAuth'
,
check_arr
[
0
].
accounttypeId
)
...
...
html/role/detail.html
View file @
b390053
...
...
@@ -175,11 +175,6 @@
if
(
res
.
code
==
'0'
)
{
menuFunTreeData
=
res
.
data
console
.
log
(
menuFunTreeData
)
// var select = $('#accountType')
// $.each(menuFunTreeData, function (index, item) {
// select.append(new Option(item.accounttypeName, item.accounttypeId))
// })
// form.render('select')
getById
(
function
(
responseList
)
{
console
.
log
(
'responseList:'
,
responseList
)
if
(
responseList
&&
responseList
.
length
!=
0
)
{
...
...
@@ -203,32 +198,11 @@
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
active
.
tabChange
(
filterName
,
productId
)
}
break
}
// $.each(responseList, function (idx, i) {
// if (item.accounttypeId == i.accounttypeId) {
// console.log(i, item)
// detailTreeData.push(i)
// active.tabAdd({
// title: item.accounttypeName,
// value: item.accounttypeId
// })
// var menuData = []
// for(var j = 0; j < i.productList.length; j++) {
// }
// }
// })
})
active
.
tabChange
(
'roleAuth'
,
responseList
[
0
].
accounttypeId
)
}
})
// $.each(menuFunTreeData[0].products, function(index, i) {
// active.tabAdd({
// title: i.productName,
// value: i.productId
// })
// })
}
})
}
...
...
html/role/index.html
View file @
b390053
...
...
@@ -158,7 +158,7 @@
<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
==
0
){
}}
{{
#
if
(
d
.
delFlag
==
1
){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
{{
#
}
}}
</script>
...
...
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