apzl_leasing/WebContent/Tenwa/Lease/Flow/Comm/LBContractEnd/LBContractDevolutionInfo.jsp

199 lines
6.9 KiB
Plaintext

<%@page import="jbo.app.tenwa.calc.LC_CALC_CONDITION"%>
<%@page import="jbo.com.tenwa.lease.comm.LB_UNION_LESSEE"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%@ page import="com.amarsoft.app.util.*" %>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info00;Describe=注释区;]~*/%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info01;Describe=定义页面属性;]~*/%>
<%
String PG_TITLE = "产权转移单"; // 浏览器窗口标题 <title> PG_TITLE </title>
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info02;Describe=定义变量,获取参数;]~*/%>
<%
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
if(sFlowUnid == null) sFlowUnid = "";
BizObject flow=GetFlowAction.getFlowBussinessObject(sFlowUnid);
String product_id=flow.getAttribute("productId").toString();
String contractid=flow.getAttribute("contract_id").toString();
String projectid=flow.getAttribute("proj_id").toString();
String contract_number=flow.getAttribute("flow_key").toString();//业务合同号
BizObjectManager bom=JBOFactory.getBizObjectManager(LB_UNION_LESSEE.CLASS_NAME);
BizObject cust=bom.createQuery("contract_id=:contract_id and is_main='Y'").setParameter("contract_id", contractid).getSingleResult(false);
String custname=cust.getAttribute("customer_name").toString();;//主承租人
// String planinformation=ProductParamUtil.getProductParameterValue(product_id,"PRD0314","planinformation");//方案类型
String money="";//留购价
// if("SinglePlan".equals(planinformation)){
// BizObjectManager bom1=JBOFactory.getBizObjectManager(LC_CALC_CONDITION.CLASS_NAME);
// BizObject condition=bom1.createQuery("contract_id=:contract_id ").setParameter("contract_id", contractid).getSingleResult(false);
// money=condition.getAttribute("NOMINAL_PRICE").toString();
// }
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String RightType = CurPage.getParameter("RightType");//选择模式
String sTempletNo = "LBContractDevolutionTemp";//模板号
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info03;Describe=定义数据对象;]~*/%>
<%
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setDefaultValue("accept_person", custname);
doTemp.setDefaultValue("contract_id", contractid);
doTemp.setDefaultValue("project_id", projectid);
doTemp.setDefaultValue("flowunid", sFlowUnid);
doTemp.setDefaultValue("RESERVE_PRICE", money);
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");//如果是历史则新显示历史数据
}
CurPage.getCurComp().setAttribute("RightType", null);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//只读模式
isShowButton=false;
}else{
isShowButton=true;
}
String compClientID = request.getParameter("CompClientID");
dwTemp.genHTMLObjectWindow(sFlowUnid);//得到的参数
CurPage.getCurComp().setAttribute("RightType",RightType);
dwTemp.replaceColumn("devolution", "<iframe type='iframe' id='frame_list_knowing' name=\"frame_list_knowing\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Lease/Flow/Comm/LBContractEnd/QuotationList.jsp?CompClientID="+compClientID+"&flowunid="+sFlowUnid+"&IsHistory="+ishistory+"&NodeNo="+nodeNo+"&RightType="+RightType+"&docname=transfer"+"\"></iframe>", CurPage.getObjectWindowOutput());
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info04;Describe=定义按钮;]~*/%>
<%
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
};
sButtonPosition = "north";
%>
<%/*~END~*/%>
<%/*~BEGIN~不可编辑区~[Editable=false;CodeAreaID=Info05;Describe=主体页面;]~*/%>
<%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info06;Describe=定义按钮事件;]~*/%>
<script type="text/javascript">
var bIsInsert = false;
/*~[Describe=保存;InputParam=无;OutPutParam=无;]~*/
function saveRecord()
{
debugger;
var param={};
var tempParam={};
var sparam="";
//模板号
//param["templateNo"]="e1fc3afacfbc46fea0a881ac20de23cc";
param["templateNo"]="a9335f5624124b6db29f0d721fc8b61c";
//生成文件关联关系
tempParam["OBJECTTYPE"]="产权转移单";
tempParam["FLOW_UNID"]="<%=sFlowUnid%>";
tempParam["PROJ_ID"]="<%=projectid%>";
tempParam["CONTRACT_ID"]="<%=contractid%>";
tempParam["contract_number"]="<%=contract_number%>";
//生成模板固定参数
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 deleteparam ="PROJECT_PLAN_NUMBER="+"<%=contractid%>"+",objecttype=产权转移单";
var deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.QutationAction","deletedevtion",deleteparam);
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","contract_id=<%=contractid%>,PLAN_LIST=transfer");
if(bIsInsert)
{
beforeInsert();
}
beforeUpdate();
as_save("myiframe0");
reloadSelf();
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info07;Describe=自定义函数;]~*/%>
<script type="text/javascript">
<%/*~[Describe=执行插入操作前执行的代码;]~*/%>
function beforeInsert()
{
setItemValue(0,0,"InputUserID","<%=CurUser.getUserID()%>");
setItemValue(0,0,"InputOrgID","<%=CurUser.getOrgID()%>");
setItemValue(0,0,"InputTime","<%=StringFunction.getTodayNow()%>");
bIsInsert = false;
}
<%/*~[Describe=执行更新操作前执行的代码;]~*/%>
function beforeUpdate()
{
setItemValue(0,0,"UpdateUserID","<%=CurUser.getUserID()%>");
setItemValue(0,0,"UpdateOrgID","<%=CurUser.getOrgID()%>");
setItemValue(0,0,"UpdateTime","<%=StringFunction.getTodayNow()%>");
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info08;Describe=页面装载时,进行初始化;]~*/%>
<script type="text/javascript">
function initRow(){
if (getRowCount(0) == 0) //如果没有找到对应记录,则新增一条,并设置字段默认值
{
setItemValue(0,0,"FlowUnid","<%=sFlowUnid%>");
//设置自动获取日期为当前日期
setItemValue(0,0,"Accept_Date","<%=StringFunction.getToday()%>");
bIsInsert = true;
}
}
initRow();
</script>
<%/*~END~*/%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>