2018-06-03 22:26:41 +08:00

149 lines
6.4 KiB
Plaintext

<%@page import="com.amarsoft.app.accounting.config.impl.CashFlowConfig"%>
<%@page import="com.amarsoft.app.base.config.impl.BusinessComponentConfig"%>
<%@page import="com.amarsoft.app.base.util.DateHelper"%>
<%@page import="com.amarsoft.app.base.businessobject.BusinessObjectHelper"%>
<%@page import="com.amarsoft.app.base.businessobject.BusinessObject"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%-- <script type="text/javascript" src="<%=sWebRootPath%>/Accounting/LoanSimulation_onhire/js/DataUtil.js"></script> --%>
<%
String sTempletNo = "LoanSimulationBasicInfo_onhire";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
String docId = CurPage.getParameter("flow_unid");
if(docId == null){
docId = "100000";
}
String calType = CurPage.getParameter("calType");
if(calType == null){
calType = "onHire_process";
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String RightType= CurPage.getParameter("RightType");
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");//如果是历史则新显示历史数据
}
dwTemp.Style = "2";//freeform
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//只读模式
isShowButton=false;
}else{
isShowButton=true;
}
dwTemp.genHTMLObjectWindow(docId);
//字段显示子页面
for (int i = 0; i < dwTemp.getDataObject().Columns.size(); ++i){
ASColumn column = (ASColumn) dwTemp.getDataObject().Columns.get(i);
String htmlStyle = column.getAttribute("ColHTMLStyle");
if(!StringX.isEmpty(htmlStyle) && htmlStyle.indexOf("iframe") > -1)
{
String name = column.getAttribute("ColName");
dwTemp.replaceColumn(name, htmlStyle, CurPage.getObjectWindowOutput());
}
}
String compClientID = request.getParameter("CompClientID");
dwTemp.replaceColumn("condition_plan", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"600px\" frameborder=\"0\" src=\""+sWebRootPath+"/Accounting/LoanSimulation_modify/condition_plan.jsp?CompClientID="+compClientID+"&docId="+docId+"&IsHistory="+ishistory+"&NodeNo="+nodeNo+"&calType="+calType+"\"></iframe>", CurPage.getObjectWindowOutput());
dwTemp.replaceColumn("knowing_config", "<iframe type='iframe' id='frame_list_knowing' name=\"frame_list_knowing\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+"/Accounting/LoanSimulation_common/KnowConfigList.jsp?CompClientID="+compClientID+"&docId="+docId+"&IsHistory="+ishistory+"&NodeNo="+nodeNo+"&calType="+calType+"\"></iframe>", CurPage.getObjectWindowOutput());
String businessDate = DateHelper.getBusinessDate();
String sButtons[][] = {
//{"true","All","Button","重置","重置","reloadSelf()","","","",""},
//{"true","All","Button","租金测算","租金测算","saveRecord()","","","",""}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
var count = 0;
function saveRecord(sPostEvents){
as_save("myiframe0","run()");
}
function ValidityCheck(){
return true;
}
function run()
{
var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","runOnhire","docId=<%=docId%>,calType=<%=calType%>");
document.all("frame_list").src = document.all("frame_list").src;
if(result.info){
for(var p in result.info){
setItemValue(0,getRow(),p.toUpperCase(),result.info[p]);
}
}
}
function leaseamtDateChange(){
var leaseAmtDate = getItemValue(0,getRow(),"LEASE_AMT_DATE");//投放日
var startDate = getItemValue(0,getRow(),"START_DATE");//投放日
var firstPlanDate = getItemValue(0,getRow(),"FIRST_PLAN_DATE");//第二期租金支付日
var secondPlanDate = getItemValue(0,getRow(),"SECOND_PLAN_DATE");//第二期租金支付日
if(!startDate && !firstPlanDate && !secondPlanDate){
changeDate(leaseAmtDate);
}
}
function changeDate(leaseAmtDate){
var incomenumberyear = Number(getItemValue(0,getRow(),"INCOME_NUMBER_YEAR").replace("income_",""));
var periodType = getItemValue(0,getRow(),"PERIOD_TYPE");
setItemValue(0,0,"START_DATE",leaseAmtDate);
if("period_type_1" == periodType){
setItemValue(0,0,"FIRST_PLAN_DATE",leaseAmtDate);
setItemValue(0,0,"SECOND_PLAN_DATE",dateAdd('m',incomenumberyear,new Date(leaseAmtDate)).format('yyyy\/MM\/dd'));
}else{
changedate = dateAdd('m',incomenumberyear,new Date(leaseAmtDate));
setItemValue(0,0,"FIRST_PLAN_DATE",changedate.format('yyyy\/MM\/dd'));
setItemValue(0,0,"SECOND_PLAN_DATE",dateAdd('m',incomenumberyear,new Date(changedate)).format('yyyy\/MM\/dd'));
}
}
function dateAdd(strInterval, num, date){
date = arguments[2] || new Date();
switch (strInterval) {
case 's' :return new Date(date.getTime() + (1000 * num));
case 'n' :return new Date(date.getTime() + (60000 * num));
case 'h' :return new Date(date.getTime() + (3600000 * num));
case 'd' :return new Date(date.getTime() + (86400000 * num));
case 'w' :return new Date(date.getTime() + ((86400000 * 7) * num));
case 'm' :return new Date(date.getFullYear(), (date.getMonth()) + num, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
case 'y' :return new Date((date.getFullYear() + num), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
}
}
$(function(){
document.getElementById('div_my0').innerHTML = '<div style="width:1160px;overflow: scroll;">'+document.getElementById('div_my0').innerHTML+'</div>';
setItemValue(0,0,"flow_unid",<%=docId%>);
var rentOrRate = getItemValue(0,getRow(),"RENT_OR_RATE");
if(rentOrRate.indexOf('knowing') >= 0){
document.all("A_Group_calc_config").style.display="block";
}
setDisable("LEASE_AMT_DATE");
setDisable("START_DATE");
setDisable("FIRST_PLAN_DATE");
setDisable("SECOND_PLAN_DATE");
});
document.all("A_Group_calc_config").style.display="none";
function getYearRate(){
return getItemValue(0,getRow(),"YEAR_RATE");
}
function getIncomeNumber(){
return getItemValue(0,getRow(),"INCOME_NUMBER");
}
function setEnable(id){
setItemDisabled(0,getRow(),id,false);
getObj(0,id).style.backgroundColor="";
}
function setDisable(id){
setItemDisabled(0,getRow(),id,true);
getObj(0,id).style.backgroundColor="#EBEBE4";
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>