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 9107e316
authored
Aug 03, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交员工代码,接口
1 parent
e5aa13b2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
172 additions
and
17 deletions
html/employee/add.html
html/employee/detail.html
html/employee/index.html
html/employee/validPeriod.html
js/gtree.js
html/employee/add.html
View file @
9107e31
This diff is collapsed.
Click to expand it.
html/employee/detail.html
View file @
9107e31
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
employeeData
=
{}
var
employeeData
=
{}
// 查询员工详情
// 查询员工详情
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.
merchant
.staffSearchRequest'
}
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.
staff
.staffSearchRequest'
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
...
@@ -94,13 +94,15 @@
...
@@ -94,13 +94,15 @@
request
(
treeParams
,
function
(
res
)
{
request
(
treeParams
,
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
merchants
=
tree
.
create
(
'tree'
,
res
.
data
)
merchants
=
tree
.
create
(
'tree'
,
res
.
data
,
null
,
false
)
// var id = employeeData.visibleInferiorMer
// var id = employeeData.visibleInferiorMer
var
id
=
32
var
id
=
32
var
node
=
merchants
.
getNodeByParam
(
"id"
,
id
)
var
node
=
merchants
.
getNodeByParam
(
"id"
,
id
)
merchants
.
checkNode
(
node
,
true
,
true
)
merchants
.
checkNode
(
node
,
true
,
true
)
}
}
})
})
// 账户权限
})
})
</script>
</script>
</body>
</body>
...
...
html/employee/index.html
View file @
9107e31
...
@@ -164,33 +164,56 @@
...
@@ -164,33 +164,56 @@
if
(
layEvent
===
'detail'
)
{
if
(
layEvent
===
'detail'
)
{
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
})
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
})
}
else
if
(
layEvent
===
'edit'
)
{
}
else
if
(
layEvent
===
'edit'
)
{
go
(
'employee'
,
'add'
,
{
id
:
1
})
go
(
'employee'
,
'add'
,
{
id
:
data
.
id
})
}
else
if
(
layEvent
===
'del'
)
{
}
else
if
(
layEvent
===
'del'
)
{
layer
.
confirm
(
'真的删除行么'
,
function
(
index
)
{
layer
.
confirm
(
'真的删除行么'
,
function
(
index
)
{
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
// obj.del() //删除对应行(tr)的DOM结构,并更新缓存
layer
.
close
(
index
)
var
params
=
{
console
.
log
(
'shanchu'
)
method
:
'cn.com.glsx.merchants.staff.deleteStaff'
,
getTabelList
(
employeeTable
)
id
:
data
.
id
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
close
(
index
)
console
.
log
(
'shanchu'
)
getTabelList
(
employeeTable
)
}
})
//向服务端发送删除指令
//向服务端发送删除指令
})
})
}
else
if
(
layEvent
===
'updateTime'
)
{
}
else
if
(
layEvent
===
'updateTime'
)
{
layer
.
open
({
layer
.
open
({
title
:
'修改账户有效期'
,
type
:
2
,
type
:
1
,
title
:
'修改账户的有效期'
,
area
:
[
'350px'
,
'250px'
],
area
:
[
'600px'
,
'320px'
],
btn
:
[
'确定修改'
,
'取消'
],
fixed
:
false
,
//不固定
yes
:
function
(
index
,
layero
)
{
// maxmin: true,
console
.
log
(
'queding '
,
layero
)
btn
:
[
'确定'
,
'取消'
],
layer
.
close
(
index
)
content
:
'validPeriod.html?id='
+
data
.
id
,
yes
:
function
(
index
,
layero
)
{
// console.log(layero)
// var res = window["layui-layer-iframe" + index].callbackdata()
// console.log(res)
// 获取iframe层的body
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
body
.
contents
().
find
(
'#isValid'
).
attr
(
'value'
,
'no'
)
body
.
find
(
'#periodVerifyBtn'
).
click
()
if
(
body
.
contents
().
find
(
'#isValid'
).
val
()
==
'yes'
)
{
console
.
log
(
'+++++++++++'
)
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
layer
.
close
(
index
)
}
},
},
content
:
$
(
'#updateTime'
)
cancel
:
function
(
index
,
layero
)
{
// layer.close(index)
}
})
})
}
}
})
})
// 新增点击事件
// 新增点击事件
$
(
document
).
on
(
'click'
,
'#addEmployee'
,
function
()
{
$
(
document
).
on
(
'click'
,
'#addEmployee'
,
function
()
{
layer
.
msg
(
'hello'
)
console
.
log
(
'创建'
)
go
(
'employee'
,
'add'
)
go
(
'employee'
,
'add'
)
})
})
// 查询事件
// 查询事件
...
...
html/employee/validPeriod.html
0 → 100644
View file @
9107e31
<!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=
"validPeriod"
id=
"periodSelect"
required
lay-verify=
"required"
>
<option
value=
""
>
请选择
</option>
</select>
<p>
(注:永久有效不超过所属工厂商户的有效期)
</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>
<input
type=
"text"
id=
"isValid"
name=
"isValid"
value=
"no"
style=
"display: none;"
class=
"layui-input"
>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'request'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
$
=
layui
.
$
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
vaildData
=
{
id
:
getQueryString
(
'id'
)
}
getVaildPeriod
()
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
console
.
log
(
data
.
field
,
vaildData
)
// 调接口
var
params
=
{
method
:
'cn.com.glsx.merchants.staff.updateValPerByStaffId'
,
effectiveTime
:
data
.
field
.
validPeriod
,
id
:
vaildData
.
id
}
updateVal
(
params
,
function
(
e
)
{
console
.
log
(
e
,
'============kkkkk'
)
if
(
e
)
{
$
(
'#isValid'
).
attr
(
'value'
,
'yes'
)
}
})
return
false
})
function
updateVal
(
params
,
callback
)
{
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
callback
(
true
)
}
})
}
// function callbackdata() {
// return vaildData
// }
// 获取参数
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
.
validPeriodList
=
res
.
data
var
periodSelect
=
$
(
'#periodSelect'
)
$
.
each
(
baseData
.
validPeriodList
,
function
(
index
,
item
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
})
form
.
val
(
'periodFilter'
,
{
validPeriod
:
vaildData
.
validPeriod
})
form
.
render
(
'select'
)
}
})
}
})
</script>
</body>
</html>
\ No newline at end of file
\ No newline at end of file
js/gtree.js
View file @
9107e31
...
@@ -21,6 +21,9 @@ layui.define(['ztree'], function (exports) {
...
@@ -21,6 +21,9 @@ layui.define(['ztree'], function (exports) {
$switchs
.
not
(
':eq(0)'
).
addClass
(
'op0'
)
$switchs
.
not
(
':eq(0)'
).
addClass
(
'op0'
)
}
}
}
}
if
(
gtree
.
opt
&&
gtree
.
opt
.
onNodeCreated
)
{
gtree
.
opt
.
onNodeCreated
(
event
,
treeId
,
treeNode
)
}
}
}
var
setting
=
{
var
setting
=
{
view
:
{
view
:
{
...
@@ -42,9 +45,13 @@ layui.define(['ztree'], function (exports) {
...
@@ -42,9 +45,13 @@ layui.define(['ztree'], function (exports) {
}
}
var
inst
=
null
var
inst
=
null
var
gtree
=
{
var
gtree
=
{
create
:
function
(
id
,
nodes
,
opt
)
{
opt
:
null
,
check
:
true
,
create
:
function
(
id
,
nodes
,
opt
,
check
)
{
this
.
opt
=
opt
var
$treeDom
=
$
(
'#'
+
id
)
var
$treeDom
=
$
(
'#'
+
id
)
$treeDom
.
addClass
(
'ztree'
)
$treeDom
.
addClass
(
'ztree'
)
if
(
check
==
0
)
setting
.
check
.
enable
=
false
inst
=
tree
.
init
(
$treeDom
,
setting
,
nodes
)
inst
=
tree
.
init
(
$treeDom
,
setting
,
nodes
)
return
inst
return
inst
}
}
...
...
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