⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modwinfo--.jsp

📁 这是一个简单但是很实用的JSP应用实例
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.lang.*,java.text.*,java.util.*,java.io.*" %>
<%@include file="/db/dbPool.inc"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/lib/main.css" rel="stylesheet" type="text/css">
<title>修改工位信息</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 3px;
	margin-right: 3px;
	margin-bottom: 3px;
}
.style1 {color: #FF0000}
-->
</style>
</head>
<script src="/lib/jsFunc.js"></script>
<script src="/office/lib/strfunc.js"></script>
<script language="javascript">
function delSel()
{
	if(confirm("你确定要删除所有选定的零部件吗?"))
	{
		document.fm.isDel.value='true';
		return true;
	}else {
		document.fm.isDel.value='false';
		return false;
	}	
}

function isNum(num)
{
    if(num=="")
        return false;
	for(i=0;i<num.length;i++)
	{
	    if(num.charAt(i)<"0"||num.charAt(i)>"9")
		    return false;
	}
	return true;
}

function checkFm()
{
with(document.fm)
	{
     if(!isNum(tmp_busyNum.value))
	   {
		alert("忙临界值不能为空且只能为数字!");
		tmp_busyNum.value="";
		tmp_busyNum.focus();
		return false;
	 }    
	if(tmp_busyNum.value>255)
	{
		alert("忙临界值不能大于255!");
		tmp_busyNum.value="";
		tmp_busyNum.focus();
		return false;
	}
	if(trim(oInstr.value)=="")
	{
		alert("装配要点不能为空!");
		oInstr.value="";
		oInstr.focus();
		return false;
	}
	if(oInstr.value.length>90)
	{
		alert("装配要点不能超过45个字!");
		oInstr.focus();
		return false;	
	}
	else if(confirm("您确定要修改该信息吗?"))
	{
			fm.action='handle_mod.jsp';
			fm.submit();
	}
  }
}
</script>

<jsp:useBean id="queryBean" scope="page" class="Query.Query"/>
<jsp:useBean id="pageList" scope="session" class="myLib.PageList" />
<%
	String bID="",wID="",sID="",wName="",tmp_busyNum="",oInstr="",picName="",pID="",bInfo="",schID="",downPic="";
	bID=request.getParameter("bID");
	wID=request.getParameter("wID");
	sID=request.getParameter("sID");
	wName=request.getParameter("wName");
	tmp_busyNum=request.getParameter("tmp_busyNum");
	oInstr=request.getParameter("oInstr");
	picName=request.getParameter("picName");
	pID=request.getParameter("pID");
	bInfo=bID+":"+wID+":"+sID+":"+wName+":"+tmp_busyNum+":"+oInstr+":"+picName+":"+pID;// 工位计划表中批次信息
	oInstr=oInstr.replaceAll("\\\\n","&nbsp;");
/******************删除信息**********************/
	queryBean.initialize(conn1);
	if(request.getParameter("isDel")!=null&&request.getParameter("isDel").equals("true")){
		String selInfoID[]=request.getParameterValues("gid");
	    CallableStatement stmt=conn1.prepareCall("{call p_delwBOM(?,?,?,?,?,?)}");
		try{
              //Statement stmt=conn1.createStatement();
			for(int i=0;i<selInfoID.length;i++){
				stmt.setString(1,bID);
				stmt.setString(2,sID);
				stmt.setString(3,wID);
				stmt.setString(4,pID);
				stmt.setString(5,picName);
				stmt.setString(6,selInfoID[i]);
				stmt.executeUpdate();
			  //stmt.executeUpdate("exec p_delwBOM '"+bID+"','"+sID+"','"+wID+"','"+pID+"','"+selInfoID[i]+"'");
		   }
		}catch(Exception e){
			System.out.println("Error Code is:"+e.getMessage());
		}  
	}
%>
<BODY style="background-color:#FFFFFF " text="000000" link="000099"  vlink="000099" alink="ff0000" bgcolor="#FFFFFF">
<form name="fm" method="post" action="modwInfo.jsp">
<input type="hidden" id="isDel" name="isDel" value="false">  
<input type="hidden" name="bID" value="<%=bID%>">
<input type="hidden" name="sID" value="<%=sID%>">
<input type="hidden" name="wID" value="<%=wID%>">
<input type="hidden" name="wName" value="<%=wName%>">
<input type="hidden" name="pID" value="<%=pID%>">
<input type="hidden" name="picName" value="<%=picName%>">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="#">【</a><a href="../schManage/index.jsp"><strong>生产计划管理</strong></a>→<a href="bList.jsp"><font color="#FF0000">生产计划确认</font></a>→修改工位信息】</td>
	<td width=50 align="center">&nbsp;</td>
  </tr>  
</table>
<br>
<table width="100%" border="0" cellpadding="3" cellspacing="0"  align="center" bordercolor="#cccccc">
  <tr>
    <td height="23" colspan="4">【<strong>修改工位信息</strong>】(其中<span class="style1">*</span>为必填项,选择均为单选)</td>
  </tr>
  <tr>
    <td width="82" align="right">工位编码:</td>
	<td width="670" colspan="3" align="left"><%=wID%></td>
  </tr>
  <tr>
	<td width="82" align="right">工位名称:</td>
	<td colspan="3"><font color="#FF0000"><%=wName%></font></td>
  </tr> 
<tr>
	<td width="82" align="right">忙临界值:</td>
	<td colspan="3">
	  <input name="tmp_busyNum" type="text" class="border1pixel" value="<%=tmp_busyNum%>" size="30">
	  &nbsp;<font color="#FF0000">*</font>
	</td>
  </tr>
 <tr>
	<td width="82" align="right">装配要点:</td>
	<td colspan="3">
	  <input name="oInstr" type="text" class="border1pixel" value="<%=oInstr%>" size="80">
	  &nbsp;<font color="#FF0000">*</font>
(45个字以内)	</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="0"  align="center" bordercolor="#cccccc">
<tr>
  <td align="center">&nbsp;</td>
    <td width="344" align="right">
      <input type="button" style="width:80 " onClick="OpenTipsWin('addPart.jsp?bInfo=<%=bInfo%>','',680,620,-1,-1,'scrollbars,resizable');return false;" onMouseOut="this.style.color='000000'" onMouseOver="this.style.color='FF0000'" class="logonBtn" value="添加零部件">
      <input type="button" name="delBtn" disabled style="width:80" onClick="if(delSel()) document.fm.submit();" onMouseOut="this.style.color='000000'" onMouseOver="this.style.color='FF0000'" class="logonBtn" value="删除零部件 ">
      <input type="button"  class="logonBtn" style="width:70 " onClick="checkFm();"  onMouseOut="this.style.color='000000'" onMouseOver="this.style.color='FF0000'" value="修改提交">   </td>  
 </tr>
</table>
<%
    ResultSet rs=null;
	String sql="";
	if(!picName.equals("-")){
		rs=queryBean.executeQuery("select picName from partsInfo where pID='"+picName+"'");
		if(rs.next())
			downPic=rs.getString("picName");//需下发图片
	}	
	pageList.Init(15,request);//分页初始化
	//sql="select wBOM.pID,wBOM.pName,partsInfo.picName from wBOM,partsInfo where sID='"+sID+"' and wBOM.wID='"+wID+"' and wBOM.pID!='' and wBOM.pID=partsInfo.pID";
	sql="select pID,pName,picName from vwBOM_partsInfo where sID='"+sID+"' and wID='"+wID+"'";
	//sql=pageList.setOrderBy(sql,"wBOM.pID","desc");
	sql=pageList.setOrderBy(sql,"pID","desc");
	rs=queryBean.executeQuery(sql);
	int recordCount=0;
	if(rs.last())
		recordCount=rs.getRow();
	else
		recordCount=0;
%>
<table width="100%" border="1" cellpadding="3" cellspacing="0"  align="center" bordercolor="#cccccc">
  <tr bgcolor="#efefef"  class="OfficeTitTd" >
    <td width="30" height="26"  align="center"><input name="selAll" <% if(recordCount==0)  out.print(" disabled "); %> type="checkbox" id="selAll" value="checkbox" onClick="chkAll(this,'gid');setDelBtn(gid);setCopyBtn(gid);">
    </td>
    <td width="130" align="center"><strong><%=pageList.setSortTit("pID","零部件编码","按零部件编码排序","#000099")%></strong></td>
    <td width="233" align="center"><strong><%=pageList.setSortTit("pName","零部件编码","按零部件名称排序","#000099")%></strong></td>
    <td width="112" align="center"><strong>是否有图片</strong></td>
    <td width="93" align="center"><strong>是否下发图片</strong></td>
    <td width="97" align="center"><strong>是否需要比对</strong></td>
  </tr>
<%if(recordCount==0) {%>
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="8" align="center" class="tdBottom"><b><font color="#FF0000">没有零部件信息 </font></b></td>
  </tr>
 <%
	}else{
        String tmp_picName="";
        String tmp_pID="";	
        String pName="";	
        String hasPic="";	
        String isSend="";
        String isComp="";
        String flag="";	
	    rs.beforeFirst();
		while(rs.next()){
			isSend="否";
			isComp="否";
			flag="无";
			tmp_pID=rs.getString("pID");
			pName=rs.getString("pName");
            tmp_picName=rs.getString("picName");
			hasPic="无<a href='../pConfirm/uploadPic.jsp?pID="+tmp_pID+"&pName="+pName+"&bInfo="+bInfo+"'>(上传)</a>";

			if(!pID.equals("-")&&tmp_pID.equals(pID))   isComp="是"; 
			if(tmp_picName!=null&&!tmp_picName.equals(""))
		    {
			  flag="有"; 
			  hasPic="有<a href='../pConfirm/picCheck.jsp?pID="+tmp_pID+"'>(查看)</a>";
			  if(!picName.equals("-")&&tmp_picName.equals(downPic)) isSend="是";
		    }
%>
<tr id="RowItem<%=tmp_pID%>" class="SelRowItem" bgcolor="#FFFFFF" height="23" > 
    <td width="30" height="26"  align="center"><input name="gid" type="checkbox" id="gid" value="<%=tmp_pID%>" onClick="setDelBtn(gid);setCopyBtn(gid);"> </td>
    <td align="left"><%=tmp_pID%></td>
    <td align="left"><%if(flag.equals("有")) out.print("<img src='../../../img/img.gif' width='12' height='12'>");%>&nbsp;<%=pName%></td>
	<td align="center"><%=hasPic%></td>
    <td align="center"><input type="radio" name="isSend" value="<%=tmp_pID%>" onClick="return false;" onMouseUp="this.checked=!this.checked" <% if(flag.equals("无")) out.println("disabled"); else if(isSend.equals("是")) out.println("checked"); %>></td>
    <td align="center"><input type="radio" name="isComp" value="<%=tmp_pID%>" onClick="return false;" onMouseUp="this.checked=!this.checked" <% if(isComp.equals("是")) out.println("checked");%>></td>
  </tr>
<%     
		}}
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr> <td colspan="6" align="right" height="30">
<a href="#">*返回顶部*</a>&nbsp;&nbsp;</td></tr></table>

</form>
</body>
</html>
<%@ include file="/db/dbpoolEnd.inc" %>
<script src="/lib/jsFooter.js"></script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -