254 lines
10 KiB
Plaintext
254 lines
10 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_simplelist.jspf"%>
|
||
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
|
||
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
|
||
<%@ page import="com.amarsoft.app.util.ProductParamUtil" %>
|
||
<%@ page import="jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT" %>
|
||
<%
|
||
/*
|
||
Author: undefined 2016-09-01
|
||
Content:
|
||
History Log:
|
||
*/
|
||
String objectno = CurPage.getParameter("FlowUnid");
|
||
String flowunid="";
|
||
String contractId = CurPage.getParameter("ContractId");
|
||
String projectId = CurPage.getParameter("ProjectId");
|
||
System.out.println("contractId=" + contractId);
|
||
//将空值转化为空字符串
|
||
BizObjectManager fbo = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
|
||
|
||
String sSql = " select ldl.flow_unid " +
|
||
" from LB_DOCLIBRARY ld " +
|
||
" LEFT JOIN LB_DOCRELATIVE ldl on ld.relative_id=ldl.id " +
|
||
" where ldl.proj_id='"+ projectId +"' and ldl.objecttype='FundPaymentCarFlow' and ldl.flow_unid <> '"+objectno+"' " +
|
||
" GROUP BY ldl.flow_unid ";
|
||
ASResultSet rs = null;
|
||
rs = Sqlca.getASResultSet(sSql);
|
||
while (rs.next()) {
|
||
flowunid = DataConvert.toString(rs.getString("flow_unid"));
|
||
}
|
||
rs.getStatement().close();
|
||
|
||
String flowstate=CurPage.getParameter("flowstate");
|
||
String CustomerType=CurPage.getParameter("CustomerType");
|
||
String carAttributes=CurPage.getParameter("carAttributes");//获取车类型
|
||
if(flowunid==""||flowunid==null){
|
||
flowunid="flowunid";
|
||
}
|
||
|
||
BizObject flow=GetFlowAction.getFlowBussinessObject(flowunid);//流程对象
|
||
|
||
String sObjectType = "FlowPayDocListDelete";//付款申请
|
||
|
||
String ishistory=CurPage.getParameter("IsHistory");
|
||
String nodeNo=CurPage.getParameter("NodeNo");
|
||
String RightType= "ReadOnly";
|
||
String username=CurUser.getUserName();
|
||
String phaseNo = CurPage.getParameter("PhaseNo");
|
||
String apply = CurPage.getParameter("ApplyType");
|
||
|
||
String type= "fundPay";
|
||
if(type==null)type="";
|
||
|
||
List<Object> list = ProductParamUtil.getProductDocInfo(CurPage.getParameter("ProductId"),"PRD0412");//方案类型
|
||
String types="";
|
||
String docList="";
|
||
for(int i=0;i<list.size();i++){
|
||
Map<String,Object> map=(Map<String,Object>)list.get(i);
|
||
if(sObjectType.equals(map.get("FLOW_INFO").toString())){
|
||
types=map.get("TYPE").toString();
|
||
if("SingleRow".equals(types)){
|
||
docList=map.get("DOCLIST").toString();
|
||
}else{
|
||
List l=(List)map.get("DOCCONFIG");
|
||
docList=l.toString();
|
||
}
|
||
}
|
||
}
|
||
String docClassItemno=docList;
|
||
|
||
String[] itemnos=docClassItemno.split(",");
|
||
String s="";
|
||
String classItemno ="";
|
||
for(int i=0;i<itemnos.length;i++){
|
||
s+="'"+itemnos[i]+"',";
|
||
}
|
||
if(s.length()>0){
|
||
s=s.substring(0, s.length()-1);
|
||
classItemno = s.replace(",", "@");
|
||
}
|
||
String compClientID = request.getParameter("CompClientID");
|
||
|
||
ASObjectModel doTemp = new ASObjectModel("FlowPayDocListDelete");
|
||
doTemp.setVisible("operation", false);
|
||
// String otherWhere = "and rela.proj_id='"+ projectId +"'and rela.flow_unid='"+ flowunid +"' and rela.objecttype='FundPaymentCarFlow'";
|
||
// String otherWhere = and rela.proj_id='4e0962e029a8473492f784732a004e2e' and (rela.contract_id='' or rela.contract_id is null or rela.contract_id='d6bd7d316ea24b7bbfad1bc9f83b2b56') ;
|
||
String otherWhere = "and rela.proj_id='"+ projectId +"' and rela.objecttype='FundPaymentCarFlow'";
|
||
doTemp.appendJboWhere(otherWhere);
|
||
doTemp.setLockCount(2);
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||
dwTemp.Style="1"; //--设置为Grid风格--
|
||
dwTemp.ReadOnly = "1";//只读模式
|
||
isShowButton=false;
|
||
dwTemp.setPageSize(500);
|
||
dwTemp.genHTMLObjectWindow(flowunid);
|
||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||
String sButtons[][] =null;
|
||
|
||
sButtons=new String[][]{
|
||
{"true","","Button","保存","保存所有修改","saveRecord()","","","",""},
|
||
{"true","","Button","批量下载","批量下载","downloadZipFile()","","","","btn_icon_down"},
|
||
};
|
||
|
||
%>
|
||
<script type="text/javascript">
|
||
var rowSpan="One_Classify";
|
||
</script>
|
||
<%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||
<script type="text/javascript">
|
||
|
||
window.onload=function(){
|
||
/* var RowCount = getRowCount(0);
|
||
for(var i=0;i<RowCount;i++){
|
||
if($("#INPUT_myiframe0_Doc_Nature_"+i+"_2").text()=="必备"){
|
||
$("#INPUT_myiframe0_Doc_Nature_"+i+"_2").attr("style","color:red");
|
||
}
|
||
} */
|
||
|
||
heping();
|
||
$("#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 - 40)+'px;overflow: scroll;">'+document.getElementById('DWTD').innerHTML+'</div>';
|
||
}
|
||
function heping(){
|
||
$("#TR_Right_myiframe0_0").attr("class","color_zebra1");
|
||
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 selectFile(){
|
||
objectinfo={};
|
||
objectinfo.title="附件一览"
|
||
AsControl.OpenTab("/Tenwa/Comm/Document/LBDocumentList.jsp","ObjectNo=20170427000001",objectinfo);
|
||
}
|
||
function saveRecord(){
|
||
as_save("myiframe0","heping()");
|
||
location.reload();
|
||
}
|
||
//在加载完表格后调用
|
||
function afterSearch(){
|
||
var sRightType="<%=RightType%>";
|
||
var sObjectType="<%=sObjectType%>";//该流程类型
|
||
var isReview="<%=CurPage.getParameter("isReview")%>";
|
||
var username="<%=username%>";
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
if(getObj(0,i,"operation")!=null&&getObj(0,i,"operation")!="null"){
|
||
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>';
|
||
}
|
||
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']+'\',\''+sRightType+'\')"> </a> ';
|
||
if(isReview!="true"&&sRightType!="ReadOnly"&&(sObjectType==obj[file]['objecttype'])&&username==obj[file]['inputuser']&&"ANYBACK"!="<%=flowstate%>"){
|
||
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";
|
||
if($("#INPUT_myiframe0_Doc_Nature_"+i+"_2").text()=="必备"){
|
||
$("#INPUT_myiframe0_Doc_Nature_"+i+"_2").attr("style","color:red");
|
||
}
|
||
};
|
||
}
|
||
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+"&flowunid=<%=flowunid%>";
|
||
AsDialog.PopView(sUrl,param,"dialogWidth=1080px;dialogHeight=500px;",function(message){
|
||
|
||
},name);
|
||
}
|
||
function editOffice(id,filename){
|
||
var filetype=filename.substr(filename.indexOf(".")+1);
|
||
var 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(id){
|
||
//saveRecord();
|
||
|
||
var param="Library_id="+id + "&ObjectType=<%=sObjectType%>";
|
||
var sUrl="/Tenwa/Comm/DocList/DocListInfoNew.jsp";
|
||
AsDialog.PopView(sUrl,param,"dialogWidth=800px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
|
||
var str=RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","updateBussinessCheck","library_id="+id+",BussinessCheck=DocCheck_0");
|
||
reloadSelf();
|
||
// location.reload();
|
||
heping();
|
||
},"上传附件");
|
||
}
|
||
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+",BussinessCheck=DocCheck_2";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
|
||
reloadSelf();
|
||
heping();
|
||
}
|
||
function downloadZipFile(){
|
||
var objectType="<%=sObjectType%>";
|
||
var projectId="<%=projectId%>";
|
||
var classItemnos="<%=classItemno%>";
|
||
var sParams="projectId="+projectId+",classItemnos="+classItemnos+",objectType="+objectType;
|
||
var ids = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","getLibraryIds",sParams);
|
||
var filePath="<%=CurConfig.getConfigure("FileSavePath")%>";
|
||
var param="&flowunid=<%=flowunid%>&type=<%=type%>&ids="+ids+"&proj_id="+projectId;
|
||
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"%> |