apzl_leasing/WebContent/AppConfig/EDoc/TemplateChooseDialog.jsp
2018-06-03 22:26:41 +08:00

77 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%><%
/*
Content: 选择附件框
*/
//获得页面参数
String sEDocNo = CurPage.getParameter("EDocNo");
String sDocType = CurPage.getParameter("DocType");
String acceptType = "application/msword";
if("Def".equals(sDocType)) acceptType = "application/xml";
%>
<html>
<head>
<title>请选择模板文件</title>
<script type="text/javascript">
function checkItems(){
var o = document.forms["SelectAttachment"];
var sFileName = o.AttachmentFileName.value;
o.FileName.value = encodeURI(sFileName);
if (typeof(sFileName) == "undefined" || sFileName==""){
alert("请选择一个文件名!");
return false;
}
var fileSize;
if(typeof(ActiveXObject) == "function"){ // IE
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile(sFileName);
fileSize = f1.size;
}else{
fileSize = o.AttachmentFileName.files[0].size;
}
if(fileSize > 2*1024*1024){
alert("文件大于2048k不能上传");
return false;
}
return true;
}
</script>
<style>
.black9pt { font-size: 9pt; color: #000000; text-decoration: none}
</style>
</head>
<body bgcolor="#D3D3D3">
<form name="SelectAttachment" method="post" ENCTYPE="multipart/form-data" action="<%=sWebRootPath%>/AppConfig/EDoc/TemplateUpload.jsp?CompClientID=<%=CurComp.getClientID()%>" align="center">
<table align="center">
<tr>
<td class="black9pt" align="left">
<font size="2">请选择一个文件作为附件上传:</font>
</td>
</tr>
<tr>
<td>
<input type="file" size=60 name="AttachmentFileName" accept="<%=acceptType%>">
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;
<input type=hidden name="EDocNo" value="<%=sEDocNo%>" >
<input type=hidden name="DocType" value="<%=sDocType%>" >
<input type=hidden name="FileName" value="" >
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" style="width:50px" name="ok" value="确认" onclick="javascript:if(checkItems()) { SelectAttachment.submit();} ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" style="width:50px" name="Cancel" value="取消" onclick="javascript:parent.AsDialog.ClosePage('_none_')">
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ include file="/IncludeEnd.jsp"%>