Commit 7659182a by sunxin

移交列表下一页bug修复

parent 8d5947c6
......@@ -736,9 +736,9 @@ public class ReportController extends BaseController {
*/
@RequestMapping(value = "viewTransfer")
public void viewTransfer(User user, String flag, HttpServletRequest request, HttpServletResponse
response, Model model) throws IOException {
response, Model model,Integer pageNo,Integer pageSize) throws IOException {
Page<User> page = reportService.findUserPage(new Page<User>(request, response), user);
Page<User> page = reportService.findUserPage(new Page<User>(pageNo, pageSize), user);
StringBuffer html = new StringBuffer();
html.append("<table id='contentTable' class='table table-striped table-bordered table-condensed'>");
html.append(" <thead>");
......@@ -769,7 +769,7 @@ public class ReportController extends BaseController {
for (User userEntity : page.getList()) {
html.append(" <tr>");
if (flag.equals("1")) {
html.append(" <td><input type='radio' value='" + userEntity.getId() + "' onclick='chooseRen(this);'></td>");
html.append(" <td><input type='radio' value='" + userEntity.getId() + "'></td>");
html.append(" <td>" + i + "</td>");
html.append(" <td>" + (userEntity.getNo() == null ? "" : userEntity.getNo()) + "</td>");
html.append(" <td>" + (userEntity.getName() == null ? "" : userEntity.getName()) + "</td>");
......
......@@ -293,10 +293,6 @@
}
function resetPageNo() {
$("#pageNo").val(0);
}
</script>
<style type="text/css">
......
......@@ -996,7 +996,7 @@
<div id="chooseContent">
<script type="text/javascript">
$(document).ready(function () {
$("#btnSearch").click(function () {
/* $("#btnSearch").click(function () {
$.ajax({
url: "${ctx}/report/viewTransfer?flag=1",
dataType: "html",
......@@ -1017,10 +1017,10 @@
$("#btnSearch").removeAttr("disabled");
}
});
});
});*/
$("input:radio").click(function () {
$("input:radio").attr("checked", false);
$("input:radio").attr("checked", false);
$("#chooseItem").empty();
$(this).attr("checked", true);
$("#chooseItem").html("已选择 " + b.parent().next().next().next().html() + "<span onclick='remove();'><font size='5'> ×</font></span>");
......@@ -1028,82 +1028,85 @@
});
function chooseRen(obj) {
/*function chooseRen(obj) {
$("input:radio").attr("checked", false);
$("#chooseItem").empty();
obj.checked = true;
$("#chooseItem").html("已选择 " + $("input:radio:checked").parent().next().next().next().html() + "<span onclick='remove();'><font size='5'> ×</font></span>");
}
}*/
function remove() {
$("input:radio").attr("checked", false);
$("#chooseItem").empty();
}
<%--function page(n, s) {--%>
<%--$("#pageNo").val(n);--%>
<%--$("#pageSize").val(s);--%>
<%--$.ajax({--%>
<%--url: "${ctx}/report/viewTransfer?flag=1",--%>
<%--dataType: "html",--%>
<%--data: $('#searchForm').serialize(),--%>
<%--cache: false,--%>
<%--success: function (data) { //登录成功后返回的数据--%>
<%--$("#userList").empty();--%>
<%--$("#userList").html($(data));--%>
<%--},--%>
<%--error: function () {--%>
<%--alert("数据错误!");--%>
<%--}--%>
<%--});--%>
<%--return false;--%>
<%--}--%>
/* 移交人员列表分页 page */
function page(n, s) {
/* alert(n+"=========================="+s);*/
$.ajax({
url: "${ctx}/report/viewTransfer?flag=1",
dataType: "html",
data:{"pageNo":n,"pageSize":s},
cache: false,
success: function (data) { //登录成功后返回的数据
$("#userList").empty();
$("#userList").html($(data));
},
error: function () {
alert("数据错误!");
}
});
return false;
}
function resetPageNo() {
$("#pageNo").val(0);
}
</script>
<span class="title">选择移交人员</span>
<div id="userList">
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>选择</th>
<th>ID</th>
<th>员工号</th>
<th>姓名</th>
<th>手机号</th>
<th>所属公司</th>
<th>所属部门</th>
<th>职位</th>
</tr>
</thead>
<tbody>
<c:if test="${page.list.size()>0}">
<c:forEach items="${page.list}" var="user" varStatus="vs">
<tr>
<td id="radioBtn"><input type="radio" value="${user.id}"></td>
<td>${vs.count}</td>
<td>${user.no}</td>
<td>${user.name}</td>
<td>${user.mobile}</td>
<td>${user.company.name}</td>
<td>${user.office.name}</td>
<td>${user.position.name}</td>
</tr>
</c:forEach>
</c:if>
</tbody>
</table>
<span id="chooseItem"></span>
<span id="chooseItem"></span> <span class="title">选择移交人员</span>
<div id="userList">
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>选择</th>
<th>ID</th>
<th>员工号</th>
<th>姓名</th>
<th>手机号</th>
<th>所属公司</th>
<th>所属部门</th>
<th>职位</th>
</tr>
</thead>
<tbody>
<c:if test="${page.list.size()>0}">
<c:forEach items="${page.list}" var="user" varStatus="vs">
<tr>
<td id="radioBtn"><input type="radio" value="${user.id}"></td>
<td>${vs.count}</td>
<td>${user.no}</td>
<td>${user.name}</td>
<td>${user.mobile}</td>
<td>${user.company.name}</td>
<td>${user.office.name}</td>
<td>${user.position.name}</td>
</tr>
</c:forEach>
</c:if>
</tbody>
</table>
<c:if test="${page.list.size()=='0'}">
<span style="color: #999999;margin: 20px 0 70px 20px;display: block;">未查询到相关内容</span>
</c:if>
<c:if test="${page.list.size()>0}">
<div class="pagination">${page}</div>
</c:if>
</div>
<li class="btns">
<label style="width:auto;"><input id="btnConfirm" class="btn btn-primary" type="button" value="确定"/>&nbsp;&nbsp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment