194 lines
7.6 KiB
Plaintext
194 lines
7.6 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
|
||
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
|
||
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
|
||
<%@ page import="com.amarsoft.app.util.*" %>
|
||
|
||
<%
|
||
String userId = CurUser.getUserID();
|
||
String orgId =CurUser.getOrgID();
|
||
System.out.print(orgId);
|
||
String falg = "true";
|
||
String flowunid = CurPage.getParameter("FlowUnid");
|
||
BizObject condition = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
|
||
String projectId = condition.getAttribute("PROJECT_ID").getString();
|
||
String contractId = condition.getAttribute("CONTRACT_ID").getString();
|
||
BizObject lrdBo = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LB_RENT_DORMANT","FLOWUNID=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
|
||
String contractNo = "";
|
||
if(lrdBo != null){
|
||
contractNo = lrdBo.getAttribute("rent_dormant_num").getString();
|
||
}
|
||
String compClientID = request.getParameter("CompClientID");
|
||
ASObjectModel doTemp = new ASObjectModel("RentDormantFile");
|
||
doTemp.setDefaultValue("FlowUnid", flowunid);
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||
dwTemp.Style="1"; //--设置为Grid风格--
|
||
dwTemp.ReadOnly = "1";
|
||
dwTemp.setPageSize(15);
|
||
dwTemp.MultiSelect = true;
|
||
dwTemp.genHTMLObjectWindow(flowunid);
|
||
|
||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||
String sButtons[][] =null;
|
||
sButtons=new String[][]{
|
||
// {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
|
||
{falg,"All","Button","休眠还款协议生成","休眠还款协议生成","generateQuotation()","","","","btn_icon_generate"},
|
||
// {"true","All","Button","批量下载","批量下载","lotdown()","","","","btn_icon_down"},
|
||
// {falg,"All","Button","公司盖章","公司盖章","stamp()","","","",""},
|
||
};
|
||
%>
|
||
|
||
<%/*~BEGIN~不可编辑区~[Editable=false;CodeAreaID=List05;Describe=主体页面;]~*/%>
|
||
<%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||
<%/*~END~*/%>
|
||
|
||
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
|
||
<div style="display:none">
|
||
<input id="sqlString" name="sqlString" value="">
|
||
</div>
|
||
</form>
|
||
|
||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List06;Describe=定义按钮事件;]~*/%>
|
||
<script type="text/javascript">
|
||
//在加载完表格后调用
|
||
function afterSearch(){
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
var html="";
|
||
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"ID")+'\')><font color="blue">'+"下载     "+'</font></a>';
|
||
getObj(0,i,"FILENAME").innerHTML=html+'<font >'+getObj(0,i,"FILENAME").innerHTML+'</font>';
|
||
};
|
||
}
|
||
function downloadFile(id){
|
||
if(typeof(id)==undefined || id=='') {
|
||
alert("请先生成休眠还款协议再下载!");
|
||
return;
|
||
}
|
||
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 lotdown(){
|
||
var attrids=getItemValueArray(0,"ID");
|
||
if(typeof(attrids)=="undefined"||attrids==null||attrids==""){alert("请选择");return;}
|
||
for( var i=0;i<attrids.length;i++){
|
||
if(typeof(attrids[i])=="undefined"||attrids[i]==null||attrids[i]==""){
|
||
alert("请先生成保险理赔委托书再下载!");
|
||
return;
|
||
}
|
||
}
|
||
lotdownloadFile(attrids);
|
||
}
|
||
function lotdownloadFile(id){
|
||
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
|
||
window.open(sWebRootPath+"/servlet/view/DownloadZipServlet?CompClientID=<%=sCompClientID%>&id="+id, "downloadTemplate");
|
||
}
|
||
/**
|
||
* 生成休眠还款协议
|
||
*/
|
||
function generateQuotation(){
|
||
var contract_no="<%=contractNo%>";
|
||
if(contract_no == ''){
|
||
alert("请先进行休眠调整,生成休眠还款协议编号!");
|
||
return;
|
||
}
|
||
var param={};
|
||
var tempParam={};
|
||
var sparam="";
|
||
//模板号
|
||
var tempId = "11b12cbfd98611eb970e00163e0ad611";
|
||
var flowUnid = "<%=flowunid%>";
|
||
param["templateNo"]= tempId;
|
||
//文件类型:保险授权委托书
|
||
var objectType = "contractRentDormant";
|
||
//生成文件关联关系
|
||
tempParam["OBJECTTYPE"]=objectType;
|
||
tempParam["contract_no"]=contract_no;
|
||
tempParam["contract_id"]=contract_no;
|
||
tempParam["project_id"]=contract_no;
|
||
tempParam["PROJ_ID"]="<%=projectId%>";//注意变量名,不要改
|
||
tempParam["CONTRACT_ID"]="<%=contractId%>";//注意变量名,不要改
|
||
tempParam["CUST_ID"]=contract_no;//注意变量名,不要改
|
||
tempParam["PLAN_NUMBER"]=contract_no;//注意变量名,不要改
|
||
tempParam["FLOW_UNID"]=flowUnid;
|
||
//生成模板固定参数
|
||
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
|
||
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
|
||
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
|
||
|
||
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
|
||
for(var key in param){
|
||
if(sparam.length>0){sparam+=",";}
|
||
sparam+=key+"="+param[key];
|
||
}
|
||
var deleteresult=RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantDeleteAction", "deleteRentDormant", "planNumber="+contract_no+",objectType="+objectType);
|
||
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate", sparam);
|
||
// word转pdf
|
||
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantSignAction","wordToPdfRentDormant","contractNo="+contract_no+",contractId="+contract_no+",projectId="+contract_no+",planNumber="+contract_no);
|
||
if(typeof(id)=="undefined" || id.length <= 0 || id==""){
|
||
RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantDeleteAction", "deleteRentDormant", "planNumber="+contract_no+",objectType="+objectType);
|
||
}else{
|
||
alert("生成成功!!!");
|
||
}
|
||
reloadSelf();
|
||
}
|
||
function stamp(){
|
||
var tempId = "2df36e40437211eb808300163e0e11e6";
|
||
var flie = getItemValue(0,getRow(0),"FILENAME");
|
||
if(typeof(flie)=="undefined"||flie==null||flie==""){
|
||
alert("请先生成保险委托授权书!");
|
||
return;
|
||
}
|
||
var number = 0;
|
||
var contract_nos=getItemValueArray(0,"contract_no");
|
||
var project_ids=getItemValueArray(0,"project_id");
|
||
var customer_ids=getItemValueArray(0,"customer_id");
|
||
var subject_ids=getItemValueArray(0,"subject_id");
|
||
var contract_ids=getItemValueArray(0,"contract_id");
|
||
var subject_ids=getItemValueArray(0,"subject_id");
|
||
var insurance_ids=getItemValueArray(0,"insurance_id");
|
||
|
||
for(var i=0;i<contract_nos.length;i++){
|
||
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractInsuranceSignAction","claimSignInsuranceTwo",
|
||
"contractNo="+contract_nos[i]+",contractId="+contract_ids[i]+",projectId="+project_ids[i]+",subjectId="+subject_ids[i]
|
||
+",flagType=start,tempId="+tempId+",planNumber="+insurance_ids[i]);
|
||
if("success"==result){
|
||
number++;
|
||
}
|
||
}
|
||
|
||
if(contract_nos.length==0){
|
||
alert("请先选择数据!!!");
|
||
return;
|
||
}else if(number==0){
|
||
alert("盖章失败!!!");
|
||
}else if(number==contract_nos.length){
|
||
alert("盖章成功!!!");
|
||
}else{
|
||
alert("部分盖章成功!!!");
|
||
}
|
||
location.reload();
|
||
|
||
}
|
||
</script>
|
||
<%/*~END~*/%>
|
||
|
||
|
||
|
||
|
||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List07;Describe=自定义函数;]~*/%>
|
||
<script type="text/javascript">
|
||
|
||
|
||
</script>
|
||
<%/*~END~*/%>
|
||
|
||
|
||
|
||
|
||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List08;Describe=页面装载时,进行初始化;]~*/%>
|
||
<script type="text/javascript">
|
||
|
||
</script>
|
||
<%/*~END~*/%>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |