170 lines
6.8 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_list.jspf"%>
<%
String sFileSaveMode = CurConfig.getConfigure("FileSaveMode");
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
String sFileNameType = CurConfig.getConfigure("FileNameType");
String flag = "false";
String flagReadOnly = "1";
if(CurUser.hasRole("800R00000034")){
flag = "true";
flagReadOnly = "0";
}
ASObjectModel doTemp = new ASObjectModel("CompanyLoanList");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
ASDataObject ado = dwTemp.getDataObject();
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.MultiSelect = true; //多选
dwTemp.ReadOnly = flagReadOnly; //只读模式
// dwTemp.ShowSummary = "1"; //显示小计
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow("");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{flag,"All","Button","保存","保存批次号","as_save(0)","","","","",""},
{flag,"All","Button","批量修改","批量修改","batch_edit()","","","","",""},
{"true","All","Button","批量上传","批量上传","upload('')","","","","",""},
{"true","All","Button","导出明细","导出明细","createFundIncomeExcel()","","","","",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
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=1080px;dialogHeight=500px;",function(message){
},name);
}
//在加载完表格后调用
function afterSearch(){
var sRightType="";
var sObjectType="";//该流程类型
var isReview="";
var username="";
for(var j=0;j<5;j++){
if(j==0){
type = "car_money";
}else if (j==1){
type = "handling_charge_money_temp";
}else if (j==2){
type = "purchase_tax_temp";
}else if (j==3){
type = "insurance_premium_temp";
}else if (j==4){
type = "incidental_temp";
}
for(var i=0;i<getRowCount(0);i++){
//if(getObj(0,i,"car_money")!=null&&getObj(0,i,"car_money")!="null"){
getObj(0,i,type).innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"id")+'\',\''+type+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';
//}
var filelist=getObj(0,i,type+"_file").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']+'】';
<%-- 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,type+"_file").innerHTML=html;
getObj(0,i,type+"_file").style["white-space"]="pre-wrap";
$('#Left_TD_myiframe0 tr[tableid]').each(function(index,element){
$(element).css('height',$('#TR_Right_myiframe0_'+index+'').css('height'))
})
};
};
}
//上传功能
function upload(id,fileType){
var ids=getItemValueArray(0,"id");
if(typeof(id)!="undefined" && id!=null && id.length>0){
ids = id;
}else if(typeof(ids)=="undefined"||ids==null||ids==""){
alert("请选择数据!");
return;
}
var param="Library_id="+ids+"&fileType="+fileType;
var sUrl="/Tenwa/Comm/Document/LoanLBDocumentInfo.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
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 batch_edit(){
var rows = getCheckedRows(0);
AsDialog.PopView("/Tenwa/Lease/Flow/CollectionAudit/CompanyLoanBactchEdit.jsp","","dialogWidth=800px;dialogHeight=350px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(data){
if(data.length==0){
return;
}
for(var i=0;i<rows.length;i++){
for (var key in data){
if(typeof(data[key])=="undefined"||""==data[key]){
continue;
}
setItemValue(0,rows[i],key,data[key]);
}
}
as_save(0);
},"批量修改");
}
function createFundIncomeExcel(){
var param={};
var tempParam={};
var sparam="";
param["templateNo"]="f4c9efd00c394b35985aa4833c5f7efd";//选择的模板ID
tempParam["OBJECTTYPE"]="ActualPaymentCarApply";
tempParam["FLOW_UNID"]="123";
tempParam["CurUserId"]="<%=CurUser.getUserID()%>"
tempParam["fileSaveMode"]="<%=sFileSaveMode%>";
tempParam["fileSavePath"]="<%=sFileSavePath%>";
tempParam["fileNameType"]="<%=sFileNameType%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
if(result!="success"){
alert("导出失败!");
return;
}else{
var attributeID = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/BatchIncome/GetLBDocAttributeID.jsp",
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]);
downloadFile(attributeID);
reloadSelf();
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>