apzl_leasing/WebContent/Tenwa/Comm/Document/LBDocumentListInfo.jsp

212 lines
10 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_simplelist.jspf"%>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
<%@page import="com.amarsoft.are.jbo.BizObject"%>
<%@page import="com.amarsoft.are.jbo.JBOException"%>
<%@page import="com.amarsoft.are.jbo.JBOFactory"%>
<%@page import="jbo.sys.FLOW_OBJECT"%>
<%
/*
Author: undefined 2016-09-01
Content:
History Log:
*/
String flowunid=CurPage.getParameter("ObjectNo");
String sObjectType=CurPage.getParameter("FlowNo");
String proj_id = CurPage.getParameter("proj_id");
String contract_id = CurPage.getParameter("contract_id");
String query = CurPage.getParameter("query");//用于区别是不是合同查询时查询附件
String isProduct = "Y";//是否产品相关流程YN:否
if(proj_id==null||contract_id==null){
isProduct = "N";
}
String type=CurPage.getParameter("type");
if(type==null)type="";
if("MortgageFileMailFlow".equals(sObjectType)){
type = "MortgageFileMailFlow";
}
String otherWhere="";
String sTempletNo = "LBDocumentList";//--模板号--
//如果是从合同查询过来的变更模板号和O.OBJECTTYPE查询条件
if("query".equals(query)){
sTempletNo="LBDocumentQueryList";
otherWhere = " and O.OBJECTTYPE in ('BusinessApplyFlow','FundPaymentCarFlow','MortgageFileFlow') ";
}
if(type==""){
if("BusinessChangeFlow".equals(sObjectType)){
sTempletNo="ChangeFlowLBDocumentList";
String ProjectId = Sqlca.getString("SELECT proj_id FROM flow_bussiness_object WHERE flow_unid='"+flowunid+"'");
otherWhere = " and O.proj_id='"+ProjectId+"' and (O.objecttype='"+sObjectType+"' or O.objecttype='BusinessApplyFlow')";
}else if("BContractApproveFlow".equals(sObjectType)){
sTempletNo="ChangeFlowLBDocumentList";
String ProjectId = Sqlca.getString("SELECT proj_id FROM flow_bussiness_object WHERE flow_unid='"+flowunid+"'");
otherWhere = " and O.proj_id='"+ProjectId+"' and (O.objecttype='"+sObjectType+"' or O.objecttype='BusinessApplyFlow' or O.objecttype='BusinessChangeFlow')";
}else if("BContractChangeFlow".equals(sObjectType)){
sTempletNo="ChangeFlowLBDocumentList";
String ProjectId = Sqlca.getString("SELECT proj_id FROM flow_bussiness_object WHERE flow_unid='"+flowunid+"'");
otherWhere = " and O.proj_id='"+ProjectId+"' and (O.objecttype='"+sObjectType+"' or O.objecttype='BusinessApplyFlow' or O.objecttype='BusinessChangeFlow' or O.objecttype='BContractApproveFlow' )";
}else{
BizObject flow=GetFlowAction.getFlowBussinessObject(flowunid);//流程对象
otherWhere= otherWhere+DocListInitAction.getFlowWhere(flow,"","O");
}
//otherWhere=" and O.proj_id='"+proj_id+"' order by O.INPUTTIME DESC";
}else if("proj".equals(type)){
otherWhere= otherWhere+" and O.proj_id='"+proj_id+"' order by O.INPUTTIME DESC";
}else if("contract".equals(type)){
otherWhere= otherWhere+" and (O.contract_id='"+contract_id+"' OR O.proj_id='"+proj_id+"') ";
}else if("MortgageFileMailFlow".equals(type)){
otherWhere = "AND v.EXISTS (select 1 from jbo.app.tenwa.doc.LB_FILE_MAILARCHIVING_INFO_TEMP lfmit where lfmit.contract_id = O.CONTRACT_ID and lfmit.flowunid = '"+flowunid+"' ) ";
}
String isHistory=CurPage.getParameter("IsHistory");
String RightType=CurPage.getParameter("RightType");
String userName=CurUser.getUserName();
String compClientID = request.getParameter("CompClientID");
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.appendJboWhere(otherWhere);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.MultiSelect=true;//多选
dwTemp.setPageSize(50);
dwTemp.genHTMLObjectWindow(sObjectType);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] =null;
if(!"BusinessApplyFlow".equals(sObjectType) && !"BusinessChangeFlow".equals(sObjectType) && !"BContractApproveFlow".equals(sObjectType)&& !"BContractChangeFlow".equals(sObjectType) && ((RightType!=null&&RightType.equals("ReadOnly"))||(null!=isHistory&&isHistory.equals("true")))){
RightType="ReadOnly";
sButtons=new String[][]{
};
}else{
sButtons=new String[][]{
{"true","All","Button","上传","上传","upload()","","","","btn_icon_up"},
{"true","","Button","批量下载","批量下载","downloadZipFile()","","","","btn_icon_down"},
};
}
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
window.onload=function(){
$("#DWTD").width( document.body.offsetWidth - 10);
$("#DWTD").width( document.body.offsetHeight - 20);
//document.getElementById('DWTD').innerHTML = '<div style="width:'+(document.body.offsetWidth - 10)+'px;height:'+(document.body.offsetHeight - 50)+';overflow: scroll;">'+document.getElementById('DWTD').innerHTML+'</div>';
$("#Table_Content_0").attr("style","overflow: scroll;overflow-y:auto; overflow-x:auto;height:440px;");
}
//在加载完表格后调用
function afterSearch(){
var isHistory="<%=isHistory%>";
var rightType="<%=RightType%>";
var userName="<%=userName%>";
var sObjectType="<%=sObjectType%>";//该流程类型
for(var i=0;i<getRowCount(0);i++){
var filelist=getObj(0,i,"filelist").innerHTML;
var obj=eval('('+filelist+')');
var html="";
for(var file in obj){
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】<a class="btn_icon_detail" onclick="editOffice(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\',\''+obj[file]['inputuser']+'\')">&nbsp;</a> ';
if(rightType!='ReadOnly'&&isHistory!="true"&&sObjectType==obj[file]['objecttype']&&userName==obj[file]['inputuser']){
//html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\')">&nbsp;</a>';
}
if(obj[file]['image']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['word']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['pdf']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
html+='</br>';
}
getObj(0,i,"filelist").innerHTML=html;
getObj(0,i,"filelist").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="+(parent.innerWidth-100)+"px;dialogHeight="+(parent.innerHeight+80)+"px;",function(message){
},name);
}
function editOffice(id,filename,inputuser){
var filetype=filename.substr(filename.indexOf(".")+1);
var isHistory="<%=isHistory%>";
var userName="<%=userName%>";
var status=1;
if(isHistory=="true"&&userName==inputuser){
status=2;
}
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/OnlineOperation/online/editOfficeOnLine.jsp","filetype="+filetype+"&status="+status+"&id="+id+"&CompClientID=<%=compClientID%>","dialogWidth=1024px;dialogHeight=1000px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(sPhaseInfo){
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") {
return;
}else if(sPhaseInfo == "Success" || sPhaseInfo == "success"){
alert("提交成功!");
reloadSelf();
}else{
alert("提交失败!");
}
},"编辑文档");
}
function upload(){
var id=getItemValue(0,getRow(),"id");
var sDocType=getItemValue(0,getRow(),"doc_Type");
var sOneClassify=getItemValue(0,getRow(),"one_Classify");
var sTwoClassify=getItemValue(0,getRow(),"Two_Classify");
var isProduct = "isProduct=<%=isProduct%>";
if(typeof(id)=="undefined")id="";
if(typeof(sDocType)=="undefined")sDocType="";
if(typeof(sOneClassify)=="undefined")sOneClassify="";
if(typeof(sTwoClassify)=="undefined")sTwoClassify="";
var param="Library_id="+id+"&DocType="+sDocType+"&TwoClassify="+sTwoClassify+"&OneClassify="+sOneClassify;
param+="&flowunid=<%=flowunid%>&ObjectType=<%=sObjectType%>&"+isProduct;
var sUrl="/Tenwa/Comm/Document/LBDocumentInfo.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
reloadSelf();
AsControl.OpenView("/Tenwa/Comm/Document/DocImageShow.jsp","","frameright","");
},"上传附件");
}
function deleteFile(id){
if(confirm("是否删除?")){
var sParams="attId="+id;
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
reloadSelf();
};
}
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 downloadZipFile(){
var id=getItemValueArray(0,'Id')+"";
var ids=id.replace(/\,/g,"@");
var filePath="<%=CurConfig.getConfigure("FileSavePath")%>";
<%-- var param="&flowunid=<%=flowunid%>&type=<%=type%>&proj_id=<%=CurPage.getParameter("proj_id")%>&contract_id=<%=CurPage.getParameter("contract_id")%>"; --%>
var param="&flowunid=<%=flowunid%>&type=<%=type%>&ids="+ids;
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docFlowDownloadZipServlet?CompClientID=<%=sCompClientID%>&filePath="+filePath+param, "downloadTemplate");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>