📄 stockmanageledgerview.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "data.*, user.*, method.DataMethod"%>
<%
//设置取得字符串的编码机制
request.setCharacterEncoding("GBK");
String userName = "";
if(session.getAttribute("user") != null){
User user = (User)session.getAttribute("user");
userName = user.getUserName();
}else{
out.print("<h3>请先登陆系统.</h3>");
return;
}
String ledgerDate = "";
if(session.getAttribute("ledgerDate") == null){
out.print("<h3>请先选择账套.</h3>");
return;
}else{
ledgerDate = (String)session.getAttribute("ledgerDate");
}
//创建库存账套数组
String[][] stockLedgers = new String[0][13];
//创建数据类
StockManagementData stockManagementData = new StockManagementData();
//创建方法类
DataMethod dataMethod = new DataMethod();
//根据传入参数取得库存账套数组
if(request.getParameter("selectedIndex") != null){
//取得单据类型
int orderType = Integer.parseInt(request.getParameter("orderType"));
int selectedIndex = Integer.parseInt(request.getParameter("selectedIndex"));
String searchValue = request.getParameter("searchValue");
String startDateStr = request.getParameter("startDate");
String endDateStr = request.getParameter("endDate");
if (selectedIndex == 0 | selectedIndex == 1 | selectedIndex == 2 |
selectedIndex == 3 | selectedIndex == 4 | selectedIndex == 5) {
if (searchValue.length() == 0) {
out.print("<h3>请输入查询值</h3>");
return;
}
switch (selectedIndex) {
case 0:
//根据单据编号取得记录
stockLedgers = stockManagementData.getStockLedgerByStringField(
ledgerDate, "orderId", searchValue, orderType);
break;
case 1:
//根据填写用户取得记录
stockLedgers = stockManagementData.getStockLedgerByStringField(
ledgerDate, "submitUser", searchValue, orderType);
break;
case 2:
//根据检查用户取得记录
stockLedgers = stockManagementData.getStockLedgerByStringField(
ledgerDate, "checkUser", searchValue, orderType);
break;
case 3:
//根据调出/调入仓库名字取得记录
stockLedgers = stockManagementData.getStockLedgerByStringField(
ledgerDate, "commitUser", searchValue, orderType);
break;
case 4:
//根据仓库名取得记录
stockLedgers = stockManagementData.getStockLedgerByStringField(
ledgerDate, "warehouse", searchValue, orderType);
break;
case 5:
if(dataMethod.checkInt(searchValue) == 0){
out.print("<h3>按完成状态查询时,输入值必须是整数,"
+ "0表示进行,1表示撤消,2表示完成,3表示盘点单撤消,4表示盘点单完成.</h3>");
return;
}
//根据完成状态取得记录
stockLedgers = stockManagementData.getStockLedgerByOnProcess(
ledgerDate, orderType, Integer.parseInt(searchValue));
break;
}
}else{
java.sql.Timestamp startDate = dataMethod.transferDate(startDateStr);
java.sql.Timestamp endDate = dataMethod.transferEndDate(endDateStr);
if(startDate == null | endDate == null){
out.print("<h3>日期输入错误,正确的日期格式是"
+ "yyyy-mm-dd(年-月-日),如2004-1-1.</h3>");
return;
}
//根据日期取得记录
stockLedgers = stockManagementData.getStockLedgerByOrderDate(ledgerDate,
startDate, endDate, orderType);
}
}
//创建表格标题数组
String[] colNames = {"单据编号", "单据类型", "关联标识", "填写用户", "调出/调入仓库", "检查用户",
"", "", "仓库名", "填写日期", "系统日期", "完成状态", "备注"};
%>
<html>
<head>
<title>库存单据查看页面:用户(<%=userName%>):账套(<%=ledgerDate%>)</title>
</head>
<body bgcolor="#ffffff">
<center>
<h3>库存单据查看页面:用户(<%=userName%>):账套(<%=ledgerDate%>)</h3>
<form action="stockmanageledgerview.jsp" method="get">
<p>
单据类型
<select name="orderType">
<option value="2">商品调出单</option>
<option value="3">商品调入单</option>
<option value="6">盘点损失单</option>
<option value="7">盘点盈收单</option>
<option value="13">盘点单</option>
</select>
查询条件:
<select name="selectedIndex">
<option value="0">根据单据编号查询</option>
<option value="1">根据填写用户查询</option>
<option value="2">根据检查用户查询</option>
<option value="3">根据调出/调入仓库名查询</option>
<option value="4">根据仓库名查询</option>
<option value="5">根据完成状态查询</option>
<option value="6">根据填写日期查询</option>
</select>
查询值:
<input name="searchValue" type="text" size="18">
</p>
<p>
开始日期:
<input name="startDate" type="text" size="17">
结束日期:
<input name="endDate" type="text" size="17">
<input name="search" type="submit" value="查询">
</p>
</form>
<hr size="3" color="#0066FF">
<!--根据库存账套数组显示表格内容-->
<table width="100%" border="1">
<tr align="center">
<%for(int i = 0; i < colNames.length; i++){%>
<td><font size="-1"><%=colNames[i]%></font></td>
<%}%>
</tr>
<%for (int i = 0; i < stockLedgers.length; i++){%>
<tr align="left">
<%for(int j = 0; j < stockLedgers[0].length; j++){
if(j == stockLedgers[0].length - 1){%>
<td>
<font size="-1">
<textarea name="remark" cols="10" rows="1"><%=stockLedgers[i][j]%></textarea>
</font>
</td>
<%}else if(j == 0){%>
<td>
<font size="-1">
<a href="stockmanagesubledgerview.jsp?orderId=<%=stockLedgers[i][j]%>" target="stockmanagesubledger">
<%=stockLedgers[i][j]%>
</a>
</font>
</td>
<%}else{%>
<td><font size="-1"><%=stockLedgers[i][j]%> </font></td>
<% }
}%>
</tr>
<%}%>
</table>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -