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

📄 standards_add.jsp

📁 人力资源管理系统
💻 JSP
字号:
<%@ page language="java" pageEncoding="GBK"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<html>
  <head>
    <base href="http://localhost:8080/accp_hr/">
    <title>薪酬标准添加页面</title>
	<script type="text/javascript" src="js/DateTime2.js"></script>
	<script src="js/formcheck/jquery_last.js" type="text/javascript"></script>
	<link type="text/css" rel="stylesheet" href="css/validator2.css"></link>
	<script src="js/formcheck/formValidator.js" type="text/javascript" ></script>
	<script src="js/formcheck/formValidatorRegex.js" type="text/javascript"></script>
	<script language="javascript" src="js/formcheck/DateTimeMask.js" type="text/javascript"></script>

  </head>
  
  <body bgcolor="#DADEDD" style="background-image: url('images/accphr/main.jpg');background-attachment :fixed ;">
    <center>薪酬标准</center>
    <br>
    <html:form action="standards" styleId="form1" >
    <input type="hidden" name="ops" value="doAdd" >
    <table align="center" border="0" width="100%">
    	<tr>
    		<td><input type="button" value="查询" ></td>
    	</tr>
    	<tr>
    		<td>
				<table border="1" cellspacing="0" align="center" width="90%" bordercolor="black" style="font-size: 12px">
    				<tr>
    					<th>薪酬标准单编号</th>
    					<td width="75%"><html:text property="standards.standardId" readonly="true"></html:text> </td>
    				</tr>
    				<tr>
    					<th>薪酬标准单名称</th>
    					<td><html:text property="standards.standardName" styleId="name1"></html:text> <span id="name1Tip" style="width:150px"></span></td>
    				</tr>
    				<tr>
    					<th>制定者名字</th>
    					<td><html:text property="standards.designer" styleId="name2"></html:text> <span id="name2Tip" style="width:150px"></td>
    				</tr>
    				<tr>
    					<th>登记人</th>
    					<td><html:text property="standards.register" styleId="name3"></html:text> <span id="name3Tip" style="width:150px"></td>
    					
    				</tr>
    				<tr>
    					<th>登记时间</th>
    					<td><input type="text" name="times" id="currentTime" readonly="readonly"></td>
    				</tr>
    				
    				<tr>
    					<th>薪酬总额</th>
    					<td><html:text property="standards.salarySum" readonly="true" styleId="amounts" value="0.00"></html:text> </td>
    				</tr>
    				
    				<tr>
    					<th>备注</th>
    					<td><html:textarea property="standards.remark" rows="3"></html:textarea></td>
    				</tr>
    			</table>
    		</td>
    	<tr>
    		<td>
    			<table border="1" align="center"  cellspacing="0" width="90%" bordercolor="black" style="font-size: 12px">
    				<logic:iterate id="item" name="sublist" indexId="i">
    					<tr>
    						<th>${item.attributeName }</th>
    						<td width="75%"><input type="text" name="subs" value="0.00" id="ones${i }" onblur="jisuan('one${i }');" > 
    							<span id="one${i }" style="width:150px"></span>
    						</td>
    					</tr>
    				</logic:iterate>
    			</table>
    			
    		</td>
    	</tr>
    	<tr>
    		<td align="center"><html:submit value="提交" onclick="return tijiao();" /> <html:reset value="重置" /> </td>
    	</tr>
    </table>
    </html:form>
  </body>
</html>

	<script type="text/javascript">
		$(document).ready(function(){
			$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)}});
			//验证名称不能为空
			$("#name1").formValidator({onshow:"请输入名称",onfocus:"名称不能为空",oncorrect:"通过"}).
				inputValidator({min:1,empty:{leftempty:false,rightempty:false,
				emptyerror:"名称两边不能有空符号"},onerror:"名称不能为空,请输入"});
			//验证 制定者名字不能为空
			$("#name2").formValidator({onshow:"请输入制定者名字",onfocus:"名称不能为空",oncorrect:"通过"}).
				inputValidator({min:1,empty:{leftempty:false,rightempty:false,
				emptyerror:"名字两边不能有空符号"},onerror:"制定者名字不能为空"});
			//验证登记人不能为空
			$("#name3").formValidator({onshow:"请输入登记人",onfocus:"登记人不能为空",oncorrect:"通过"}).
				inputValidator({min:1,empty:{leftempty:false,rightempty:false,
				emptyerror:"名字两边不能有空符号"},onerror:"名子不能为空,请输入"});	
			
		});
		
		//验证薪酬金额
		function jisuan(){
			var my_array = new Array();
			var sums=0;
			var my_array=document.getElementsByName("subs");
			for(var i=0;i<my_array.length;i++){
				if(isNaN(my_array[i].value))
				{
					document.getElementById("one"+i).innerHTML="请输入正确的金额!";
					document.getElementById("ones"+i).focus();
					return false;
				}
				if(!isNaN(my_array[i].value)){
					if(parseFloat(my_array[i].value)>=0){
						document.getElementById("one"+i).innerHTML="";
						sums+=parseFloat(my_array[i].value);
					}
					else{
						document.getElementById("one"+i).innerHTML="请输入正确的金额!";
						document.getElementById("ones"+i).focus();
						return false;
					}
				}
			}
			document.getElementById("amounts").value=sums;
		}
		
		function tijiao(){
			return jisuan();
		}

	</script>

⌨️ 快捷键说明

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