apzl_leasing/WebContent/Tenwa/Comm/Document/LoanLBDocumentInfo.jsp
2020-08-27 17:51:01 +08:00

103 lines
3.5 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="/Frame/resources/include/include_begin_info.jspf"%>
<%@ page import="com.tenwa.doc.action.DocumentListAction" %>
<%
//定义变量
String sObjectNo = "";//--对象编号
//获得组件参数
String sLibraryId = CurPage.getParameter("Library_id");
String fileType = CurPage.getParameter("fileType");
ASObjectModel doTemp = new ASObjectModel("LoanLBDocumentInfo");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="2"; // 设置DW风格 1:Grid 2:Freeform
dwTemp.ReadOnly = "0"; // 设置是否只读 1:只读 0:可写
dwTemp.genHTMLObjectWindow("");
String[][] sButtons=null;
sButtons=new String[][]{
{"true","","Button","保存","保存所有修改","importRecord()","","","",""},
{"true","","Button","取消","取消","viewAndEdit_attachment()","","","","btn_icon_close"}};
%><%@include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(function() {
$("#FILE2").attr("type","file");
$("#myiframe0").attr("enctype","multipart/form-data");
var libraryIds = "<%=sLibraryId%>";
var sparma="<input type=\"text\" name=\'libraryId\' value=\'"+libraryIds+"\' >";
$("#FILE2").append(sparma);
var fileType = "<%=fileType%>";
if(fileType !="undefined" && fileType !=null && fileType.length>0 ){
$("#A_div_1010").attr("style","display:none;");
setItemRequired(0,"Doc_Type",false);
}
$("#myiframe0").attr("action","<%=sWebRootPath%>/Tenwa/Comm/Document/LoanLBDocumentUpload.jsp?CompClientID=<%=CurComp.getClientID()%>");
$("#myiframe0").attr("method","post");
setItemValue(0,0,"InputUserName","<%= CurUser.getUserName()%>");
setItemValue(0,0,"InputOrg","<%=CurUser.getOrgName()%>");
setItemValue(0,0,"InputTime","<%=StringFunction.getToday()%>");
});
function viewAndEdit_attachment(){
if(confirm("确认取消上传?")){
parent.AsDialog.ClosePage("_CANCEL_");
}
}
//提交
function importRecord(){
var sparma="";
var fileType = "<%=fileType%>";
if(fileType !="undefined" && fileType !=null && fileType.length>0 ){
sparma="<input type=\"text\" name=\'OBJECTTYPE\' value=\'"+fileType+"\' >";
}else{
var fileType = getItemValue(0,getRow(0),"Doc_Type");
sparma="<input type=\"text\" name=\'OBJECTTYPE\' value=\'"+fileType+"\' >";
}
$("#FILE2").append(sparma);
if(!iV_all('myiframe0'))return;
//$("#FILE").append(params);
var o = document.forms["myiframe0"];
var sFileName = o.FILE2.value;
var nameArr = sFileName.split("\\");
setItemValue(0,0,"FileName",encodeURI(nameArr[nameArr.length-1]));
if (typeof(sFileName) == "undefined" || sFileName==""){
alert("请选上传的附件!");
return false;
}
if(/[!@'"#$%&\^*]/.test(nameArr[nameArr.length-1])){
alert("文件名不合法");
return;
}
var flag=CheckStr(nameArr[nameArr.length-1]);
if(flag!="true"){
alert("只能上传后缀名为"+flag+"的文件");
return ;
}
var fileSize;
if(typeof(ActiveXObject) == "function"){ // IE
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile(sFileName);
fileSize = f1.size;
}else{
fileSize = o.FILE2.files[0].size;
}
if(fileSize > 50*1024*1024){
alert("文件大于50MB不能上传");
return false;
}
return o.submit();
}
function CheckStr(str){
var s="jpg,jpeg,png,pdf,doc,docx,xls,xlsx,rar,zip";
var flag="false";
var s2=s.split(",");
for(var i=0;i<s2.length;i++){
if(str.substring(str.lastIndexOf(".")+1)==s2[i]){
return "true";
}
}
return s;
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>