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

📄 allocatproductinsert.jsp

📁 (Java+SQL)-大型企业JAVA的ERP系统
💻 JSP
字号:
<jsp:useBean id="account" class="src.wuyang.Account" scope="page"/>
<jsp:useBean id="AllocatProduct" class="src.wuyang.AllocatProduct" scope="page"/>
<jsp:useBean id="product" class="src.wuyang.Production" scope="page"/>
<jsp:useBean id="global" class="src.com.MyGlobal" scope="session"/>

<% if (global.isLogined == false) {
%>
<jsp:forward page="../pub/DBErr.jsp" > 
	<jsp:param name="rtcode" value="-4" />
</jsp:forward>
<%	}
%>


<%! String allocatId;%> 
<%! int productNum;%>
<%
	allocatId = request.getParameter("allocatId");
	String pack[] = {"带包装","净水"};
	
	productNum=AllocatProduct.query("allocatId='"+allocatId+"'","");
%>
<html>
<head>
<link rel="stylesheet" href="css.css" type="text/css">
<script language ="javascript" src='../pub/pub.js' type=text/javascript></script>
</head>

<script language="JavaScript">
function AddProduct() {
	open("ProductId.jsp","ProductList","scrollbars=yes,width=250,height=200")
	}

function VerifyInput(e)
	{
	if(noFloat(e.quantity.value))
		{    
		alert("输入数据无效");
		e.quantity.focus();  
		return false;
		}  
	if(noFloat(e.unitPrice.value))	
		{    
		alert("输入数据无效");
		e.unitPrice.focus();  
		return false;
		}  	
	}
</script>

<body bgcolor=#949b93>
<table width="104%" border="1" height="90%" bordercolorlight="#616860" bordercolordark="#CCCCCC" bgcolor="#4c7171" cellpadding="0" cellspacing="0">
  <tr> 
    <td valign="top"><br>
        <b class="textb"><span class="textb">申请单编号: </span></b><span class="textb"><%=allocatId%></span><br>

        <table width="100%" border="1" bordercolorlight="#000000" bordercolordark="#CCCCCC" cellpadding="0" cellspacing="0">
          <tr bgcolor="#949b93"> 
            <td class="text"> 
              <div align="center"><b>产品编号</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>产品名称</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>规格/型号</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>产地</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>数量</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>单价</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>包装</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>总金额</b></div>
            </td>
            <td class="text"> 
              <div align="center"><b>&nbsp;</b></div>
            </td>
            <td class="text"> 
              <div align="center" class="text"><b>&nbsp;&nbsp; </b></div>
            </td>
          </tr>
          <%
float totalPrice=0;
AllocatProduct.next();
System.out.println("OK!!");
for(int i=0;i<productNum;i++) 
    {
%> 
          <form method="post" name="AllocatProduct" action="UpdateAllocatProduct.jsp?allocatId=<%= allocatId %>&pageName=<%=request.getParameter("pageName")%>
            " onsubmit="return VerifyInput(this);" > 
            <input type="hidden"  name="allocatId" value="<%=allocatId%>" >
            <tr> 
              <td class="textb"> 
                <input type="hidden"  name="productId" value="<%=AllocatProduct.getProductId()%>" >
                <%=AllocatProduct.getProductId()%> </td>
              <%     	product.load(AllocatProduct.getProductId());
%> 
              <td class="textb"><%=product.getProductName()%>&nbsp;</td>
              <td class="textb"><%=product.getProductDesc()%>&nbsp;</td>
              <td class="textb"> 
                <input type="text"  name="productAdd" value="<%=AllocatProduct.getProductAdd()%>" size="8" >
              </td>
              <td class="textb" > 
                <input type="text"  name="quantity" value="<%=AllocatProduct.doubleFormat(AllocatProduct.getQuantity(),2)%>" size="8" maxlength="12">
              </td>
              <td class="textb" > 
                <input type="text"  name="unitPrice" value="<%=AllocatProduct.doubleFormat(AllocatProduct.getUnitPrice(),2)%>" size="8" maxlength="12" >
              </td>
              <td class="textb" > 
                <select name="pack">
                  <% for(int j=0;j<2;j++) { %> 
                  <option value="<%=j%>" <% if(AllocatProduct.getPack()==j){%> selected <%}%>><%=pack[j]%></option>
                  <%}%> 
                </select>
              </td>
              <td class="textb" >
<%   float subPrice=AllocatProduct.getUnitPrice()*AllocatProduct.getQuantity();
%> 
		<%=AllocatProduct.doubleFormat(subPrice,2)%> </td>
              <td class="textb"> 
                <input type="submit" name="update"  value="修改"  />
              </td>
              <td class="textb"> 
                <input type="submit" name="delete" value="删除" />
              </td>
            </tr>
          </form>
          <%
    AllocatProduct.next();
    totalPrice = totalPrice + subPrice;
    }
%> 
          <form method="post" name="insert" action="UpdateAllocatProduct.jsp?allocatId=<%= allocatId %>&pageName=<%=request.getParameter("pageName")%>
            " onsubmit="return VerifyInput(this);" > 
            <input type="hidden"  name="allocatId" value="<%=allocatId%>" >
            <tr> 
              <td class="textb"> 
                <input type="text"  name="productId" value="" size="10" maxlength="10" ><input type="button" value=">>" onclick="AddProduct()"/>
              </td>
              <td class="textb">&nbsp; </td>
              <td class="textb">&nbsp; </td>
              <td class="textb"> 
                <input type="text"  name="productAdd" size="8" >
              </td>
              <td class="textb"> 
                <input type="text"  name="quantity" value="" size="8" maxlength="12" >
              </td>
              <td class="textb"> 
                <input type="text"  name="unitPrice" value="" size="8" maxlength="12" >
              </td>
              <td class="textb" > 
                <select name="pack">
                  <% for(int j=0;j<2;j++) { %> 
                  <option value="<%=j%>" <% if(AllocatProduct.getPack()==j){%> selected <%}%>><%=pack[j]%></option>
                  <%}%> 
                </select>
              </td>
              <td class="textb"><%=AllocatProduct.doubleFormat(totalPrice,2)%></td>
              <td class="textb"> 
                <input type="submit" name="insert" value="增加" >
              </td>
              <td class="textb">&nbsp; </td>
          </form>
        </table>
    <form method="post" name="AllocatProduct0" action="<%=request.getParameter("pageName")%>" >
          <div align="center">
            <input type="submit" name="return" value="返回" >
          </div>
        </form>
</td>
</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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