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

📄 edit.jsp

📁 一套完整的档案管理系统
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312"%>
<%@ page language="java"%>
<%@ taglib uri="/web-inf/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/web-inf/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/web-inf/struts-html.tld" prefix="html"%>
<%@ include file="/share/func.jsp"%>
<%@ include file="/share/share.jsp"%>
<SCRIPT TYPE="text/javascript" SRC="js/date.js" > </SCRIPT> 

<html:html locale="true">
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>案卷编辑</title>
</head>

<body>

<p align="center"><font size="5">案卷编辑</font></p>
<html:form method="GET" action="editsaveAction">
  <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
  S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
  
  
  <% 
 
  String temp=(String) session.getAttribute("ar");
  //String temp1=(String) session.getAttribute("archivetype2");
  String convert2=request.getParameter("convert2");

  if(convert2!=null)
  {
     if(temp!=convert2)
     {
  	    temp=convert2;
     }
}

 
  
  //2003-05-28 add by liqf
  //取得密级和类目号
  String category=(String) session.getAttribute("category");
  String security=(String) session.getAttribute("security");
  String volumnno=(String) session.getAttribute("volumnno");
  String volumnno1=volumnno;
  String retentionperiod=(String) session.getAttribute("retentionperiod");
  String code=(String) session.getAttribute("code");

  String category1=request.getParameter("category");
	    String code1=request.getParameter("code");
	   if(category1!=null && !category1.equals("")&&  !category1.equals("null")){
		category=category1;
	  }
	   if(code1!=null && !code1.equals("")&&  !code1.equals("null")){
		code=code1;
	  }
	  String temp_volumnno="";
	if(category1!=null && !category1.equals("") && code1!=null && !code1.equals("")){
	 temp_volumnno=code+"-"+category+"-";
	 volumnno=temp_volumnno;
	}

	%>
  <div align="center">
    <center>
  <table border="1" cellpadding="0" cellspacing="0" align="center" width="777" bgcolor="#3A5C9F">
  
    <tr>
      <td align="right" width="125" valign="middle">档案种类:</td>
      <td align="left" width="231">
      
      <html:select property="archivetype" onchange="javascript:location.href='/myweb1/hreffileinfoAction.do?convert2='+document.fileinfoForm.archivetype.value">
               <%= getBcOptions(temp,"farchivetype")%>
                 </html:select></td>
                
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">工程代号:</td>
      <td align="left" width="231">
	  <input type="text" name="code" value="<%=code%>">
	</td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">类目号:</td>
      <td align="left" width="231"> <select name="category"
	  onchange="javascript:location.href='/myweb1/hreffileinfoAction.do?category='+document.fileinfoForm.category.value+'&convert2='+document.fileinfoForm.archivetype.value+'&code='+document.fileinfoForm.code.value">
	<%= getBcOptions(category,"category","fFileCategory")%>
	</select>
	<!--
	  <html:text size="20" property="category"/></td>
	  -->
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">标题:</td>
      <td align="left" width="231"><html:text size="20" property="volumntitle"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">案卷号:</td>
      <td align="left" width="231">
	  <input type="text" name="volumnno" value="<%=volumnno%>"></td>
	  <input type="hidden" name="volumnno_old" value="<%=volumnno1%>">
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">保管期限:</td>
      <td align="left" width="231"><html:select property="retentionperiod">
      <html:option value="长久" >永久</html:option>
      <html:option value="长期" >长期</html:option>
      <html:option value="短期" >短期</html:option>
              
       <% if(temp.equals("会档"))
        {%>
      <html:option value="50年" >50年</html:option>
      <html:option value="20年" >20年</html:option>
      <html:option value="15年" >15年</html:option>
      <html:option value="10年" >10年</html:option>
      <html:option value="5年" >5年</html:option>
      <html:option value="3年" >3年</html:option>
      <%}%>
      </html:select>
      </td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">起止年月:</td>
      <td align="left" width="231"><html:text size="13" property="startdate" readonly="true"/>
      <img align=absMiddle
 		  alt="日期选择" border=0 height=13 id=daysOfMonth1Pos name=daysOfMonth1Pos
 		  onMouseUp="toggleMonthPicker('daysOfMonth1','archiveForm.ret',document.fileinfoForm.startdate)"
 		  src="<%=app_path%>js/calendaricon.gif" width=13>
                  <div id=daysOfMonth1 style="POSITION: absolute"></div>
                 
      至<html:text size="20" property="enddate" readonly="true"/>
       <img align=absMiddle
 		  alt="日期选择" border=0 height=13 id=daysOfMonth2Pos name=daysOfMonth2Pos
 		  onMouseUp="toggleMonthPicker('daysOfMonth2','archiveForm.ret',document.fileinfoForm.enddate)"
 		  src="<%=app_path%>js/calendaricon.gif" width=13>
                  <div id=daysOfMonth2 style="POSITION: absolute"></div></td>
    </tr>
      
    <tr>
      <td align="right" width="125" valign="middle">总页数:</td>
      <td align="left" width="231"><html:text size="20" property="totalpage"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">总件数:</td>
      <td align="left" width="231"><html:text size="20" property="totalnum"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">立卷单位:</td>
      <td align="left" width="231"><html:text size="20" property="archiveunit"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">责任者:</td>
      <td align="left" width="231"><html:text size="20" property="duty"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">密级:</td>
      <td align="left" width="231">
	  <select name="security" >
	<option value="普通" <%if(security.equals("普通")) out.println("selected");%>>普通
	<option value="秘密" <%if(security.equals("秘密")) out.println("selected");%>>秘密
	<option value="机密" <%if(security.equals("机密")) out.println("selected");%>>机密
	</select>
	  <!--
      <html:select property="security">
      <html:option value="普通">普通</html:option>
      <html:option value="秘密">秘密</html:option>
      <html:option value="机密">机密</html:option>
      </html:select>
	  -->
      </td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">状态:</td>
      <td align="left" width="231"><html:text size="20" property="status" readonly="true"/></td>
    </tr>
    <tr>
      <td align="right" width="125" valign="middle">备注:</td>
      <td align="left" width="231"><html:textarea cols="30" rows="4" property="remark"/></td>
    </tr>
    <tr>
      <td align="right" width="125"><html:hidden property="volumnid"/></td>
      <td align="left" width="231"></td>
    </tr>
    
  </table>
    </center>
  </div>
  
  <p align="center">
    <html:submit  onclick="return checkout()">保存</html:submit>&nbsp&nbsp&nbsp&nbsp
  
    <html:reset>重置</html:reset>&nbsp&nbsp&nbsp&nbsp
    <input type="button" value="返回" name="B4" onClick="javascript:history.back()">
  </p>
</html:form>

<p> </p>
<p> </p>

</body>
<script language="javascript">

function checkout()
{
	var code1=document.fileinfoForm.code.value;
        var code2=getTrim(code1);

   if(!isNumber(document.fileinfoForm.totalpage.value))
  {
  	 alert("总页数应该是数字");
  	  return false;
  }
if(!isNumber(document.fileinfoForm.totalnum.value))
  {
  	 alert("总件数应该是数字");
  	  return false;
  }
  if((document.fileinfoForm.code.value).length > 4)
  {
  	 alert("工程代号不得超过4");
  	 return false;
  }
   if(document.fileinfoForm.code.value=="")
  {
  	 alert("工程代号不得为空");
  	 return false;
  }
   if(code2.length<code1.length)
  {
  	 alert("工程代号两边不得有空格");
  	 return false;
  }
  if(document.fileinfoForm.volumnno.value=="")
  {
  	 alert("请输入案卷号");
  	 return false;
  }
  //alert((document.fileinfoForm.volumnno.value).charAt(4));
  if((document.fileinfoForm.volumnno.value).charAt(4)!="-" || (document.fileinfoForm.volumnno.value).charAt(9)!="-")
  {
  	 alert("案卷号输入错误");
  	 return false;
  }
   if((document.fileinfoForm.volumnno.value).length!=13 )
  {
  	 alert("案卷号输入错误");
  	 return false;
  }
 if(compChar1(document.fileinfoForm.code.value,document.fileinfoForm.volumnno.value))
  {
  	 alert("案卷号输入错误");
  	 return false;
  }
  if(compChar2(document.fileinfoForm.category.value,document.fileinfoForm.volumnno.value))
  {
  	 alert("案卷号输入错误");
  	 return false;
  }
 
}

function isNumber(tvlaue){
	    var tvlaue="1"+tvlaue;
	    if (isNaN(tvlaue)||(parseInt(tvlaue)<0)||(tvlaue.length<1)) {
		    return false;
	    }
	    return true;
	}
	
/*
    *替换左边空格
    * 参数输入框对象值
    */
function getLeftTrim(sInputString){
        var rtnStr;
        rtnStr=""
        for (var i=0;i<sInputString.length;i++){
            if (sInputString.charAt(i)!=" "){
            rtnStr=sInputString.substr(i);
            break;
            }
        }
        return rtnStr;
    }
/*
    *比较字符串
    * 参数输入框对象值
    */
function compChar1(s1,s2){
        for (var i=0;i<s1.length;i++){
            if (s1.charAt(i)!=s2.charAt(i)){
				return true;
            }
        }
        return false;
    }


/*
    *比较字符串
    * 参数输入框对象值
    */
function compChar2(s1,s2){
        for (var i=0;i<s1.length;i++){
            if (s1.charAt(i)!=s2.charAt(i+5)){
				return true;
            }
        }
        return false;
    }


    /*
    *替换右边空格
    * 参数输入框对象值
    */

    function getRightTrim(sInputString){
        var rtnStr;
        rtnStr=""
        for (var i=sInputString.length-1;i>=0;i--){
        if (sInputString.charAt(i)!=" "){             
        rtnStr=sInputString.substring(0,i+1);
        break;
        }
        }
        return rtnStr;
    }

    /*
    *替换左右边空格
    * 参数输入框对象值
    */

    function getTrim(sInputString){

        sInputString=getRightTrim(sInputString);               //去处字符串左边的空格
        sInputString=getLeftTrim(sInputString);                //去处字符串右边的空格
        return sInputString;

    }	
 
</script>
</html:html>

⌨️ 快捷键说明

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