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

📄 item_add.jsp

📁 java大型企业DRP系统源码带sql数据库
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<%@ page errorPage="../error.jsp" %>       
<%@ page import="java.util.*" %> 
<%@ page import="com.bjsxt.drp.basedata.manager.*" %>
<%@ page import="com.bjsxt.drp.basedata.model.*" %>
<%@ page import="com.bjsxt.drp.util.datadict.*" %>
<%@ page import="com.bjsxt.drp.util.*" %>  
<%
  	List itemCategoryList = DataDictManager.getInstance().getItemCategoryList();
  	List itemUnitList = DataDictManager.getInstance().getItemUnitList();
  	String command = request.getParameter("command");
  	if (command != null && command.equals("add")) {
  		String itemNo = request.getParameter("itemNo");
  		String itemName = request.getParameter("itemName");
  		String spec = request.getParameter("spec");
  		String pattern = request.getParameter("pattern");
  		String category = request.getParameter("category");
  		String unit = request.getParameter("unit");
  		Item item = new Item();
  		item.setItemNo(itemNo);
  		item.setItemName(itemName);
  		item.setSpec(spec);
  		item.setPattern(pattern);
  		ItemCategory itemCategory = new ItemCategory();
  		itemCategory.setId(category);
  		item.setCategory(itemCategory);
  		ItemUnit itemUnit = new ItemUnit();
  		itemUnit.setId(unit);
  		item.setUnit(itemUnit);
  		ItemManager.getInstance().addItem(item);
  		out.println("提示:添加物料成功!");
  	}
  %>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>添加物料</title>
<link rel="stylesheet" href="../style/drp.css">
<script src="../script/client_validate.js"></script>
<script type="text/javascript">
	
	function addItem() {
		if (trim(document.getElementById("itemNo").value) == "") {
			alert("物料代码不能为空!");
			document.getElementById("itemNo").focus();
			return;
		} 
	
		if (trim(document.getElementById("itemName").value) == "") {
			alert("物料名称不能为空!");
			document.getElementById("itemName").focus();
			return;
		}
		with (document.getElementById("itemForm")) {
			method = "post";
			action = "item_add.jsp?command=add";
			submit();
		}
	}
	
	function goBack() {
		window.self.location = "item_maint.jsp";
	}
	
	
</script>
</head>

<body  class="body1">
<form  name="itemForm" target="_self" id="itemForm">
  <div align="center"> 
    <table width="95%" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="95%" border="0" cellspacing="0" cellpadding="0" height="25">
    <tr> 
        <td width="522" class="p1" height="25" nowrap><img src="../images/mark_arrow_03.gif" width="14" height="14">&nbsp;<b>基础数据管理&gt;&gt;物料维护&gt;&gt;添加</b></td>
    </tr>
  </table>
    <hr width="97%" align="center" size=0>
    <table width="95%" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="22%" height="29"> <div align="right"><font color="#FF0000">*</font>物料代码:&nbsp; 
          </div></td>
        <td width="78%"><input name="itemNo" type="text"  class="text1" id="itemNo" size="10" maxlength="10"></td>
      </tr>
      <tr> 
        <td height="26"><div align="right"><font color="#FF0000">*</font>物料名称:&nbsp;</div></td>
        <td><input name="itemName" type="text"  class="text1" id="itemName" size="20" maxlength="20"></td>
      </tr>
      <tr> 
        <td height="26"><div align="right">物料规格:&nbsp;</div></td>
        <td><label>
          <input name="spec" type="text"  class="text1" id="spec" size="20" maxlength="20">
        </label></td>
      </tr>
      <tr> 
        <td height="26"> <div align="right">物料型号:&nbsp;</div></td>
        <td><input name="pattern" type="text"  class="text1" id="pattern" size="20" maxlength="20">        </td>
      </tr>
      <tr>
        <td height="26"><div align="right"><font color="#FF0000">*</font>类别:&nbsp;</div></td>
        <td><select name="category" class="select1" id="category">
        <%
        	for (Iterator iter = itemCategoryList.iterator(); iter.hasNext();) {
        	ItemCategory ic = (ItemCategory)iter.next();
        %>
            <option value="<%=ic.getId() %>"><%=ic.getName() %></option>
        <%
        	}
         %>    
        </select></td>
      </tr>
      <tr>
        <td height="26"><div align="right"><font color="#FF0000">*</font>计量单位:&nbsp;</div></td>
        <td><select name="unit" class="select1" id="unit">
        <%
        	for (Iterator iter = itemUnitList.iterator(); iter.hasNext();) {
        		ItemUnit iu = (ItemUnit)iter.next();
         %>
            <option value="<%=iu.getId() %>"><%=iu.getName() %></option>
		<%
			}
		 %>
        </select></td>
      </tr>
    </table>
    <hr width="97%" align="center" size=0>
    <div align="center">
      <input name="btnAdd" class="button1" type="button" id="btnAdd" value="添加" onclick="addItem()" >
      &nbsp;&nbsp;&nbsp;&nbsp; 
      <input name="" class="button1" type="button" id="btnBack" value="返回"  onClick="goBack()">
    </div>
  </div>
</form>
</body>
</html>

⌨️ 快捷键说明

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