放款后督新增放款申请的资料清单页签

This commit is contained in:
zhanglei 2020-12-03 11:50:13 +08:00
parent 01cda97df6
commit cb2a24fafa

View File

@ -0,0 +1,273 @@
<%@ 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 flowunid="";
String contractId = CurPage.getParameter("ContractId");
System.out.println("contractId=" + contractId);
//将空值转化为空字符串
if(contractId==null)contractId="";
BizObjectManager ftManager = JBOFactory.getBizObjectManager("jbo.sys.FLOW_TASK");
BizObjectManager fbo = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
List<BizObject> opinionList = new ArrayList<BizObject>();
BizObject fboRes = fbo.createQuery("flow_name=:flow_name and contract_id=:contract_id").setParameter("contract_id", contractId).setParameter("flow_name", "付款申请(汽车)").getSingleResult(false);
if(null != fboRes) {
flowunid = fboRes.getAttribute("flow_unid").getString();
}
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 = "FundPaymentCarFlow";//付款申请
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=CurPage.getParameter("docList");
// String docClassItemno=CurPage.getParameter("docList");
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");
Map<String,String> docParam=new HashMap<String,String>();
Map<String,String> other=new HashMap<String,String>();
other.put("carAttributes", carAttributes);
other.put("CustomerType", CustomerType);
docParam.put("ObjectType",sObjectType);
docParam.put("proj_id", flow.getAttribute("proj_id").getString());
docParam.put("contract_id", flow.getAttribute("contract_id").getString());
docParam.put("flow_unid", flowunid);
docParam.put("inputtime", StringFunction.getTodayNow());
docParam.put("inputuserid", CurPage.getUserId());
docParam.put("inputorgid", CurPage.getUser().getOrgID());
String projectId = flow.getAttribute("proj_id").getString();
//判断是否存在,不存在就从配置表倒到临时表
//DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig);
ASObjectModel doTemp = new ASObjectModel("FlowPayDocList");
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
doTemp.setVisible("operation", false);
String otherWhere=DocListInitAction.getHistoryFlowWhere(flow,"rela");
System.out.println(otherWhere);
doTemp.appendJboWhere(DocListInitAction.getHistoryFlowWhere(flow,"rela"));
}else{
//判断是否存在,不存在就从配置表倒到临时表
DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig);
String otherWhere=DocListInitAction.getFlowWhere(flow,"","rela");
doTemp.appendJboWhere(otherWhere);
doTemp.appendJboWhere(" and O.doc_Class_Itemno in ("+s+")");
}
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+'\')">&nbsp;</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']+'\');">&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";
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"%>