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 dcdd3318
authored
Aug 19, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改员工
1 parent
123f86f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
37 deletions
html/employee/add.html
html/employee/detail.html
html/employee/index.html
html/employee/add.html
View file @
dcdd331
...
...
@@ -100,8 +100,8 @@
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
所属商户:
</label>
<div
class=
"layui-input-block"
>
<div
id=
"merchant
Box
"
class=
"hide"
>
<div
class=
"layui-input-block"
id=
"merchantBox"
>
<div
id=
"merchant
Select
"
class=
"hide"
>
<select
id=
"merchantName"
name=
"merchantId"
lay-filter=
"merchants"
lay-verify=
"required"
autocomplete=
"off"
placeholder=
"请选择商户名称"
required
></select>
</div>
<div
class=
"hide"
id=
"merchantIdText"
style=
"line-height: 36px;"
></div>
...
...
@@ -215,16 +215,18 @@
}
// 判断是从商户过来还是员工
if
(
qs
(
'channel'
))
{
$
(
'#merchantIdText'
).
text
(
qs
(
'merchantName'
))
getList
(
qs
(
'merchantId'
))
merchantId
=
qs
(
'merchantId'
)
$
(
'#merchantIdText'
).
text
(
qs
(
'merchantName'
))
$
(
'#merchantIdText'
).
removeClass
(
'hide'
)
$
(
'#merchantIdText'
).
addClass
(
'show'
)
}
else
{
$
(
'#merchantBox'
).
removeClass
(
'hide'
)
$
(
'#merchantBox'
).
addClass
(
'show'
)
var
str
=
'<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
)
findAllMerchant
()
$
(
'#merchantSelect'
).
removeClass
(
'hide'
)
$
(
'#merchantSelect'
).
addClass
(
'show'
)
}
init
()
/** 手动触发事件 */
// 上传图片
...
...
@@ -275,6 +277,12 @@
// 提交表单
form
.
on
(
'submit(employeeSubmit)'
,
function
(
data
)
{
if
(
visibleMerchant
.
getCheckedNodes
(
true
).
length
==
0
)
{
layer
.
msg
(
'可见商户必选'
,
{
icon
:
2
})
return
false
}
var
visibleInferiorMer
=
visibleMerchant
.
getCheckedNodes
(
true
)
.
map
(
function
(
i
)
{
...
...
@@ -288,8 +296,10 @@
if
(
merchantFileRequest
.
fileName
)
{
otherParams
.
merchantFileRequest
=
JSON
.
stringify
(
merchantFileRequest
)
}
if
(
qs
(
'channel'
))
{
otherParams
.
merchantId
=
merchantId
}
if
(
id
)
{
console
.
log
(
id
)
otherParams
.
id
=
id
otherParams
.
method
=
'cn.com.glsx.merchants.staff.updateStaff'
}
else
{
...
...
@@ -297,13 +307,12 @@
}
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
()
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
window
.
history
.
back
()
}
})
return
false
...
...
@@ -322,11 +331,6 @@
})
/** 定义方法 */
function
init
()
{
// findRoleList()
findAllMerchant
()
// getVisibleMerchant()
}
function
getList
(
merchantId
)
{
getVisibleMerchant
(
merchantId
)
...
...
@@ -431,6 +435,7 @@
}
console
.
log
(
employeeForm
,
merchantFileRequest
)
form
.
val
(
'employeeForm'
,
employeeForm
)
form
.
render
(
'select'
)
})
}
...
...
html/employee/detail.html
View file @
dcdd331
...
...
@@ -19,22 +19,34 @@
.sub-title
{
margin-top
:
21px
;
}
.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
;
}
</style>
<body>
<div
id=
"app"
>
<main
class=
"bg-white wrapper detail"
>
<div
class=
"sub-bg-white"
>
<div>
<h3
class=
"content-title"
>
<h3
class=
"content-title"
id=
"basic"
>
员工基本信息
<div
class=
"title-right"
id=
"merchantName"
></div>
</h3>
<!-- <div class="layui-form-item">
<label class="layui-form-label required">所属企业:</label>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="merchantName"></div>
</div>
</div> -->
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
姓名:
</label>
<div
class=
"layui-input-block"
>
...
...
@@ -48,6 +60,12 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
职务:
</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 required"
>
角色名称:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleName"
></div>
...
...
@@ -56,26 +74,32 @@
<div
class=
"layui-form-item mb21"
>
<label
class=
"layui-form-label required"
>
角色号:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleIds"
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleCode"
></div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
上级姓名:
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-form-mid layui-word-aux"
id=
"createdAccount"
></div>
</div>
</div>
</div>
<div>
<h3
class=
"content-title sub-title"
>
可见下级商户
</h3>
<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>
<h3
class=
"content-title sub-title"
>
角色
权限
</h3>
<h3
class=
"content-title sub-title"
id=
"accountAuth"
>
账户
权限
</h3>
<div
class=
"layui-tab tabmutiple-content"
style=
"padding: 0 20px;background-color: #fff;"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title"
></ul>
<div
class=
"layui-tab-content"
></div>
</div>
</div>
<div>
<h3
class=
"content-title sub-title"
>
修改日志
</h3>
<h3
class=
"content-title sub-title"
id=
"record"
>
修改日志
</h3>
<div
class=
"layui-tab tabmutiple-content"
style=
"padding: 0 20px;background-color: #fff;"
>
<table
class=
"layui-table"
id=
"recordTable"
></table>
<div
id=
"recordPage"
class=
"align-center"
></div>
...
...
@@ -84,6 +108,11 @@
<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>
...
...
@@ -100,7 +129,7 @@
var
table
=
layui
.
table
var
laypage
=
layui
.
laypage
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'
roleName'
,
'roleIds'
,
'merchantName
'
]
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'
staffJob'
,
'roleName'
,
'roleCode'
,
'merchantName'
,
'createdAccount
'
]
var
employeeData
=
{}
var
visibleInferiorMerName
=
$
(
'#visibleInferiorMerName'
)
...
...
@@ -164,7 +193,23 @@
/** 触发事件 */
$
(
'#return'
).
on
(
'click'
,
function
()
{
window
.
history
.
back
()
if
(
window
.
location
.
hash
)
{
window
.
history
.
back
(
-
1
)
window
.
location
.
hash
=
""
}
window
.
history
.
back
(
-
1
)
})
$
(
'#basicBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#basic'
).
scrollIntoView
(
true
)
})
$
(
'#accountAuthBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#accountAuth'
).
scrollIntoView
(
true
)
})
$
(
'#recordBtn'
).
on
(
'click'
,
function
()
{
document
.
querySelector
(
'#record'
).
scrollIntoView
(
true
)
})
/** 定义方法 */
...
...
@@ -177,12 +222,12 @@
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
employeeData
[
basicArr
[
i
]])
}
var
visibleName
=
employeeData
.
visibleInferiorMerName
.
split
(
','
)
console
.
log
(
visibleName
,
'---
'
)
$
.
each
(
visibleName
,
function
(
idx
,
i
)
{
console
.
log
(
i
)
visibleInferiorMerName
.
append
(
'<li class="visibleMerchant">'
+
i
+
'</li>'
)
}
)
if
(
employeeData
.
visibleInferiorMerName
)
{
var
visibleName
=
employeeData
.
visibleInferiorMerName
.
split
(
',
'
)
$
.
each
(
visibleName
,
function
(
idx
,
i
)
{
visibleInferiorMerName
.
append
(
'<li class="visibleMerchant">'
+
i
+
'</li>'
)
}
)
}
// 账户权限
var
authList
=
employeeData
.
accountTypeTreeResponseList
console
.
log
(
authList
)
...
...
html/employee/index.html
View file @
dcdd331
...
...
@@ -95,10 +95,10 @@
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
$
=
layui
.
$
var
isDxternal
=
isAppend
()
if
(
isDxternal
)
{
$
(
'#addEl'
).
remove
()
}
//
var isDxternal = isAppend()
//
if (isDxternal) {
//
$('#addEl').remove()
//
}
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
status
=
$
(
'#status'
)
...
...
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