光辉飞翔

导航

 

<%@page import="org.centric.modules.oa.*"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%> <%@ include file="/templates/taglibs.jsp"%> <style type="text/css"> #newPreview {  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale   ); } </style>

<script type="text/javascript">  function PreviewImg(imgFile) {   //原来的预览代码,不支持 IE7。   //var oldPreview = document.getElementById("oldPreview");   //oldPreview.innerHTML = "<img src=\"file:\\\\" + imgFile.value + "\" width=\"80\" height=\"60\" />";   //新的预览代码,支持 IE6、IE7。   var newPreview = document.getElementById("newPreview");   newPreview.innerHTML="";   newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;   newPreview.style.width = "150px";   newPreview.style.height = "150px";  }    function removeUploadFile(obj,id) {   if(confirm('确定要删除当前印模?')){    $.post("oa/stamps_deleteStampPhoto", {"id" : id}, function(data) {     document.getElementById("inputFile").innerHTML="<input type='file' name='fileUpload' id='fileUpload' class='required' maxlength='32' onchange='javascript:PreviewImg(this);'/>";     var newPreview = document.getElementById("newPreview");     newPreview.innerHTML="";     alert('删除成功!');    });   }  } </script> <input type="hidden" id="id" name="id"  value="<s:property value="model.id"/>" />

<table cellpadding="2" cellspacing="0" border="0" width="98%"  class="details">  <tr>   <td class="formLabel" style="width: 30%"><%=Stamps.ALIAS_STAMPCODE%></td>   <td  style="width: 70%"><input type="text"    value="<s:property value="model.stampcode"/>" name="stampcode"    id="stampcode" class="" maxlength="32" /></td>  </tr>  <tr>   <td class="formLabel"><%=Stamps.ALIAS_STAMPNAME%></td>   <td><input type="text"    value="<s:property value="model.stampname"/>" name="stampname"    id="stampname" class="required" maxlength="32" /><font color="RED">*</font></td>  </tr>

 <tr>   <td class="formLabel">管理机构</td>   <td>   <s:select list="unitList" listKey="id" listValue="name" headerKey="" headerValue="--请选择--" name="mngunit.id" value="model.mngunit.id" theme="simple" cssClass="required"></s:select>   <font color="RED">*</font>   </td>  </tr>

 <tr height="150px">   <td class="formLabel"><%=Stamps.ALIAS_STAMPPHOTO%></td>   <td>   <div  id="newPreview">   <s:if test="model.stampphoto!=null">   <img src="personnel/personnel!downPhoto?personnel.personnelPhoto=<s:property value="model.stampphoto.filePath" />" width="150px" height="150px"/>   </s:if>   </div>   </td>  </tr>  <tr>  <td class="formLabel">选择<%=Stamps.ALIAS_STAMPPHOTO%></td><td id="inputFile">  <s:if test="model.stampphoto==null">  <input type="file" name="fileUpload" id="fileUpload" class="" maxlength="32" onchange="javascript:PreviewImg(this);" />  </s:if>  <s:else>  <c:if test="${!isShow}"><button onclick="removeUploadFile(this,'<s:property value="model.id" />')" title="重新选择" type="button">重新选择</button></c:if>  </s:else>  </td>  </tr>  <tr>   <td class="formLabel"><%=Stamps.ALIAS_MNGPERSON%></td>   <td><input type="text"    value="<s:property value="model.mngperson.chineseName"/>"    id="userName" name="mngperson.chineseName" class="required" maxlength="32"    readonly="readonly" /> <s:hidden name="mngperson.userId" id="userId"     value="%{model.mngperson.userId}"></s:hidden><font color="RED">*</font>    <button     onclick='confDlg.selectUser({"fn":"","hiddenId":"userId","id":"","multi":false,"textId":"userName"});'     id="selProject" type="button" class="fs-button" title="选择管理人">选择管理人</button>   </td>  </tr> </table>

<c:if test="${!isShow}">  <script defer="defer">   new Validation(document.forms[0], {    onSubmit : true,    immediate : true,    onFormValidate : function(result, form) {     var finalResult = result;     //在这里添加自定义验证     return finalResult;     //return disableSubmit(finalResult,'submitButton');    }   }); //   $("#createDateString").datepicker();  </script> </c:if>

posted on 2012-07-20 13:31  光辉飞翔  阅读(271)  评论(0编辑  收藏  举报