233 lines
8.8 KiB
Plaintext
233 lines
8.8 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"%><%
|
|
|
|
String sTempletNo = "LoanSimulationBasicInfo";//--Ä£°åºÅ--
|
|
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
|
|
|
|
|
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
|
dwTemp.Style = "2";//freeform
|
|
//dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
|
|
dwTemp.genHTMLObjectWindow(CurPage.getParameter("SerialNo"));
|
|
|
|
//×Ö¶ÎÏÔʾ×ÓÒ³Ãæ
|
|
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 businessDate = DateHelper.getBusinessDate();
|
|
String sButtons[][] = {
|
|
{"true","All","Button","ÖØÖÃ","ÖØÖÃ","reloadSelf()","","","",""},
|
|
{"true","All","Button","´û¿î×Éѯ","´û¿î×Éѯ","run()","","","",""},
|
|
};
|
|
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
|
<script type="text/javascript">
|
|
function run()
|
|
{
|
|
var rpt=RPTFrame.getValues();
|
|
if(!rpt) return;
|
|
var rat=RATFrame.getValues();
|
|
if(!rat) return;
|
|
var loan = getValues();
|
|
if(!loan) return;
|
|
RPTFrame.CHANGED=false;
|
|
RATFrame.CHANGED=false;
|
|
CHANGED=false;
|
|
document.all("A_Group_PSPart").style.display="";
|
|
|
|
var form = document.createElement("form");
|
|
form.id="runform";
|
|
form.method="post";
|
|
form.action="<%=sWebRootPath%>/Accounting/LoanSimulation/PaymentScheduleList.jsp";
|
|
form.target="PSFrame";
|
|
var hideInput = document.createElement("input");
|
|
hideInput.type="hidden";
|
|
hideInput.name= "loan"
|
|
hideInput.value= loan;
|
|
form.appendChild(hideInput);
|
|
|
|
hideInput = document.createElement("input");
|
|
hideInput.type="hidden";
|
|
hideInput.name= "rpt"
|
|
hideInput.value= rpt;
|
|
form.appendChild(hideInput);
|
|
|
|
hideInput = document.createElement("input");
|
|
hideInput.type="hidden";
|
|
hideInput.name= "rat"
|
|
hideInput.value= rat;
|
|
form.appendChild(hideInput);
|
|
|
|
hideInput = document.createElement("input");
|
|
hideInput.type="hidden";
|
|
hideInput.name= "CompClientID"
|
|
hideInput.value= "<%=sCompClientID%>";
|
|
form.appendChild(hideInput);
|
|
|
|
document.body.appendChild(form);
|
|
form.submit();
|
|
document.body.removeChild(form);
|
|
}
|
|
|
|
/*~[Describe=´ò¿ª»¹¿î·½Ê½ÐÅÏ¢;InputParam=ÎÞ;OutPutParam=ÎÞ;]~*/
|
|
function openRPT(iframe,param){
|
|
var putoutDate = getItemValue(0,getRow(),"PutOutDate");
|
|
if(!putoutDate){
|
|
AsControl.OpenView("/Blank.jsp","TextToShow=ÇëÏÈÊäÈë·¢·ÅÈÕÆÚ",iframe,"");
|
|
return;
|
|
}
|
|
var maturityDate = getItemValue(0,getRow(),"MaturityDate");
|
|
if(!maturityDate){
|
|
AsControl.OpenView("/Blank.jsp","TextToShow=ÇëÏÈÊäÈëµ½ÆÚÈÕÆÚ",iframe,"");
|
|
return;
|
|
}
|
|
document.all("A_Group_RPTPart").style.display="";
|
|
var obj = document.getElementById(iframe);
|
|
if(typeof(obj) == "undefined" || obj == null) return;
|
|
obj.CHANGED=false;
|
|
AsControl.OpenView("/Accounting/LoanSimulation/LoanTerm/BusinessRPTInfo.jsp","ObjectType=&ObjectNo=&"+param,iframe,"");
|
|
}
|
|
|
|
/*~[Describe=´ò¿ªÀûÂÊÐÅÏ¢;InputParam=ÎÞ;OutPutParam=ÎÞ;]~*/
|
|
function openRAT(iframe,param){
|
|
var currency = getItemValue(0,getRow(),"Currency");
|
|
if(!currency){
|
|
AsControl.OpenView("/Blank.jsp","TextToShow=ÇëÏÈÊäÈë±ÒÖÖ",iframe,"");
|
|
return;
|
|
}
|
|
var putoutDate = getItemValue(0,getRow(),"PutOutDate");
|
|
if(!putoutDate){
|
|
AsControl.OpenView("/Blank.jsp","TextToShow=ÇëÏÈÊäÈë·¢·ÅÈÕÆÚ",iframe,"");
|
|
return;
|
|
}
|
|
var maturityDate = getItemValue(0,getRow(),"MaturityDate");
|
|
if(!maturityDate){
|
|
AsControl.OpenView("/Blank.jsp","TextToShow=ÇëÏÈÊäÈëµ½ÆÚÈÕÆÚ",iframe,"");
|
|
return;
|
|
}
|
|
document.all("A_Group_RatePart").style.display="";
|
|
var obj = document.getElementById(iframe);
|
|
if(typeof(obj) == "undefined" || obj == null) return;
|
|
obj.CHANGED=false;
|
|
AsControl.OpenView("/Accounting/LoanSimulation/LoanTerm/BusinessRATInfo.jsp","ObjectType=&ObjectNo=&"+param,iframe,"");
|
|
}
|
|
|
|
//¸ù¾ÝÆðʼÈÕÆÚºÍ´û¿îÔÂÊýµÃµ½´û¿î½áÊøÈÕÆÚ
|
|
function getMaturityDate(){
|
|
var putoutDate = getItemValue(0,getRow(),"PutoutDate");
|
|
var term = getItemValue(0,getRow(),"LoanTerm");
|
|
if(typeof(putoutDate) == "undefined" ||putoutDate==null||putoutDate=="") return;
|
|
if(typeof(term) == "undefined" ||term==null||term=="") return;
|
|
var maturityDate = AsControl.RunJavaMethod("com.amarsoft.acct.accounting.web.DateCal","getRelativeDate","date="+putoutDate+",termUnit=M"+",term="+term);
|
|
setItemValue(0,getRow(),"MaturityDate",maturityDate);
|
|
openRPT("RPTFrame","Status=0,1");
|
|
openRAT("RATFrame","Status=0,1");
|
|
}
|
|
//¸ù¾Ý½ð¶îËã±ÈÀý
|
|
function getRatioByMoney(){
|
|
var equipMoney = getItemValue(0,getRow(),"v.EquipMoney");//É豸¿î
|
|
var FirstPayment = getItemValue(0,getRow(),"v.FirstPayment");//Ê׸¶¿î
|
|
var cautionMoney = getItemValue(0,getRow(),"v.cautionMoney");//±£Ö¤½ð
|
|
var handleMoney = getItemValue(0,getRow(),"v.handleMoney");//ÊÖÐø·Ñ
|
|
var manageMoney = getItemValue(0,getRow(),"v.manageMoney");//¹ÜÀí·Ñ
|
|
setItemValue(0,getRow(),"v.FirstPaymentRadio",Number(FirstPayment/equipMoney*100).toFixed(6));
|
|
setItemValue(0,getRow(),"v.cautionMoneyRadio",Number(cautionMoney/equipMoney*100).toFixed(6));
|
|
setItemValue(0,getRow(),"v.handleMoneyRadio",Number(handleMoney/equipMoney*100).toFixed(6));
|
|
setItemValue(0,getRow(),"v.manageMoneyRadio",Number(manageMoney/equipMoney*100).toFixed(6));
|
|
}
|
|
//±£ÏÕ¼ÆË㷽ʽʼþ
|
|
function insureMoneyTypeChange(){
|
|
var sResult = getItemValue(0,getRow(),"v.insureMoneyType");
|
|
if("insure_type1"==sResult){
|
|
setItemValue(0,0,"v.insuranceLessee","0");
|
|
setItemDisabled(0,getRow(),"v.insuranceLessor",false);
|
|
setItemDisabled(0,getRow(),"v.insuranceLessee",true);
|
|
return;
|
|
}else if("insure_type3"==sResult){
|
|
setItemValue(0,0,"v.insuranceLessor","0");
|
|
setItemDisabled(0,getRow(),"v.insuranceLessor",true);
|
|
setItemDisabled(0,getRow(),"v.insuranceLessee",false);
|
|
return;
|
|
}else{
|
|
setItemValue(0,0,"v.insuranceLessor","0");
|
|
setItemValue(0,0,"v.insuranceLessee","0");
|
|
setItemDisabled(0,getRow(),"v.insuranceLessor",true);
|
|
setItemDisabled(0,getRow(),"v.insuranceLessee",true);
|
|
return;
|
|
}
|
|
}
|
|
//±£ÏշѼÆËã
|
|
function sumInsureMoneyTwo(){
|
|
var payment = getItemValue(0,getRow(),"v.insuranceLessor");
|
|
var income = getItemValue(0,getRow(),"v.insuranceLessee");
|
|
setItemValue(0,0,"v.insureMoney",Number(payment)+Number(income));
|
|
if(!getItemValue(0,getRow(),"v.insureMoney")){
|
|
setItemValue(0,0,"v.insureMoney","0");
|
|
}
|
|
}
|
|
//±£Ö¤½ðʼþ
|
|
function cautionMoney(){
|
|
var cautionMoney = getItemValue(0,getRow(),"v.cautionMoney");//±£Ö¤½ð
|
|
var cautionDeductionMoney = cautionMoney;//±£Ö¤½ðµÖ¿Û
|
|
setItemValue(0,0,"v.cautionDeductionMoney",cautionDeductionMoney);
|
|
var cautionMoneyRemain=Number(cautionMoney)-Number(cautionDeductionMoney);//±£Ö¤½ðÍË»¹
|
|
if(cautionMoneyRemain<0){
|
|
setItemValue(0,0,"v.cautionDeductionMoney",cautionMoney);
|
|
alert("±£Ö¤½ðÍË»¹½ð¶îÌîд¹ý´ó!");
|
|
return;
|
|
}else{
|
|
setItemValue(0,0,"v.cautionMoneyRemain",cautionMoneyRemain);
|
|
}
|
|
if(!getItemValue(0,getRow(),"v.cautionMoneyRemain")){
|
|
setItemValue(0,0,"v.cautionMoneyRemain","0");
|
|
}
|
|
}
|
|
//±£Ö¤½ðµÖ¿Ûʼþ
|
|
function cautionDeductionMoney(){
|
|
var cautionMoney = getItemValue(0,getRow(),"v.cautionMoney");//±£Ö¤½ð
|
|
var cautionDeductionMoney = getItemValue(0,getRow(),"v.cautionDeductionMoney");//±£Ö¤½ðµÖ¿Û
|
|
var cautionMoneyRemain=Number(cautionMoney)-Number(cautionDeductionMoney);//±£Ö¤½ðÍË»¹
|
|
if(cautionMoneyRemain<0){
|
|
setItemValue(0,0,"v.cautionDeductionMoney",cautionMoney);
|
|
alert("±£Ö¤½ðÍË»¹½ð¶îÌîд¹ý´ó!");
|
|
return;
|
|
}else{
|
|
setItemValue(0,0,"v.cautionMoneyRemain",cautionMoneyRemain);
|
|
}
|
|
if(!getItemValue(0,getRow(),"v.cautionMoneyRemain")){
|
|
setItemValue(0,0,"v.cautionMoneyRemain","0");
|
|
}
|
|
}
|
|
//¼ÆËãÈÚ×ʶî
|
|
function cleanLeaseMoney(){
|
|
var equipMoney = getItemValue(0,getRow(),"v.EquipMoney");//É豸¿î
|
|
var FirstPayment = getItemValue(0,getRow(),"v.FirstPayment");//Ê׸¶¿î
|
|
setItemValue(0,0,"v.BusinessSum",Number(equipMoney)-Number(FirstPayment));
|
|
}
|
|
function getValues(){
|
|
var values = {};
|
|
for(var i=0;i<DisplayFields[0].length;i++){
|
|
values[DisplayFields[0][i]] = getItemValue(0,getRow(),DisplayFields[0][i]);
|
|
}
|
|
return JSON.stringify(values);
|
|
}
|
|
|
|
document.all("A_Group_RPTPart").style.display="none";
|
|
document.all("A_Group_RatePart").style.display="none";
|
|
document.all("A_Group_PSPart").style.display="none";
|
|
$(function(){
|
|
insureMoneyTypeChange();
|
|
});
|
|
</script>
|
|
<%@ include file="/Frame/resources/include/include_end.jspf"%> |