Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ad68dbe3
authored
2018-03-25 23:59:18 +0800
by
yangjianbin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
1e9b3318
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
58 deletions
application/views/perm/staffAdd.php
application/views/perm/staffAdd.php
View file @
ad68dbe
<?php
$this
->
load
->
view
(
'common/header'
);
?>
<body>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<form
action=
"system/user/add"
id=
"add"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<form
action=
"system/user/add"
id=
"add"
>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
用户名
</label>
...
...
@@ -36,77 +36,77 @@
<label>
所属网点
</label>
<select
class=
"select"
name=
"DepartmentVO.children"
size=
"5"
multiple
>
<option
selected
value
>
请选择
</option>
<?php
foreach
(
$this
->
session
->
departments
as
$k
=>
$v
)
:
?>
<
option
value
=
"<?=
$v->id
?>"
><?=
$v
->
name
?>
</option>
<?php
if
(
$v
->
children
&&
!
empty
(
$v
->
children
))
:
?>
<?
php
foreach
(
$v
->
children
as
$kk
=>
$vv
)
:
?>
<
option
value
=
"<?=
$vv->id
?>"
><?=
$vv
->
name
?>
</option>
<?php
endforeach
;
?>
<?php
endif
;
?>
<?php
endforeach
;
?>
<?php
foreach
(
$this
->
session
->
departments
as
$k
=>
$v
)
:
?>
<option
value=
"
<?=
$v
->
id
?>
"
>
<?=
$v
->
name
?>
</option>
<?php
if
(
$v
->
children
&&
!
empty
(
$v
->
children
))
:
?>
<?php
foreach
(
$v
->
children
as
$kk
=>
$vv
)
:
?>
<option
value=
"
<?=
$vv
->
id
?>
"
>
<?=
$vv
->
name
?>
</option>
<?php
endforeach
;
?>
<?php
endif
;
?>
<?php
endforeach
;
?>
</select>
</div>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
角色
</label>
<select
class=
"select"
size=
"5"
name=
"HrVO.roles"
multiple
>
<option
selected
value
>
请选择
</option>
<?php
foreach
(
$this
->
session
->
role
as
$k
=>
$v
)
:
?>
<
option
value
=
"<?=
$v->id
?>"
><?=
$v
->
nameZh
?>
</option>
<?php
endforeach
;
?>
<?php
foreach
(
$this
->
session
->
role
as
$k
=>
$v
)
:
?>
<option
value=
"
<?=
$v
->
id
?>
"
>
<?=
$v
->
nameZh
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
<div
class=
"row cl pt-20 pb-20 col-sm-12"
>
<div
class=
"col-sm-offset-4 col-sm-2"
>
<button
class=
"btn btn-primary btn-block"
onclick=
"saveStaff()"
>
保存
</button>
</div>
<div
class=
"col-sm-2"
>
<button
class=
"btn btn-warning btn-block"
onclick=
"layer_close()"
>
取消
</button>
</div>
<div
class=
"row cl pt-20 pb-20 col-sm-12"
>
<div
class=
"col-sm-offset-4 col-sm-2"
>
<button
class=
"btn btn-primary btn-block"
onclick=
"saveStaff()"
>
保存
</button>
</div>
<div
class=
"col-sm-2"
>
<button
class=
"btn btn-warning btn-block"
onclick=
"layer_close()"
>
取消
</button>
</div>
</div>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<script>
function
random
()
{
var
password
=
'aoeuaoeu'
;
$
(
'#password'
).
val
(
password
);
}
<script>
function
random
()
{
var
password
=
'aoeuaoeu'
;
$
(
'#password'
).
val
(
password
);
}
function
saveStaff
()
{
var
targetUrl
=
$
(
"#add"
).
attr
(
"action"
);
var
data
=
$
(
"#add"
).
serializeJson
();
$
.
ajax
({
type
:
'post'
,
url
:
apiBaseUrl
+
targetUrl
,
cache
:
false
,
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
contentType
:
"application/json; charset=UTF-8"
,
success
:
function
(
data
)
{
if
(
data
.
msg
)
{
layer
.
alert
(
data
.
msg
);
}
else
if
(
data
.
code
!=
0
)
{
layer
.
alert
(
'操作失败'
);
}
else
{
layer
.
msg
(
'操作成功'
);
}
function
saveStaff
()
{
var
targetUrl
=
$
(
"#add"
).
attr
(
"action"
);
var
data
=
$
(
"#add"
).
serializeJson
();
$
.
ajax
({
type
:
'post'
,
url
:
apiBaseUrl
+
targetUrl
,
cache
:
false
,
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
contentType
:
"application/json; charset=UTF-8"
,
success
:
function
(
data
)
{
if
(
data
.
msg
)
{
layer
.
alert
(
data
.
msg
);
}
else
if
(
data
.
code
!=
0
)
{
layer
.
alert
(
'操作失败'
);
}
else
{
layer
.
msg
(
'操作成功'
);
}
if
(
!
data
.
code
)
{
setTimeout
(
function
()
{
if
(
!
data
.
code
)
{
window
.
parent
.
reload
();
layer_close
();
}
},
500
);
},
error
:
function
()
{
layer
.
alert
(
"操作失败"
)
window
.
parent
.
reload
();
layer_close
();
},
500
);
}
})
}
</script>
},
error
:
function
()
{
layer
.
alert
(
"操作失败"
)
}
})
}
</script>
</body>
<html>
...
...
Write
Preview
Styling with
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