184 lines
7.9 KiB
Plaintext
184 lines
7.9 KiB
Plaintext
<%@ 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" %>
|
||
<%
|
||
/*
|
||
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 isProduct = "Y";//是否产品相关流程Y:是,N:否
|
||
if(proj_id==null||contract_id==null){
|
||
isProduct = "N";
|
||
}
|
||
String type=CurPage.getParameter("type");
|
||
if(type==null)type="";
|
||
|
||
String otherWhere="";
|
||
|
||
if(type==""){
|
||
BizObject flow=GetFlowAction.getFlowBussinessObject(flowunid);//流程对象
|
||
otherWhere=DocListInitAction.getFlowWhere(flow,"","O");
|
||
//otherWhere=" and O.proj_id='"+proj_id+"' order by O.INPUTTIME DESC";
|
||
}else if("proj".equals(type)){
|
||
otherWhere=" and O.proj_id='"+proj_id+"' order by O.INPUTTIME DESC";
|
||
}else if("contract".equals(type)){
|
||
otherWhere=" and (O.contract_id='"+contract_id+"' OR O.proj_id='"+proj_id+"') order by O.INPUTTIME DESC";
|
||
}
|
||
|
||
|
||
String isHistory=CurPage.getParameter("IsHistory");
|
||
String RightType=CurPage.getParameter("RightType");
|
||
String userName=CurUser.getUserName();
|
||
|
||
|
||
String compClientID = request.getParameter("CompClientID");
|
||
ASObjectModel doTemp = new ASObjectModel("LBDocumentList");
|
||
|
||
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("");
|
||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||
String sButtons[][] =null;
|
||
if((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;"); */
|
||
}
|
||
//在加载完表格后调用
|
||
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']+'\')"> </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']+'\')"> </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+='</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"%> |