📄 stock_inquiry_frame.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB2312"%>
<jsp:directive.page import="java.util.ArrayList"/>
<jsp:directive.page import="com.captainli.dboperation.StockDA"/>
<jsp:directive.page import="com.captainli.bean.StockPagesBean"/>
<jsp:directive.page import="com.captainli.dboperation.PaymentDA"/>
<jsp:directive.page import="com.captainli.dboperation.PurchaseDA"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../css/sys.css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-right:0px;
margin-top: 0px;
background-color: #FFFFFF;
}
a:link {
color: #1A438E;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: underline;
}
.button1 {font:normal 12px/120% Verdana,'宋体';height:18px;
border-left:1px red solid;
border-top:1px red solid;
border-right:1px red solid;
border-bottom:1px red solid;
background: #dddddd;}
-->
</style>
</head>
<%
double all_Amount = new StockDA().showSumAmount();
%>
<%
int p_w_id = 0;
int p_bc_id = 0;
int p_sc_id = 0;
ArrayList arryStock = null;
%>
<%
if(request.getParameter("p_w_id") != null && request.getParameter("p_bc_id") != null && request.getParameter("p_sc_id") != null){
if(request.getParameter("p_w_id").toString().equals("0")){//仓库没选
if(request.getParameter("p_bc_id").toString().equals("0")){//大类没选
if(request.getParameter("p_sc_id").toString().equals("0")){//小类没选
arryStock = new StockDA().showAllStock();
}else{//小类选了
//通过小类查询
p_sc_id = Integer.parseInt(request.getParameter("p_sc_id"));
arryStock = new StockDA().showAllByP_sc_id(p_sc_id);
}
}else{//大类选了
//通过大类查询
p_bc_id = Integer.parseInt(request.getParameter("p_bc_id"));
arryStock = new StockDA().showAllByP_bc_id(p_bc_id);
}
}else{//仓库选了
if(request.getParameter("p_bc_id").toString().equals("0")){//大类没选
if(request.getParameter("p_sc_id").toString().equals("0")){//小类没选
//通过仓库查询
p_w_id = Integer.parseInt(request.getParameter("p_w_id"));
arryStock = new StockDA().showAllByP_w_id(p_w_id);
}else{//小类选了
//通过仓库 小类 查询
p_w_id = Integer.parseInt(request.getParameter("p_w_id"));
p_sc_id = Integer.parseInt(request.getParameter("p_sc_id"));
arryStock = new StockDA().showAllByP_w_idAndP_sc_id(p_w_id, p_sc_id);
}
}else{//大类选了
//通过仓库 大类 查询
p_bc_id = Integer.parseInt(request.getParameter("p_bc_id"));
p_w_id = Integer.parseInt(request.getParameter("p_w_id"));
arryStock = new StockDA().showAllByP_w_idAndP_bc_id(p_w_id, p_bc_id);
}
}
}else{
arryStock = new StockDA().showAllStock();
}
%>
<%
String p_name = "";
if(request.getParameter("p_name") != null){
p_name = new String(request.getParameter("p_name").getBytes("ISO-8859-1"),"GB2312");
arryStock = new StockDA().showAllByP_name(p_name);
}else{
arryStock = new StockDA().showAllStock();
}
%>
<%
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount;//总页数
int intPage; //待显示页码
String strPage; //请求页码
//设置一页显示的记录数
intPageSize = 10;
//取得显示的页码
strPage = request.getParameter("page");
if(strPage == null){//刚打开网页的时候,表明没有参数,此时显示第1页数据
intPage = 1;
}
else{//将字符串转换成整型
intPage = Integer.parseInt(strPage);
//if(intPage <= 1)
// intPage = 1;
}
//获取记录总数
intRowCount = arryStock.size();
//记算总页数
intPageCount = (intRowCount + intPageSize-1) / intPageSize;
int startNum = (intPage - 1) * intPageSize;//当前页起始索引
int endNum = startNum + intPageSize;//当前页结束索引
if(endNum >= arryStock.size()){
endNum = arryStock.size();
}
%>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/system/r_1.gif" alt="" /></td>
<td width="100%" background="../images/system/r_0.gif"><table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td> </td>
<td align="right">总库存金额:<%= all_Amount %> 元 </td>
</tr>
</table></td>
<td><img src="../images/system/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td><!--startprint-->
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr align="center">
<td class="category" width="151">批次号</td>
<td width="235" height="30" class="category">药品名称</td>
<td width="210" class="category">供应商</td>
<td width="72" class="category">库存数量</td>
<td width="130" class="category">进货单价(元)</td>
<td width="130" class="category">总金额(元)</td>
</tr><%
for(int i = startNum;i < endNum;i++){
StockPagesBean bean = (StockPagesBean)arryStock.get(i);
%>
<tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''" onDblClick="javascript:var win=window.open('stock_inquiry_show.jsp?rid=<%= bean.getR_id() %>','库存详细信息','width=853,height=410,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus();">
<td align="center"><%= bean.getR_no() %></td>
<td align="center" height="25"><%= bean.getP_name() %></td>
<td align="center"><%= bean.getI_name() %></td>
<td align="center"><%= bean.getR_quantity() %></td>
<td align="center"><%= bean.getR_price() %></td>
<td align="center"><%= bean.getR_amount() %></td>
</tr><%} %>
<tr>
<td colspan="8" height="30" class="category"><table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="20%" align="left" style="color:#FF0000;">双击查看产品详细信息</td>
<td width="80%" align="right"> 第<%= intPage%>页 共<%= intPageCount%>页
<% //以下是分页的“上一页”“下一页”,有上一页就有链接,没有就为文字,下一页同理 %>
<% if(intPage > 1){ %>
<a href="stock_inquiry_frame.jsp?page=<%= intPage-1%>&p_w_id=<%= p_w_id %>&p_bc_id=<%= p_bc_id %>&p_sc_id=<%= p_sc_id %>&p_name=<%= p_name %>">上一页</a>
<% }else{ %>
上一页
<%}%>
<% if(intPage < intPageCount){ %>
<a href="stock_inquiry_frame.jsp?page=<%= intPage+1%>&p_w_id=<%= p_w_id %>&p_bc_id=<%= p_bc_id %>&p_sc_id=<%= p_sc_id %>&p_name=<%= p_name %>">下一页</a>
<% }else{ %>
下一页
<%}%></td>
</tr>
</table></td>
</tr>
</table>
<!--endprint-->
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/system/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/system/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -