Commit 7659182a by sunxin

移交列表下一页bug修复

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