148 lines
6.3 KiB
Plaintext
148 lines
6.3 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");
|
||
System.out.println("----------------------flowunid=" + 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();
|
||
// System.out.println("----------------------contractId=" + contractId);
|
||
// 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("RentDormantExtensionPeriodFile");
|
||
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 generateQuotation(){
|
||
<%--var contract_no="<%=contractNo%>";--%>
|
||
<%--var contract_no="<%=contractNo%>";--%>
|
||
var result = AsControl.RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantExtensionPeriodAction","saveRentDormantExtensionPeriodAction","flowUnid=<%=flowunid%>");
|
||
alert("休眠展期协议编号为:" + result);
|
||
var contract_no=result;
|
||
if(contract_no == ''){
|
||
alert("请先进行休眠调整,生成休眠还款协议编号!");
|
||
return;
|
||
}
|
||
var param={};
|
||
var tempParam={};
|
||
var sparam="";
|
||
//模板号
|
||
// var tempId = "11b12cbfd98611eb970e00163e0ad611";
|
||
var tempId = "11b12cbfd98611eb970e00163e0ad622";
|
||
var flowUnid = "<%=flowunid%>";
|
||
param["templateNo"]= tempId;
|
||
//文件类型:休眠展期协议
|
||
var objectType = "contractExtensionPeriod";
|
||
//生成文件关联关系
|
||
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.RentDormantExtensionPeriodDeleteAction",
|
||
"deleteRentDormantExtensionPeriod", "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.RentDormantExtensionPeriodSignAction",
|
||
"wordToPdfRentDormantExtensionPeriod","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.RentDormantExtensionPeriodDeleteAction", "deleteRentDormantExtensionPeriod", "planNumber="+contract_no+",objectType="+objectType);
|
||
}else{
|
||
alert("生成成功!!!");
|
||
}
|
||
reloadSelf();
|
||
}
|
||
</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"%> |