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

📄 oa_car_informationadd.jsp

📁 java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理,角色管理,权限) 2.工作流管理 (流程类别,流程) 3.字典管理 (国家,省份,城市,公共数据字典) 4.项目
💻 JSP
字号:
<%@ include file="../../include/configuration.jsp"%>
<%@ page import="com.vere.oa.car.bean.*"%>
<%@ page import="com.vere.oa.car.item.*"%>
<%@ page contentType="text/html; charset=gb2312" %>
<%
	ParameterUtils.setCharacterEncoding(request);
	String status=ParameterUtils.getString(request,"status");
	String message="";
	//添加
	if(status.equals("add"))
	{
		message=ParameterUtils.getString(request,"message");
		String car_no=ParameterUtils.getString(request,"car_no");//车牌号
		String brand=ParameterUtils.getString(request,"brand");//品牌
		String model=ParameterUtils.getString(request,"model");//型号
		String color=ParameterUtils.getString(request,"color");//颜色
		String buy_date=ParameterUtils.getString(request,"buy_date");//购买日期
		String valid_time=ParameterUtils.getString(request,"valid_time");//有效期
		String price=ParameterUtils.getString(request,"price");//购买价格
		String supplier=ParameterUtils.getString(request,"supplier");//供应商
		String supply_contact=ParameterUtils.getString(request,"supply_contact");//供应联系人
		String supply_telephone=ParameterUtils.getString(request,"supply_telephone");//供应联系电话
		String maintain_site=ParameterUtils.getString(request,"maintain_site");//维修站
		String maintain_contact=ParameterUtils.getString(request,"maintain_contact");//维修联系人
		String maintain_telephone=ParameterUtils.getString(request,"maintain_telephone");//维修联系电话
		String pilot=ParameterUtils.getString(request,"pilot");//驾驶员
		String memo=ParameterUtils.getString(request,"memo");//备注
		String discard_time=ParameterUtils.getString(request,"discard_time");//报废日期
		String car_status="0";//状态
		if(car_no==null||car_no.equals("")){
			out.print("car_no 车牌号不能为空");
			return;
		}
		if(brand==null||brand.equals("")){
			out.print("brand 品牌不能为空");
			return;
		}
		if(buy_date==null||!Check.isDateTime(buy_date)){
			out.print("buy_date 购买日期只能是短日期,形如 (2003-12-05)");
			return;
		}
		if(valid_time==null||!Check.isDateTime(valid_time)){
			out.print("valid_time 有效期只能是短日期,形如 (2003-12-05)");
			return;
		}
		if(price==null||!Check.isFloat(price)){
			out.print("price 购买价格必须为浮点数字");
			return;
		}
		if(pilot==null||pilot.equals("")){
			out.print("pilot 驾驶员不能为空");
			return;
		}

		Oa_car_informationItem item=new Oa_car_informationItem();
		item.setCar_no(car_no);
		item.setBrand(brand);
		item.setModel(model);
		item.setColor(color);
		item.setBuy_date(buy_date);
		item.setValid_time(valid_time);
		item.setPrice(price);
		item.setSupplier(supplier);
		item.setSupply_contact(supply_contact);
		item.setSupply_telephone(supply_telephone);
		item.setMaintain_site(maintain_site);
		item.setMaintain_contact(maintain_contact);
		item.setMaintain_telephone(maintain_telephone);
		item.setPilot(pilot);
		item.setMemo(memo);
		item.setDiscard_time(discard_time);
		item.setStatus(car_status);
		Oa_car_informationBean bean=new Oa_car_informationBean();
		bean.addItem(item);
	}
%>
<html>
<head>
<title><%=titleName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../js/check.js"></script>
<link href="../../css/date.css" rel="stylesheet" type="text/css">
<script src="../../js/ShowDate.js"></script>
<script language="javascript">
    init();
</script>
</head>
<script language="javascript">
	function back()
	{
		location="oa_car_information.jsp";
	}

	function Check()
	{
		var form=form1;
		if(form.car_no.value=="")
		{
			alert("请输入车牌号!");
			form.car_no.focus();
			return;
		}
		if(form.brand.value=="")
		{
			alert("请输入品牌!");
			form.brand.focus();
			return;
		}
		if(!isDateTime(form.buy_date.value))
		{
			alert("购买日期只能是短日期,形如 (2003-12-05)!");
			form.buy_date.focus();
			return;
		}
		if(!isDateTime(form.valid_time.value))
		{
			alert("有效期只能是短日期,形如 (2003-12-05)!");
			form.valid_time.focus();
			return;
		}
		if(!isFloat(form.price.value))
		{
			alert("购买价格必须为浮点数字!");
			form.price.focus();
			return;
		}
		if(form.pilot.value=="")
		{
			alert("请输入驾驶员!");
			form.pilot.focus();
			return;
		}

		form.status.value="add";
		form.message.value=1;
		form.submit();
	}
</script>
<body>
<form action=""  method="post"  name="form1" >
	<table class="firsttable">
		<tr>
			<td align="center" valign="top">
				<table class="centertable">
					<tr>
						<td></td>
					</tr>
					<tr>
						<td align="center" class="addborder">
							<table  class="addTable">
								<tr align="center" >
									<td colspan="2">
                  						<font  class="message">
										<%
											if(message.equals("1"))
											{
												out.println("添加成功:继续");
											}
										%>
										</font>									</td>
								</tr>
								<tr >
									<td >车牌号:</td>
									<td ><input name="car_no" type="text" id="car_no" ></td>
								</tr>
								<tr >
									<td >品牌:</td>
									<td ><input name="brand" type="text" id="brand" ></td>
								</tr>
								<tr >
									<td >型号:</td>
									<td ><input name="model" type="text" id="model" ></td>
								</tr>
								<tr >
									<td >颜色:</td>
									<td ><input name="color" type="text" id="color" ></td>
								</tr>
								<tr >
									<td >购买日期:</td>
									<td >
									<input name="buy_date" type="text"  size="10" ><a href="javascript:" onClick="show_cele_date(buy_date,'','',buy_date)"><img src='../../icon/cal.gif' border=0></a>									</td>
								</tr>
								<tr >
									<td >有效期:</td>
									<td >
									<input name="valid_time" type="text"  size="10" ><a href="javascript:" onClick="show_cele_date(valid_time,'','',valid_time)"><img src='../../icon/cal.gif' border=0></a>									</td>
								</tr>
								<tr >
									<td >购买价格:</td>
									<td ><input name="price" type="text" id="price" ></td>
								</tr>
								<tr >
									<td >供应商:</td>
									<td ><input name="supplier" type="text" id="supplier" ></td>
								</tr>
								<tr >
									<td >供应联系人:</td>
									<td ><input name="supply_contact" type="text" id="supply_contact" ></td>
								</tr>
								<tr >
									<td >供应联系电话:</td>
									<td ><input name="supply_telephone" type="text" id="supply_telephone" ></td>
								</tr>
								<tr >
									<td >维修站:</td>
									<td ><input name="maintain_site" type="text" id="maintain_site" ></td>
								</tr>
								<tr >
									<td >维修联系人:</td>
									<td ><input name="maintain_contact" type="text" id="maintain_contact" ></td>
								</tr>
								<tr >
									<td >维修联系电话:</td>
									<td ><input name="maintain_telephone" type="text" id="maintain_telephone" ></td>
								</tr>
								<tr >
									<td >驾驶员:</td>
									<td >
									<select name="pilot" id="pilot">
									<%
										Oa_car_pilotBean oa_car_pilotBean=new Oa_car_pilotBean();
										List oa_car_pilotList=oa_car_pilotBean.find();
										Iterator oa_car_pilotE=oa_car_pilotList.iterator();
										while(oa_car_pilotE.hasNext()){
											Oa_car_pilotItem oa_car_pilotItem=(Oa_car_pilotItem)oa_car_pilotE.next();
											if(ParameterUtils.getString(request,"pilot").equals(oa_car_pilotItem.getId()))
												out.println("<option value='"+oa_car_pilotItem.getId()+"' selected>"+oa_car_pilotItem.getName()+"</option>");
											else
												out.println("<option value='"+oa_car_pilotItem.getId()+"' >"+oa_car_pilotItem.getName()+"</option>");
										}
									%>
									</select>									</td>
								</tr>
								<tr >
									<td  width=100>备注:</td>
									<td ><textarea name="memo" cols="70" rows="10" id="memo"></textarea></td>
								</tr>
								
								<tr >
									<td colspan="2" align="center">
										<input name="Button" type="button" class="button" onClick="Check()" value="确定">
										&nbsp;&nbsp;&nbsp;&nbsp;
										<input name="Submit2" type="button" class="button" onClick="back()" value="返回">									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td></td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<input type="hidden" name="status" >
<input type="hidden" name="message" >
</form>
</body>
</html>

⌨️ 快捷键说明

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