2018-06-03 22:26:41 +08:00

52 lines
1.9 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"%><%
String importparam = CurPage.getParameter("importparam");
boolean isReadOnly = "ReadOnly".equals(CurPage.getParameter("RightType"));
String[][] sButtons = {
{"true","All","Button","上传","","importRecord()","","","","btn_icon_up"}
};
%>
<body style="overflow:hidden;" onresize="javascript:changeStyle();">
<div id="ButtonsDiv" style="margin-left:5px">
<table><tr><%if(!isReadOnly){%>
<td><form name="Attachment" action="<%=sWebRootPath%>/Accounting/LoanSimulation/reriod/uploadReriodOperator.jsp?CompClientID=<%=CurComp.getClientID()%>" accept-charset="GBK" style="margin-bottom:0px;" enctype="multipart/form-data" method="post">
<input type="file" name="File" />
<input type="hidden" name="importparam" value="<%=importparam%>" >
<input type="hidden" name="FileName" />
</form></td><%}%>
<td><%@ include file="/Frame/resources/include/ui/include_buttonset_dw.jspf"%></td>
</tr></table>
</div>
</body>
<script type="text/javascript">
setDialogTitle("模板管理");
function importRecord(){
var o = document.forms["Attachment"];
var sFileName = o.File.value;
if(sFileName.indexOf(".xlsx")<=0&&sFileName.indexOf(".xls")<=0){
alert("上传的文档必需是excel文件");
return false;
}
var nameArr = sFileName.split("\\");
o.FileName.value = encodeURI(nameArr[nameArr.length-1]);
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.File.files[0].size;
}
if(fileSize > 2*1024*1024){
alert("文件大于2048k不能上传");
return false;
}
return o.submit();
}
</script>
<%@ include file="/IncludeEnd.jsp"%>