diff --git a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp index 0cc57cbc4..5d84b9024 100644 --- a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp +++ b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp @@ -227,7 +227,6 @@ $(function(){ getRatioByMoney(getObj(0, "EQUIP_AMT")); }); function changgeCompare(){ - debugger; var nowTotal=Number("<%=nowTotal%>"); var equipAmt=Number(getItemValue(0, 0, "EQUIP_AMT")); var flag="<%=flag%>"; @@ -802,6 +801,9 @@ function changeRateType(){ //根据金额算比例 function getRatioByMoney(e){ + if(e.value === "") { + setItemValue(0, 0, e.id, "0"); + } var equipAmt=getItemValue(0,0,"EQUIP_AMT");//设备款 var cleanLeaseMoney=getItemValue(0,0,"CLEAN_LEASE_MONEY");//融资额 var allMoney = 0; @@ -823,14 +825,15 @@ function getRatioByMoney(e){ } //得到总价款 setItemValue(0, 0, "TOTAL_ALL", eval(allMoney + "+" + equipAmt) + ""); - //计算综合融资额 var firstPaymentRatio = getItemValue(0, 0, "FIRST_PAYMENT_RATIO_0"); - var ratio = 100 - Number(firstPaymentRatio); - if(ratio > 0) { - cleanLeaseMoney = equipAmt * (ratio / 100) + Number(allMoney); - setItemValue(0, 0, "RENT_RATIO", ((cleanLeaseMoney / equipAmt) * 100).toFixed(6)); - setItemValue(0, 0, "CLEAN_LEASE_MONEY", cleanLeaseMoney); + //计算综合融资额 + if(e.id == "FIRST_PAYMENT") { + firstPaymentRatio = Number(getItemValue(0, 0, "FIRST_PAYMENT"))/Number(equipAmt)*100; } + var ratio = 100 - Number(firstPaymentRatio); + cleanLeaseMoney = equipAmt * (ratio / 100) + Number(allMoney); + setItemValue(0, 0, "RENT_RATIO", ((cleanLeaseMoney / equipAmt) * 100).toFixed(6) + ""); + setItemValue(0, 0, "CLEAN_LEASE_MONEY", cleanLeaseMoney + ""); allMoney = eval(allMoney + "+" + equipAmt); for(var key in fundRules){