📄 list.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath() %>/html/css/style.css" rel="stylesheet" type="text/css">
<script src="<%=request.getContextPath() %>/html/script/common.js"></script>
<script type="text/javascript">
function doSearch(){
document.forms['pageForm'].action="<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].submit();
}
function getid(obj)
{
var url="<%=request.getContextPath() %>/customersAction.do?operate=doupdatecustomer&id="+obj;
to(url);
}
function delcus(ids)
{
var url="<%=request.getContextPath() %>/customersAction.do?operate=delete&id="+ids;
to(url);
}
function tolianxiren(linkmanid)
{
document.forms['pageForm'].action="<%=request.getContextPath()%>/linkMan.do?operate=SearchLinkMan&id="+linkmanid;
document.forms['pageForm'].submit();
}
function tojiaowangjilu(customersid)
{
document.forms['pageForm'].action="<%=request.getContextPath()%>/intercourseInfo.do?operate=SearchInfo&intercourseinfoid="+customersid;
document.forms['pageForm'].submit();
}
function toOrders(obj1)
{
var url="<%=request.getContextPath()%>/orders.do?operate=SearchOrders&id="+obj1;
to(url);
}
</script>
</head>
<body>
<div class="page_title">客户信息管理</div>
<div class="button_bar">
<button class="common_button" onclick="help('');">帮助</button>
<button class="common_button" onclick="doSearch();">查询</button>
</div>
<html:form action="/customersAction" method="post" styleId="pageForm">
<table class="query_form_table">
<tr>
<th>客户编号</th>
<td><html:text property="item.customersNo"/></td>
<th>名称</th>
<td><html:text property="item.customersName"/></td>
<th>地区</th>
<td>
<html:select property="item.customersArea">
<html:option value="">全部</html:option>
<html:option value="北京">北京</html:option>
<html:option value="华北">华北</html:option>
<html:option value="中部">中部</html:option>
<html:option value="东北">东北</html:option>
<html:option value="西部">西部</html:option>
</html:select>
</td>
</tr>
<tr>
<th>客户经理</th>
<td><html:text property="item.manager"/></td>
<th>客户等级</th>
<td>
<html:select property="item.grade">
<html:option value="">请选择...</html:option>
<c:forEach items="${listbasedata}" var="listbasedata">
<html:option value="${listbasedata.baseName }">${listbasedata.baseName }</html:option>
</c:forEach>
</html:select>
</td>
<th> </th>
<td> </td>
</tr>
</table>
<br />
<table class="data_list_table">
<tr>
<th>序号</th>
<th>客户编号</th>
<th>名称</th>
<th>地区</th>
<th>客户经理</th>
<th>客户等级</th>
<th>操作</th>
</tr>
<c:if test="${list==null}">
<div style="color: red;font-size: 12px;">没有记录</div>
</c:if>
<c:forEach items="${list}" var="list"><tr>
<td class="list_data_text">${list.customersId }</td>
<td class="list_data_text">${list.customersNo }</td>
<td class="list_data_ltext">${list.customersName }</td>
<td class="list_data_text">${list.customersArea }</td>
<td class="list_data_text">${list.customersManager.linkManName }</td>
<td class="list_data_text">${list.customersGrade.baseName}</td>
<td class="list_data_op">
<img onclick="getid('${list.customersId }');" title="编辑" src="<%=request.getContextPath()%>/html/images/bt_edit.gif" class="op_button" />
<img onclick="tolianxiren('${list.customersId }');" title="联系人" src="<%=request.getContextPath()%>/html/images/bt_linkman.gif" class="op_button" />
<img onclick="tojiaowangjilu('${list.customersId }');" title="交往记录" src="<%=request.getContextPath()%>/html/images/bt_acti.gif" class="op_button" />
<img onclick="toOrders('${list.customersId }');" title="历史订单" src="<%=request.getContextPath()%>/html/images/bt_orders.gif" class="op_button" />
<img onclick="delcus('${list.customersId }');" title="删除" src="<%=request.getContextPath()%>/html/images/bt_del.gif" class="op_button" />
</td></tr>
</c:forEach>
<tr>
<th colspan="100" class="pager">
<div class="pager">
<logic:notEmpty name="list" scope="request">
共
${count }条记录 每页显示<html:text property="item.maxResults"
style="width:20px;" />条
第<html:text property="item.pageNo" style="width:20px;" />页 / 共${pages }页
<input type="hidden" name="lastNo" value="${pages }" />
<a href="javascript:page_first();">第一页</a>
<a href="javascript:page_pre();">上一页</a>
<a href="javascript:page_next();">下一页</a>
<a href="javascript:page_last();">最后一页</a>
<button onclick="javascript:page_go();">
GO
</button>
<script>
function page_go()
{
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].submit();
}
function page_first()
{
document.forms['pageForm'].action = "<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].elements["item.pageNo"].value = 1;
document.forms['pageForm'].submit();
}
function page_pre()
{
var pageNo = document.forms['pageForm'].elements["item.pageNo"].value;
document.forms['pageForm'].elements["item.pageNo"].value = parseInt(pageNo) - 1;
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].submit();
}
function page_next()
{
var pageNo = document.forms['pageForm'].elements["item.pageNo"].value;
document.forms['pageForm'].elements["item.pageNo"].value = parseInt(pageNo) + 1;
page_validate();
document.forms['pageForm'].action = "<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].submit();
}
function page_last()
{
var lastNo = document.forms['pageForm'].elements["lastNo"].value;
document.forms['pageForm'].elements["item.pageNo"].value = lastNo;
document.forms['pageForm'].action = "<%=request.getContextPath()%>/customersAction.do?operate=SearchCustomersList";
document.forms['pageForm'].submit();
}
function page_validate()
{
var pageTotal = document.forms['pageForm'].elements["lastNo"].value;
var pageNo = document.forms['pageForm'].elements["item.pageNo"].value;
if (pageNo<1)pageNo=1;
if (pageNo>pageTotal)pageNo=pageTotal;
document.forms['pageForm'].elements["item.pageNo"].value = pageNo;
var recTotal = 18;
var pageSize = document.forms['pageForm'].elements["item.maxResults"].value;
if (pageSize<1)pageSize=1;
document.forms['pageForm'].elements["item.maxResults"].value = pageSize;
}
</script>
</logic:notEmpty>
</div>
</th>
</tr>
</table>
</html:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -