租金催收,五级分类上传附件
This commit is contained in:
parent
4a070b0ee8
commit
7868b647b4
104
WebContent/Tenwa/Apzl/FileUpload/AutoFiveAttachmentUpload.jsp
Normal file
104
WebContent/Tenwa/Apzl/FileUpload/AutoFiveAttachmentUpload.jsp
Normal file
@ -0,0 +1,104 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-05-31
|
||||
Content: 示例详情页面
|
||||
History Log:
|
||||
*/
|
||||
String Library_id = CurPage.getParameter("Library_id");
|
||||
|
||||
//定义变量
|
||||
String sObjectNo = "";//--对象编号
|
||||
//获得组件参数
|
||||
String flowNo=CurPage.getParameter("FlowNo");
|
||||
|
||||
String sPrevUrl = CurPage.getParameter("PrevUrl");
|
||||
//if(sPrevUrl == null) sPrevUrl = "/Tenwa/Lease/FamilyVisit/fieldSurvey/FieldSurveyList.jsp";
|
||||
|
||||
String sTempletNo = "AutoFiveAttachmentUpload";//--模板号--
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||||
dwTemp.Style = "2";//freeform
|
||||
//dwTemp.ReadOnly = "-2";//只读模式
|
||||
dwTemp.genHTMLObjectWindow(Library_id);
|
||||
String sButtons[][] = {
|
||||
{"true","","Button","保存","保存所有修改","importRecord()","","","",""},
|
||||
{"true","All","Button","取消","返回列表","pull()","","","","btn_icon_close"}
|
||||
};
|
||||
/* sButtonPosition = "south"; */
|
||||
%><%@ 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%>";
|
||||
var sparma="";
|
||||
for(var key in params){
|
||||
sparma=sparma+"<input type=\"text\" name=\""+key+"\" value=\""+params[key]+"\">"
|
||||
}
|
||||
$("#FILE2").append(sparma);
|
||||
$("#myiframe0").attr("action","<%=sWebRootPath%>/Tenwa/Comm/DocList/DocListUploadTwo.jsp?CompClientID=<%=CurComp.getClientID()%>");
|
||||
$("#myiframe0").attr("method","post");
|
||||
});
|
||||
|
||||
var lock = false;
|
||||
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]));
|
||||
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;
|
||||
}
|
||||
if(lock){
|
||||
//锁已经开启,在提交只会被阻断
|
||||
AsDebug.showMessage('提醒:','请勿重复点击','','',true);
|
||||
return false;
|
||||
}else {
|
||||
//锁开启,锁关闭只能是数据被处理完毕或者刷新页面,文档重新加载
|
||||
lock = true;
|
||||
}
|
||||
return o.submit();
|
||||
}
|
||||
function CheckStr(filename){
|
||||
var s="jpg,jpeg,png,bmp,gif,pdf,doc,docx,xls,xlsx,txt";
|
||||
var flag="false";
|
||||
var s2=s.split(",");
|
||||
var filenamelast = filename.lastIndexOf(".");
|
||||
var fileimage = filename.substr(filenamelast+1).toLowerCase();
|
||||
for(var i=0;i<s2.length;i++){
|
||||
if(fileimage==s2[i]){
|
||||
return "true";
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function pull(){
|
||||
// AsControl.OpenView("/Tenwa/Lease/FamilyVisit/fieldSurvey/FieldSurveyList.jsp", "","_self","");
|
||||
parent.AsDialog.ClosePage("_CANCEL_");
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
104
WebContent/Tenwa/Apzl/FileUpload/RentCollectAttachmentUpload.jsp
Normal file
104
WebContent/Tenwa/Apzl/FileUpload/RentCollectAttachmentUpload.jsp
Normal file
@ -0,0 +1,104 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-05-31
|
||||
Content: 示例详情页面
|
||||
History Log:
|
||||
*/
|
||||
String Library_id = CurPage.getParameter("Library_id");
|
||||
|
||||
//定义变量
|
||||
String sObjectNo = "";//--对象编号
|
||||
//获得组件参数
|
||||
String flowNo=CurPage.getParameter("FlowNo");
|
||||
|
||||
String sPrevUrl = CurPage.getParameter("PrevUrl");
|
||||
//if(sPrevUrl == null) sPrevUrl = "/Tenwa/Lease/FamilyVisit/fieldSurvey/FieldSurveyList.jsp";
|
||||
|
||||
String sTempletNo = "RentCollectAttachmentUpload";//--模板号--
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||||
dwTemp.Style = "2";//freeform
|
||||
//dwTemp.ReadOnly = "-2";//只读模式
|
||||
dwTemp.genHTMLObjectWindow(Library_id);
|
||||
String sButtons[][] = {
|
||||
{"true","","Button","保存","保存所有修改","importRecord()","","","",""},
|
||||
{"true","All","Button","取消","返回列表","pull()","","","","btn_icon_close"}
|
||||
};
|
||||
/* sButtonPosition = "south"; */
|
||||
%><%@ 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%>";
|
||||
var sparma="";
|
||||
for(var key in params){
|
||||
sparma=sparma+"<input type=\"text\" name=\""+key+"\" value=\""+params[key]+"\">"
|
||||
}
|
||||
$("#FILE2").append(sparma);
|
||||
$("#myiframe0").attr("action","<%=sWebRootPath%>/Tenwa/Comm/DocList/DocListUploadTwo.jsp?CompClientID=<%=CurComp.getClientID()%>");
|
||||
$("#myiframe0").attr("method","post");
|
||||
});
|
||||
|
||||
var lock = false;
|
||||
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]));
|
||||
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;
|
||||
}
|
||||
if(lock){
|
||||
//锁已经开启,在提交只会被阻断
|
||||
AsDebug.showMessage('提醒:','请勿重复点击','','',true);
|
||||
return false;
|
||||
}else {
|
||||
//锁开启,锁关闭只能是数据被处理完毕或者刷新页面,文档重新加载
|
||||
lock = true;
|
||||
}
|
||||
return o.submit();
|
||||
}
|
||||
function CheckStr(filename){
|
||||
var s="jpg,jpeg,png,bmp,gif,pdf,doc,docx,xls,xlsx,txt";
|
||||
var flag="false";
|
||||
var s2=s.split(",");
|
||||
var filenamelast = filename.lastIndexOf(".");
|
||||
var fileimage = filename.substr(filenamelast+1).toLowerCase();
|
||||
for(var i=0;i<s2.length;i++){
|
||||
if(fileimage==s2[i]){
|
||||
return "true";
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function pull(){
|
||||
// AsControl.OpenView("/Tenwa/Lease/FamilyVisit/fieldSurvey/FieldSurveyList.jsp", "","_self","");
|
||||
parent.AsDialog.ClosePage("_CANCEL_");
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -5,16 +5,17 @@
|
||||
String contractId = CurPage.getParameter("ContractId") != null ? CurPage.getParameter("ContractId") : "";
|
||||
String isRemind = CurPage.getParameter("IsRemind") != null ? CurPage.getParameter("IsRemind") : "";
|
||||
ASObjectModel doTemp = new ASObjectModel("LBFiveGradeClassificationList");
|
||||
String appendSql = "";
|
||||
String appendSql = "";
|
||||
if(!"".equals(contractId)){
|
||||
appendSql += " and O.id = '"+contractId+"' and lccs.Is_Remind = '"+isRemind+"' AND v.DATEDIFF(v.NOW(),lccs.FIVE_GRADE_DATE) <= 3 ";
|
||||
}else if(!"".equals(isRemind)){
|
||||
appendSql += " and lccs.Is_Remind = '"+isRemind+"' AND v.DATEDIFF(v.NOW(),lccs.FIVE_GRADE_DATE) <= 3 ";
|
||||
}
|
||||
String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract");
|
||||
//String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract");
|
||||
String sCondtion="";
|
||||
if(!"".equals(appendSql)) sCondtion += appendSql;
|
||||
doTemp.appendJboWhere(sCondtion);
|
||||
doTemp.setDefaultValue("IS_AUTO", "Y");
|
||||
doTemp.setDefaultValue("IS_AUTO", "Y");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--ÉèÖÃΪGrid·ç¸ñ--
|
||||
dwTemp.ReadOnly = "1"; //Ö»¶Áģʽ
|
||||
@ -54,5 +55,85 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
function afterSearch(){
|
||||
for(var i=0;i<getRowCount(0);i++){
|
||||
getObj(0,i,"operation").innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"id")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';
|
||||
debugger;
|
||||
var filelist=getObj(0,i,"filelist").innerHTML;
|
||||
var obj=eval('('+filelist+')');
|
||||
var html="";
|
||||
for(var file in obj){
|
||||
//if(isReview!="true"&&sRightType!="ReadOnly"&&(sObjectType==obj[file]['objecttype'])&&username.replace(/\s+/g," ")==obj[file]['inputuser']){
|
||||
// html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\');"> </a>';
|
||||
//}
|
||||
if(obj[file]['image']=="true"){
|
||||
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||||
}
|
||||
if(obj[file]['word']=="true"){
|
||||
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||||
}
|
||||
if(obj[file]['pdf']=="true"){
|
||||
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||||
}
|
||||
html+='<a onclick=downloadFile(\''+obj[file]['id']+'\')><font color="blue">'+obj[file]['filename']+'</font></a>';
|
||||
html+='【上传时间:'+obj[file]['inputtime']+'】';
|
||||
html+='【上传人:'+obj[file]['inputuser']+'】';
|
||||
html+='【大小:'+Math.floor(obj[file]['FileSize']/1024*100)/100+'kb】';
|
||||
html+='</br>';
|
||||
|
||||
}
|
||||
getObj(0,i,"filelist").innerHTML=html;
|
||||
getObj(0,i,"filelist").style["white-space"]="pre-wrap";
|
||||
var height = getObj(0,i,"filelist").offsetHeight+1;
|
||||
setItemStyle(0,i,"FULLNAME","height="+height+"px");
|
||||
};
|
||||
}
|
||||
function upload(id){
|
||||
var param="Library_id="+id;
|
||||
var sUrl="/Tenwa/Apzl/FileUpload/AutoFiveAttachmentUpload.jsp";
|
||||
AsDialog.PopView(sUrl,param,"dialogWidth=450px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
|
||||
|
||||
reloadSelf();
|
||||
heping();
|
||||
},"上传附件");
|
||||
}
|
||||
function heping(){
|
||||
$("#TR_Right_myiframe0_0").attr("class","color_zebra0");
|
||||
huanhang("Doc_Name");
|
||||
}
|
||||
function huanhang(col){
|
||||
var tab=document.getElementById("myiframe0");
|
||||
var a= getColIndex(0,col);
|
||||
for(var i=0;i<tab.rows.length-1;i++){
|
||||
$("#INPUT_myiframe0_"+col+"_"+i+"_"+a).parent().attr("style","white-space: pre-wrap;");
|
||||
}
|
||||
}
|
||||
function showPDF(id,name){
|
||||
var sUrl="/Tenwa/Comm/DocList/showPDF.jsp";
|
||||
var param="attrid="+id;
|
||||
AsControl.OpenPage(sUrl,param,"","");
|
||||
}
|
||||
function showWord(id,name){
|
||||
var sUrl="/Tenwa/Comm/DocList/showWord.jsp";
|
||||
var param="attrid="+id;
|
||||
AsControl.OpenPage(sUrl,param,"","");
|
||||
}
|
||||
function showImage(id,name){
|
||||
var sUrl="/Tenwa/Comm/DocList/showImage.jsp";
|
||||
var param="attrid="+id;
|
||||
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;",function(message){
|
||||
|
||||
},name);
|
||||
}
|
||||
function downloadFile(id){
|
||||
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
|
||||
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
|
||||
}
|
||||
function deleteFile(id){
|
||||
var sParams="attId="+id;
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
|
||||
reloadSelf();
|
||||
heping();
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -20,13 +20,13 @@
|
||||
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
|
||||
<%-- <iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
|
||||
</iframe>
|
||||
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
|
||||
<div style="display:none">
|
||||
<input id="sqlString" name=sqlString value="">
|
||||
</div>
|
||||
</form>
|
||||
</form> --%>
|
||||
<script type="text/javascript">
|
||||
function newRecord(){
|
||||
var custid="<%=CurPage.getParameter("cust_id")%>";
|
||||
@ -44,10 +44,10 @@
|
||||
AsControl.OpenView(sUrl,'id=' +sPara+'&cust_id='+custid ,'_self','');
|
||||
}
|
||||
|
||||
//在加载完表格后调用
|
||||
function afterSearch(){
|
||||
for(var i=0;i<getRowCount(0);i++){
|
||||
getObj(0,i,"operation").innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"id")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';
|
||||
debugger;
|
||||
var filelist=getObj(0,i,"filelist").innerHTML;
|
||||
var obj=eval('('+filelist+')');
|
||||
var html="";
|
||||
@ -74,12 +74,12 @@
|
||||
getObj(0,i,"filelist").innerHTML=html;
|
||||
getObj(0,i,"filelist").style["white-space"]="pre-wrap";
|
||||
var height = getObj(0,i,"filelist").offsetHeight+1;
|
||||
setItemStyle(0,i,"CONTRACT_NUMBER","height="+height+"px");
|
||||
setItemStyle(0,i,"FULLNAME","height="+height+"px");
|
||||
};
|
||||
}
|
||||
function upload(id){
|
||||
var param="Library_id="+id;
|
||||
var sUrl="/Tenwa/Comm/DocList/PlateAttachmentUpload.jsp";
|
||||
var sUrl="/Tenwa/Apzl/FileUpload/RentCollectAttachmentUpload.jsp";
|
||||
AsDialog.PopView(sUrl,param,"dialogWidth=450px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
|
||||
|
||||
reloadSelf();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user