217 lines
7.7 KiB
Plaintext
217 lines
7.7 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK" %>
|
||
<%@ page import="java.util.*"%>
|
||
<%@ page import="com.wxzd.wms.util.ServerUtil"%>
|
||
<html><head>
|
||
<title>出库表计扫描确认</title>
|
||
<link rel="stylesheet" type="text/css" href="css/sm.css">
|
||
<script type="text/javascript" src="script/ajax.js"></script>
|
||
<script type="text/javascript" src="script/ck.js"></script>
|
||
<script type="text/javascript" src="script/logic.js"></script>
|
||
</head>
|
||
<jsp:useBean id="db1" scope="application" class="com.zcsoft.dbvisit.DB" />
|
||
<%
|
||
String errorInfo = null, ckdh = null, zlbh = null;
|
||
session = request.getSession(false);
|
||
if (session != null && session.getAttribute("userInfo") != null)
|
||
{
|
||
ckdh = request.getParameter("ckdh");
|
||
zlbh = request.getParameter("zlbh");
|
||
//出库单号。如果还没有,则首先让用户选择出库单号
|
||
if (ckdh != null && ckdh.length() > 0
|
||
&& zlbh != null && zlbh.length() > 1)
|
||
{
|
||
//检查出库单号是否有效。PEDING 因为是选择输入的,所以检查不重要
|
||
//db1.getSingleField("SELECT )
|
||
}
|
||
else
|
||
{//弹出选择出库单号的界面
|
||
if (ckdh != null && ckdh.length() == 0) ckdh = null;
|
||
if (zlbh != null && zlbh.length() == 0) zlbh = null;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
response.sendRedirect("sm.jsp");
|
||
return;
|
||
}
|
||
%>
|
||
<body onload="check(true);">
|
||
<form name=ckbjxx onsubmit="return check(false);">
|
||
<table align="center">
|
||
<%
|
||
if (errorInfo != null)
|
||
{
|
||
out.println("<tr><td colspan=2><font color=red>" + errorInfo + "</font>");
|
||
}
|
||
if (ckdh == null)
|
||
{//弹出出库单选择表单
|
||
out.println("<tr><td colspan=2 class=title>请选择出库单");
|
||
List cks = db1.getVDataWithException("SELECT ckdh,sqbh,cksl,zcfl,model,volt,curr,current_ratio,acuuracy,meter_close_mode FROM ckd_sm_v WHERE zt IN(0,1) ORDER BY 2,1");
|
||
out.println("<tr><td colspan=2><table border=1>");
|
||
out.println("<tr bgcolor=gray><th>出库单号<th>申请单号<th>请领数量<th>设备类型<th>型号<th>电压<th>电流<th>电流变比<th>等级<th>跳闸方式");
|
||
for (int i = 0; i < cks.size(); i++)
|
||
{
|
||
List row = (List)cks.get(i);
|
||
int j = 0;
|
||
String dh = (String)row.get(j++);
|
||
String sqbh = (String)row.get(j++);
|
||
out.write("<tr><td><input name=ckdh type=radio value=\"");
|
||
out.write(dh);out.write("\"");
|
||
if (i == 0 && cks.size() == 1)
|
||
{
|
||
out.write(" checked");//仅一张单据时,默认选中
|
||
}
|
||
out.write(">");out.write(dh);
|
||
out.write("<td>");out.write(sqbh);
|
||
out.write("<td class=numeric>");out.write((String)row.get(j++));//cksl
|
||
out.write("<td>");out.write((String)row.get(j++));//zcfl
|
||
out.write("<td>");out.write((String)row.get(j++));//model
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
|
||
}
|
||
out.println("</table>");
|
||
out.println("<tr><td colspan=2><input name=submit type=submit value=\"提 交\">");
|
||
}
|
||
else if (zlbh == null)
|
||
{
|
||
out.write("<input type=hidden name=ckdh value=\"" + ckdh + "\">");
|
||
List ckds = db1.getVDataWithPrepareStatement("SELECT zlbh,kwbh,cksl,tpbh,kcsl,qczt FROM ckzl"
|
||
+ " WHERE pzbh=? AND qczt<2 AND smqrs<cksl ORDER BY qczt,zlbh"
|
||
, ckdh);
|
||
if (ckds.size() == 0)//全部取出来了,就对整张扫表
|
||
{
|
||
response.sendRedirect("ck.jsp?ckdh=" + ckdh + "&zlbh=0");
|
||
return;
|
||
}
|
||
out.println("<tr><td colspan=2 class=title>请选择出库库位");
|
||
out.println("<tr><td colspan=2><table border=1>");
|
||
out.println("<tr bgcolor=gray><th>指令号<th>库位号<th>出库数<th>托盘号<th>库存数<th>取出状态");
|
||
for (int i = 0; i < ckds.size(); i++)
|
||
{
|
||
List row = (List)ckds.get(i);
|
||
int j = 0;
|
||
String zlh = (String)row.get(j++);
|
||
String kwbh = (String)row.get(j++);
|
||
String cks = (String)row.get(j++);
|
||
String tpbh = (String)row.get(j++);
|
||
|
||
out.write("<tr><td>");
|
||
out.write("<input name=zlbh type=radio value=\"");
|
||
out.write(zlh + "|" + kwbh + "|" + cks + "|" + tpbh);out.write("\"");
|
||
if (i == 0) out.write(" checked");
|
||
out.write(">");
|
||
out.write(zlh);
|
||
out.write("<td>");out.write(kwbh);
|
||
out.write("<td class=numeric>");out.write(cks);
|
||
out.write("<td>");out.write(tpbh);
|
||
out.write("<td>");out.write((String)row.get(j++));
|
||
int qczt = ServerUtil.getInt((String)row.get(j++));
|
||
String qcztms;
|
||
switch (qczt)
|
||
{
|
||
case 0:
|
||
qcztms = "就绪";
|
||
break;
|
||
case 1:
|
||
qcztms = "执行中";
|
||
break;
|
||
default:
|
||
qcztms = Integer.toString(qczt);
|
||
break;
|
||
}
|
||
out.write("<td>");out.write(qcztms);
|
||
|
||
}
|
||
|
||
out.println("</table>");
|
||
out.println("<tr><td colspan=2><input name=submit type=submit value=\"提 交\">");
|
||
}
|
||
else
|
||
{
|
||
Map ckdxx;
|
||
String zlh = null, ckkw = null, cks = null, tpbh = null;
|
||
if (zlbh.indexOf('|') > 0)
|
||
{
|
||
int indexSeparator = zlbh.indexOf('|');
|
||
int indexSeparator2 = zlbh.indexOf('|', indexSeparator + 1);
|
||
int indexSeparator3 = zlbh.indexOf('|', indexSeparator2 + 1);
|
||
zlh = zlbh.substring(0, indexSeparator);
|
||
ckkw = zlbh.substring(indexSeparator + 1, indexSeparator2);
|
||
cks = zlbh.substring(indexSeparator2 + 1, indexSeparator3);
|
||
tpbh = zlbh.substring(1 + indexSeparator3);
|
||
}
|
||
//显示出库单号和指令编号
|
||
out.write("<input type=hidden name=ckdh value=\"" + ckdh + "\">");
|
||
out.write("<input type=hidden name=zlbhAndTpbh value=\"" + (zlh != null?zlh + "|" + tpbh:"") + "\">");
|
||
out.write("<tr><td>出库单号:</td><td>" + ckdh);
|
||
ckdxx = db1.getSingleRow("SELECT yapsl-smsl wssl,yapsl,cksl,smsl,sqbh FROM ckd WHERE ckdh=? AND zt<=2", ckdh);
|
||
if (ckdxx == null)
|
||
{
|
||
out.println("<tr><td colspan=2><font color=red>出库单 " + ckdh + " 不存在,或已被审核</font>");
|
||
return;
|
||
}
|
||
out.write("<tr><td>申请编号:</td><td>" + ckdxx.get("sqbh"));
|
||
if (zlh != null)
|
||
{
|
||
ckdxx = db1.getSingleRow("SELECT cksl-smqrs wssl,cksl,kcsl,smqrs smsl FROM ckzl WHERE zlbh=? AND hkzt<=2", zlh);
|
||
if (ckdxx == null)
|
||
{
|
||
out.println("<tr><td colspan=2><font color=red>出库指令 " + zlh + " 不存在,或完成回库</font>");
|
||
return;
|
||
}
|
||
}
|
||
|
||
String cnt = (String)ckdxx.get("smsl");//扫入表计条码的个数
|
||
out.write("<tr bgcolor=yellow><td colspan=2>");
|
||
out.write("请扫描实领表计的条码(也可输出厂编号),<br>或整箱出库时的箱条码或整托盘出库时托盘条码");
|
||
out.write("<tr><td colspan=2 id=count total=" + cnt + ">已扫描表计数:");
|
||
out.write(cnt);
|
||
|
||
out.write("<tr><td>最近扫描<br> 条 码:</td>");
|
||
out.write("<td><input id=\"jh\" class=label type=text name=jh size=27 disabled=true></td></tr>");
|
||
|
||
out.println("<tr><td width=60>条 码:<td><input name=barcode class=barcode size=27 maxlength=40>");
|
||
out.write("<input id=\"jhs\" type=hidden name=jhs value=\"");
|
||
out.write("\">");
|
||
|
||
//显示待出数量,出库库位和托盘编号
|
||
if (zlh != null)
|
||
{
|
||
String wssl = (String)ckdxx.get("wssl");
|
||
out.write("<tr><td>未扫数量:<td><label id=wssl>");
|
||
out.write(wssl);
|
||
out.write("</label> <input type=checkbox name=qxsm>取消扫描</td>");
|
||
out.write("<tr><td>出库库位:<td id=ckkw>");
|
||
out.write(ckkw);
|
||
out.println("<tr><td>出库托盘:<td id=tpbh>");
|
||
out.write(tpbh);
|
||
// 应该查询数据库,再次查看是否已经取出。因为考虑到用户使用浏览器的刷新功能
|
||
if (db1.hasAnyData("SELECT 2 FROM ckzl A JOIN kwxx B ON A.ckdm=B.ckdm AND A.kwbh=B.kwbh"
|
||
+ " WHERE A.zlbh=? AND A.qczt<2 AND B.xnkw=0",
|
||
zlh))
|
||
{
|
||
out.write("<input name=cmdQctp type=button value=取出托盘 onclick=\"qctp('" + zlh + "','" + ckkw + "','" + tpbh + "');\">");
|
||
}
|
||
}
|
||
else
|
||
{//显示整张出库单扫描数量同已安排出库数量差
|
||
String wssl = (String)ckdxx.get("wssl");
|
||
out.write("<tr><td>未扫数量:<td><label id=wssl>");
|
||
out.write(wssl);
|
||
//out.println("<tr><td>安排数量:<td>");
|
||
//out.write((String)ckdxx.get("yapsl"));
|
||
out.println("<tr><td>请领数量:<td>");
|
||
out.write((String)ckdxx.get("cksl"));
|
||
}
|
||
out.println("<tr><td/><td><input name=submit type=submit value=\"提 交\">");
|
||
//out.write("<td><input name=cmdSave type=button value=立即保存 onclick=\"save();\">");
|
||
}
|
||
%>
|
||
</table>
|
||
</form>
|
||
</body>
|
||
</html> |