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

📄 jydj.jsp

📁 一套完整的档案管理系统
💻 JSP
字号:
<%@ page language="java" import="com.stsc.archive.jygl.*" %>
<%@ page contentType="text/html;charset=GB2312" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ include file="/share/share.jsp"%>



<SCRIPT TYPE="text/javascript" SRC="js/date.js" > </SCRIPT> 
<SCRIPT TYPE="text/javascript" SRC="js/trim.js" > </SCRIPT> 

<html:html locale="true">




<head>
<logic:equal name="jyForm" property="action"
            scope="request" value="Create">
  <title><bean:message key="jygl.jydj.title"/></title>
</logic:equal>
<logic:equal name="jyForm" property="action"
            scope="request" value="See">
  <title>借阅记录查看</title>
</logic:equal>
<logic:equal name="jyForm" property="action"
            scope="request" value="Edit">
  <title>借阅记录编辑</title>
</logic:equal>
<logic:equal name="jyForm" property="action"
            scope="request" value="Ghdj">
  <title>归还登记</title>
</logic:equal>
<html:base/>
</head>
<%  
    Judge  m        = new Judge();
	int loanablenum =0;
	if(request.getParameter("serialno")!=null&&!request.getParameter("serialno").equals("")){
		loanablenum= m.getloanable(request.getParameter("serialno")); 
	}else if(request.getParameter("lendfileid")!=null&&!request.getParameter("lendfileid").equals("")){
		loanablenum= m.getloanable_edit(request.getParameter("lendfileid"));
	}
    JyForm tmp =(JyForm)session.getAttribute("jydj");

%>





<body bgcolor="white">

<logic:equal name="jyForm" property="action"
            scope="request" value="Create">
<p align="center"><font size="5"><bean:message key="jygl.jydj.title"/></font></p>
</logic:equal>
<logic:equal name="jyForm" property="action"
            scope="request" value="See">
<p align="center"><font size="5">借阅记录查看</font></p>
</logic:equal>

<logic:equal name="jyForm" property="action"
            scope="request" value="Edit">
<p align="center"><font size="5">借阅记录编辑</font></p>
</logic:equal>

<logic:equal name="jyForm" property="action"
            scope="request" value="Ghdj">
<p align="center"><font size="5">归还登记</font></p>
</logic:equal>


<html:form action="/saveJydj">
<html:hidden property="action"/>
<table border="1" cellpadding="0" cellspacing="0" align="center" width="777" bgcolor="#3A5C9F" ><!-- 查看页面   -->
<logic:equal name="jyForm" property="action"
            scope="request" value="See">
  <tr>
    <td width="20%" align="right" >
		文号:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="serialno"
					scope="request"	filter="true"/>
	</td>
  </tr>
 <tr>
    <td width="20%" align="right" >
		标题: </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="title"
					scope="request"	filter="true"/>
	</td>
  </tr>
  
   <td width="20%" align="right" >
		档号:   </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="archivalcode"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <td width="20%" align="right" >
		 借阅人:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="borrowname"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <td width="20%" align="right" >
		借阅时间:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="lendtime"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <td width="20%" align="right" >
		借出经办人:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="lendhandler"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <td width="20%" align="right" >
		借出份数:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="lendnum"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <td width="20%" align="right" >
		借阅期限:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="lendperiod"
					scope="request"	filter="true"/>
	</td>
  </tr>
<tr>
    <td align="right">
    </td>
    <td align="left">
        <input type="button" value="返回" onClick="javascript:history.go(-1);">
    </td>
  </tr>
</logic:equal>

<!-- 借阅登记页面   -->
<logic:notEqual name="jyForm" property="action"
                scope="request" value="See">
<logic:notEqual name="jyForm" property="action"
                scope="request" value="Ghdj">

 <tr>
    <td width="20%" align="right" >
		文号:
    </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="serialno"
					scope="request"	filter="true"/>
	</td>
  </tr>
   <html:hidden property="serialno"/>
 <tr>
    <td width="20%" align="right" >
		标题: </td>
	<td width="30%" align="left" >
		<bean:write name="jyForm" property="title"
					scope="request"	filter="true"/>
	</td>
  </tr>
  <html:hidden property="title"/>
  <tr>
	   <td width="20%" align="right" >
			档号:   </td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="archivalcode"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <html:hidden property="archivalcode"/>
  <tr>
   <td width="20%" align="right" >
		 借阅人:
    </td>
	<td width="30%" align="left" >
		<html:text property="borrowname"/>
	</td>

  </tr>
  <tr> 
   <td width="20%" align="right" >
		借阅时间:
    </td>
	<td width="30%" align="left" >
		<html:text   property="lendtime" readonly="true"/>
	   <img align=absMiddle
 		  alt="日期选择" border=0 height=13 id=daysOfMonth1Pos name=daysOfMonth1Pos
 		  onMouseUp="toggleDatePicker('daysOfMonth1','jyForm.ret',document.jyForm.lendtime)"
 		  src="../js/calendaricon.gif" width=13>
                  <div id=daysOfMonth1 style="POSITION: absolute"></div>
	
	</td>
  </tr>
   <tr>
   <td width="20%" align="right" >
		借出经办人:
    </td>
	<td width="30%" align="left" >
		<html:text  value="<%=userInfo.getUserName()%>"  property="lendhandler" readonly="true"/>
	</td>
  </tr>
   	<tr>
   <td width="20%" align="right" >
		借出份数:
    </td>
	<td width="30%" align="left" >
		<html:text size="5"  property="lendnum"/>
	    (现有<font color=red><%= loanablenum %></font>份)
	</td>
  </tr>
 <input type="hidden" name="old_lendnum" value="<%= tmp.getlendnum() %>">
   <tr>
   <td width="20%" align="right" >
		借阅期限:
    </td>
	<input type="hidden" name="loanablenum" value="<%=loanablenum %>">
	<td width="30%" align="left" >
		<html:text  size="15" property="lendperiod"/>
	</td>
    <tr>
     <html:hidden property="lendfileid"/>
	<td align="right">
     <!-- <html:submit>
        <bean:message key="button.save"/>
      </html:submit>
    -->
	<input type="submit" value="保存" onClick="return submitlendCheck()">&nbsp;&nbsp; 
	<td align="left">
      <html:reset>
        <bean:message key="button.reset"/>
      </html:reset>
      &nbsp;
       <input type="button" value="返回" onClick="javascript:history.go(-1);">
    </td>
  </tr>
</logic:notEqual>
</logic:notEqual>


<!-- 归还登记页面   -->
<logic:equal name="jyForm" property="action"
            scope="request" value="Ghdj">
  <tr>
		<td width="20%" align="right" >
			文号:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="serialno"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <html:hidden property="serialno"/>
  <tr>
		<td width="20%" align="right" >
			标题: </td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="title"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr> 
	   <td width="20%" align="right" >
			档号:   </td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="archivalcode"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr>
	   <td width="20%" align="right" >
			 借阅人:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="borrowname"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr>
	   <td width="20%" align="right" >
			借阅时间:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="lendtime"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr>
	   <td width="20%" align="right" >
			借出经办人:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="lendhandler"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr>
	   <td width="20%" align="right" >
			借出份数:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="lendnum"
						scope="request"	filter="true"/> 
		</td>
  </tr>
   <html:hidden property="lendnum"/>
  <tr>
	   <td width="20%" align="right" >
			借阅期限:
		</td>
		<td width="30%" align="left" >
			<bean:write name="jyForm" property="lendperiod"
						scope="request"	filter="true"/>
		</td>
  </tr>
  <tr>
	  <td width="20%" align="right" >
			归还经办人:
		</td>
		<td width="30%" align="left" >
			<html:text  value="<%=userInfo.getUserName()%>" property="returnhandler" readonly="true"/>
		</td>
</tr>
 <tr>
	  <td width="20%" align="right" >
			归还份数:
		</td>
		<td width="30%" align="left" >
			<html:text  property="returnnum" />
		</td>
</tr>
<input type="hidden" name="old_returnnum" value="<%= tmp.getreturnnum() %>">
<tr>
		 <td width="20%" align="right" >
			归还时间:
		</td>
		<td width="30%" align="left" >
		<html:text  property="returntime" readonly="true"/>
		 <img align=absMiddle
			  alt="日期选择" border=0 height=13 id=daysOfMonth1Pos name=daysOfMonth1Pos
			  onMouseUp="toggleDatePicker('daysOfMonth1','jyForm.ret',document.jyForm.returntime)"
			  src="../js/calendaricon.gif" width=13>
					  <div id=daysOfMonth1 style="POSITION: absolute"></div>
		</td>
</tr>
 <html:hidden property="lendfileid"/>
<tr>
    <td align="right">
    </td>
    <td align="left">
  <!--
	  <html:submit>
        归还
      </html:submit>
   -->

   <input type="submit" value="归还" onClick="return submitreturnCheck()">&nbsp;&nbsp;&nbsp;
	  <input type="button" value="返回" onClick="javascript:history.go(-1);">
	</td>
  </tr>
</logic:equal>



</table>
</html:form>


  </body>

  </html:html>
<SCRIPT LANGUAGE="JavaScript">
//检测借出输入数据
function submitlendCheck(){
		var serialno	 =document.jyForm.serialno.value;	
		var lendnum		 =document.jyForm.lendnum.value;
		var lendperiod	 =document.jyForm.lendperiod.value;
		var borrowname	 =document.jyForm.borrowname.value;
		var lendhandler	 =document.jyForm.lendhandler.value;
		var loanablenum	 =document.jyForm.loanablenum.value;
        var old_lendnum  =document.jyForm.old_lendnum.value;
		var action       =document.jyForm.action.value;
	
		if(serialno==""){
		   alert("文号不能为空");
           return false;
		}
        if(borrowname==""){
		  alert("借阅人不能为空");
		  return false;
		} 
		
		if(lendhandler==""){
           alert("借出经办人不能为空");
		   return false;
        }
		if (!isNumber(lendnum)){
			alert("借出份数必须是数字");
	  		return false;
	  	}
	   if(parseInt(lendnum)<1){
				alert("借阅份数不能小于1");
	  		    return false;
			}
		if(action=="Create"){
			if(parseInt(lendnum)>parseInt(loanablenum)){
			    alert("借出份数不能超出可借份数");
				return false;
			} 	
		}

		if(action=="Edit"){
		    if(parseInt(lendnum)>(parseInt(old_lendnum)+parseInt(loanablenum))){
			    alert("借出份数不能超出可借份数");
				return false;
			}
		
		}

		if (!isNumber(lendperiod)){
			alert("借阅期限必须是数字");
	  		return false;
	  	}
	  	
		
		//最后正确-返回
		return true;
	
}
//检测归还数据
function submitreturnCheck(){
		var returnhandler =document.jyForm.returnhandler.value;
		var returnnum     =document.jyForm.returnnum.value;
		var lendnum		  =document.jyForm.lendnum.value;	
	    var old_returnnum     =document.jyForm.old_returnnum.value;
		if(returnhandler==""){
           alert("归还经办人不能为空");
		   return false;
        }
		if (!isNumber(returnnum)){
			alert("归还份数必须是数字");
	  		return false;
	  	}
		if(parseInt(returnnum)>parseInt(lendnum)){
		    alert("归还份数不能大于借出份数");
	  		return false;
		} 
        if(parseInt(returnnum)<1){
			alert("归还份数不能小于1");
	  		return false;
	    }
        if(parseInt(returnnum)<parseInt(old_returnnum)){
			alert("上次归还"+old_returnnum+"份,这次不能小于上次的值");
			return false;
        }
		//最后正确-返回
		return true;
	
}



//输入是否为数字的判断函数
function isNumber(tvlaue){
	    var tvlaue="1"+tvlaue;
	    if (isNaN(tvlaue)||(parseInt(tvlaue)<0)||(tvlaue.length<1)) {
		    return false;
	    }
	    return true;
	}
 


//-->
</SCRIPT>
  

⌨️ 快捷键说明

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