2019-08-23 11:38:27 +08:00

313 lines
12 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.tenwa.doc.action.DocListInitAction" %>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%
/*
Author: undefined 2016-09-01
Content:
History Log:
*/
String flowunid=CurPage.getParameter("FlowUnid");
String CustomerType=CurPage.getParameter("CustomerType");
String contract_id=CurPage.getParameter("contract_id");
String type=CurPage.getParameter("type");
String carAttributes=CurPage.getParameter("carAttributes");//获取车类型
if(flowunid==""||flowunid==null){
flowunid="flowunid";
}
BizObject flow=GetFlowAction.getFlowBussinessObject(flowunid);//流程对象
String sObjectType = CurPage.getParameter("FlowNo");//流程类型
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String RightType= CurPage.getParameter("RightType");
String username=CurUser.getUserName();
String sTempletNo=CurPage.getParameter("TempletNo");
String phaseNo = CurPage.getParameter("PhaseNo");
String apply = CurPage.getParameter("ApplyType");
String docClassItemno=CurPage.getParameter("docList");
String s="";
if(!"his".equals(type)){
String[] itemnos=docClassItemno.split(",");
for(int i=0;i<itemnos.length;i++){
s+="'"+itemnos[i]+"',";
}
if(s.length()>0){
s=s.substring(0, s.length()-1);
}
}
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", contract_id);
docParam.put("flow_unid", flowunid);
docParam.put("inputtime", StringFunction.getTodayNow());
docParam.put("inputuserid", CurPage.getUserId());
docParam.put("inputorgid", CurPage.getUser().getOrgID());
ASObjectModel doTemp = null;
//判断是否存在,不存在就从配置表倒到临时表
if(!"his".equals(type)){
DocListInitAction.initDocListForMail(docParam,other,docClassItemno,CurConfig,Sqlca);
doTemp = new ASObjectModel("FlowPayMailDocList");
}else{
doTemp = new ASObjectModel("FlowPayMailDocHisList");
}
if("0010".equals(CurPage.getParameter("PhaseNo"))&&!"his".equals(type)){
doTemp.setVisible("HANDOVERSTATUS", false);
}
if("0020".equals(CurPage.getParameter("PhaseNo"))){
doTemp.setVisible("operation", false);
}
if("his".equals(type)){
doTemp.setVisible("operation", false);
doTemp.appendJboWhere("and rela.proj_id=:contractid and rela.OBJECTTYPE in('BusinessApplyFlow','FundPaymentCarFlow','MortgageFileFlow')");
}else{
doTemp.appendJboWhere("and rela.contract_id=:contractid and rela.OBJECTTYPE ='MortgageFileMailFlow'");
doTemp.appendJboWhere(" and O.doc_Class_Itemno in ("+s+") and lmdt.flowunid ='"+flowunid+"'");
}
doTemp.setLockCount(2);
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
doTemp.setVisible("operation", false);
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "0";
dwTemp.setPageSize(500);
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "1";//只读模式
RightType="ReadOnly";
isShowButton=false;
}else{
isShowButton=true;
}
dwTemp.genHTMLObjectWindow(contract_id);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] =null;
sButtons=new String[][]{
{"0010".equals(CurPage.getParameter("PhaseNo"))&&!"his".equals(type)?"true":"false","","Button","保存","保存所有修改","0010".equals(CurPage.getParameter("PhaseNo"))?"saveRecord()":"saveRecordForApprove()","","","",""},
};
%>
<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(){
for(var i=0;i<getRowCount(0);i++){
var ATTRIBUTE1 = getItemValue(0,i,'ATTRIBUTE1');
if("1"==ATTRIBUTE1||"0020"=="<%=CurPage.getParameter("PhaseNo")%>"){
$(getObj(0,i,"MAILSTATUS")).attr("disabled","disabled");
}
}
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(){
//true:全部邮寄 false:部分邮寄 error未邮寄
/* for(var k=0;k<getRowCount(0);k++){
var filelist = getItemValue(0,k,'filelist');
var MAILSTATUS = getItemValue(0,k,'MAILSTATUS');
if("all"==MAILSTATUS&&filelist=="{}"){
alert("标记为已邮寄的须上传相应附件!");
return;
}
if(filelist!="{}"&&"all"!=MAILSTATUS){
alert("已上传相应附件须将状态标记为已邮寄,如误上传请删除!");
return;
}
} */
var allstatus = "all";
var j = 0;
for(var i=0;i<getRowCount(0);i++){
var Doc_Nature = getItemValue(0,i,'Doc_Nature');
var id = getItemValue(0,i,'id');
var MAILSTATUS = getItemValue(0,i,'MAILSTATUS');
if("01"==Doc_Nature&&"all"!=MAILSTATUS){
allstatus = "part";
}
if("all"!=MAILSTATUS){
j++
}
if(j==getRowCount(0)){
allstatus = "none";
}
var param="MailStatus="+MAILSTATUS+",libraryid="+id+",flowunid=<%=flowunid%>,AllStatus="+allstatus+",contractid=<%=contract_id%>";
var str=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.DocMailAction","asSaveMailStatus",param);
}
location.reload();
alert('保存成功!');
}
function saveRecordForApprove(){
//true:全部归档 false:部分归档 error未归档
var allstatus = "all";
var j = 0;
for(var i=0;i<getRowCount(0);i++){
var Doc_Nature = getItemValue(0,i,'Doc_Nature');
var id = getItemValue(0,i,'id');
var MAILSTATUS = getItemValue(0,i,'HANDOVERSTATUS');
if("01"==Doc_Nature&&"all"!=MAILSTATUS){
allstatus = "part";
}
if("all"!=MAILSTATUS){
j++
}
if(j==getRowCount(0)){
allstatus = "none";
}
var param="MailStatus="+MAILSTATUS+",libraryid="+id+",flowunid=<%=flowunid%>,AllStatus="+allstatus+",contractid=<%=contract_id%>";
var str=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.DocMailAction","asSaveHandOverStatus",param);
}
location.reload();
alert('保存成功!');
}
//在加载完表格后调用
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"&&"1"!=getItemValue(0,i,'ATTRIBUTE1')&&"0020"!="<%=CurPage.getParameter("PhaseNo")%>"){
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']&&"1"!=getItemValue(0,i,'ATTRIBUTE1')){
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+"_3").text()=="必备"){
$("#INPUT_myiframe0_Doc_Nature_"+i+"_3").attr("style","color:red");
}
};
for(var i=0;i<getRowCount(0);i++){
var ATTRIBUTE1 = getItemValue(0,i,'ATTRIBUTE1');
if("1"==ATTRIBUTE1||"0020"=="<%=CurPage.getParameter("PhaseNo")%>"){
$(getObj(0,i,"MAILSTATUS")).attr("disabled","disabled");
}
};
}
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/Apzl/FileUpload/showImage.jsp";
var param="attrid="+id+"&contract_id=<%=contract_id%>&type=<%=type%>";
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 checkfile(){
var fileName = "" ;
for(var k=0;k<getRowCount(0);k++){
var filelist = getItemValue(0,k,'HANDOVERSTATUS');
if("none"==filelist){
fileName = fileName + getItemValue(0,k,'Doc_Name')+";";
}
}
if(fileName.length > 0){
alert(fileName+"未归档,请检查!");
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>