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
944b307e
authored
2018-03-28 22:39:51 +0800
by
Zelig
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
员工搜索
1 parent
c658d51f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
66 deletions
application/views/common/footer.php
application/views/perm/staff.php
application/views/common/footer.php
View file @
944b307
...
...
@@ -117,6 +117,7 @@
aoData
.
modifyUser
=
$
(
'[name="modifyUser"]'
).
val
()
||
''
;
aoData
.
proposerName
=
$
(
'[name="proposerName"]'
).
val
()
||
''
;
aoData
.
phoneNumber
=
$
(
'[name="phoneNumber"]'
).
val
()
||
''
;
aoData
.
role
=
$
(
'[name="role"]'
).
val
()
||
''
;
},
});
...
...
application/views/perm/staff.php
View file @
944b307
...
...
@@ -7,7 +7,7 @@
<div
class=
"row cl mb-20"
>
<div
class=
"col-xs-2"
>
<span
class=
"select-box"
>
<select
class=
"select table_search"
size=
"1"
column=
"1
"
>
<select
class=
"select table_search"
size=
"1"
name=
"departments
"
>
<option
value=
""
selected
>
网点
</option>
<?php
foreach
(
$this
->
session
->
departments
as
$k
=>
$v
)
:?>
<
option
value
=
"<?=
$v->id
?>"
><?=
$v
->
name
?>
</option>
...
...
@@ -22,7 +22,7 @@
</div>
<div
class=
"col-xs-2"
>
<span
class=
"select-box"
>
<select
class=
"select table_search"
size=
"1"
column=
"2"
>
<select
class=
"select table_search"
size=
"1"
column=
"2"
name=
"role"
>
<option
value=
""
selected
>
角色
</option>
<?php
foreach
(
$this
->
session
->
role
as
$k
=>
$v
)
:?>
<
option
value
=
"<?=
$v->id
?>"
><?=
$v
->
nameZh
?>
</option>
...
...
@@ -32,13 +32,14 @@
</div>
</div>
<div>
<button
class=
"btn btn-primary radius"
type=
"button"
onclick=
"$('#table').DataTable().draw()"
>
搜索
</button>
<input
class=
"btn btn-warning radius"
type=
"reset"
value=
"重置搜索"
>
<button
class=
"btn btn-primary radius"
type=
"button"
onclick=
"add()"
>
添加员工
</button>
</div>
</form>
<div
class=
"body mt-20"
>
<table
class=
"table table-border table-bordered table-bg"
id=
"table"
>
<table
class=
"table table-border table-bordered table-bg"
id=
"table"
url=
"system/user/getAllHr"
>
<thead
class=
"text-c"
>
<tr>
<th
width=
"68px"
>
操作
</th>
...
...
@@ -61,36 +62,6 @@
<script>
var table = $('#table').dataTable({
aaSorting: [[1, "desc"]],
serverSide: true,
processing: true,
bSort: false,
searching: false,//是否显示搜索
iDisplayLength: 6,
bLengthChange: false,
ajax: {
url: apiBaseUrl + 'system/user/getAllHr',
dataFilter: function (json) {
var ret = {}, json = jQuery.parseJSON(json);
ret.data = json.data || [];
var draw = getUrlParam('draw');
if(draw) {
ret.draw = draw;
}
ret.recordsTotal = 0;
ret.recordsFiltered = 0;
if (json.page) {
ret.recordsTotal = parseInt(json.page.totalNumber);
ret.recordsFiltered = parseInt(json.page.totalNumber);
}
return JSON.stringify(ret);
},
data: function (data) {
data.pageSize = data.length;
data.currentPage = parseFloat(data.start / data.length) + 1;
return data;
}
},
columns: [
{
data: "id", render: function (data, type, full) {
...
...
@@ -118,39 +89,6 @@
{data: "remark"},//备注
]
});
$.fn.dataTableExt.afnFiltering.push(
function (oSettings, aData, iDataIndex) {
var min = document.getElementById('min').value;
var max = document.getElementById('max').value;
var iDateCol = 12;
var dateMin = new Date(aData[iDateCol]);
var dateMax = new Date(aData[iDateCol]);
if (min === '' && max === '')
return true;
else if (new Date(min).getTime() <= dateMin.getTime() && max === '')
return true;
else if (new Date(min).getTime() <= dateMin.getTime() && new Date(max).getTime() >= dateMax.getTime())
return true;
return false;
}
);
$('.table_search').on('change', function () {
search = $(this).val();
column = $(this).attr('column');
$('#table').DataTable().column(column).search(search).draw();
});
$('#min, #max').on('keyup', function () {
$('#table').DataTable().draw();
});
function resetHandler() {
$('#table').DataTable().columns().search("").draw();
}
function add() {
layer_show('添加员工', '
<?=
site_url
(
'perm/staffAdd'
);
?>
');
...
...
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