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

94 lines
3.1 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"%>
<%
//定义变量
String sObjectNo = "";//--对象编号
//获得组件参数
String flowNo=CurPage.getParameter("FlowNo");
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
String sLibraryId = CurPage.getParameter("Library_id");
ASObjectModel doTemp = new ASObjectModel("FlowNormalContractListUpload");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="2"; // 设置DW风格 1:Grid 2:Freeform
dwTemp.ReadOnly = "0"; // 设置是否只读 1:只读 0:可写
dwTemp.genHTMLObjectWindow(sLibraryId);
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 params={};
params["OBJECTTYPE"]="<%=flowNo%>";
params["FILENAMEX"]="";
params["REMARK2"]="";
params["DocName"]="";
var sparma="";
for(var key in params){
sparma=sparma+"<input type=\"text\" name=\""+key+"\" id=\""+key+"\" value=\""+params[key]+"\">"
}
$("#FILE2").append(sparma);
$("#myiframe0").attr("action","<%=sWebRootPath%>/Tenwa/Lease/Flow/Comm/LBContractTemplate/NormalContractListUpload.jsp?CompClientID=<%=CurComp.getClientID()%>&libraryId="+"<%=sLibraryId%>&FlowUnid="+"<%=sFlowUnid%>");
$("#myiframe0").attr("method","post");
});
function viewAndEdit_attachment(){
if(confirm("确认取消上传?")){
parent.AsDialog.ClosePage("_CANCEL_");
}
}
function importRecord(){
var o = document.forms["myiframe0"];
var sFileName = o.FILE2.value;
var nameArr = sFileName.split("\\");
setItemValue(0,0,"FileName",encodeURI(nameArr[nameArr.length-1]));
$("#FILENAMEX").val(encodeURI(nameArr[nameArr.length-1]));
o.REMARK2.value= encodeURI(getItemValue(0,0,"REMARK"));
o.DocName.value= encodeURI(getItemValue(0,0,"DOC_NAME"));
if (typeof(sFileName) == "undefined" || sFileName==""){
alert("请选上传的附件!");
return false;
}
/* if(sFileName.indexOf(".docx")<=0){
alert("上传的文档必需是word(.docx)文件");
return false;
} */
/* if(sFileName.indexOf("融资租赁合同及相关文件.")<=0){
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.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,txt";
var flag="false";
var s2=s.split(",");
for(var i=0;i<s2.length;i++){
if(str.split(".")[1]==s2[i]){
return "true";
}
}
return s;
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>