2021-05-20 11:05:46 +08:00

200 lines
7.5 KiB
Plaintext

<%@page import="com.amarsoft.awe.control.model.Parameter"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="com.tenwa.reckon.product.ASObjectWindowCalc" %>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<style>
#div_my0 > form {
height: 100%;
display: flex;
flex-direction: column;
}
#div_my0 > form > #A_Group_0020{
flex-grow: 1;
}
#div_my0 > form > #A_Group_0020 > table:last-child {
height: 100%;
}
#div_my0 > form > #A_Group_0020 > table:last-child table{
height: 100%;
}
</style>
<%
/*
Author: undefined 2017-06-29
Content: ʾÀýÏêÇéÒ³Ãæ
History Log:
*/
String calType = CurPage.getParameter("calType");
String paymentNumber=CurPage.getParameter("payment_number");
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String flowunid = CurPage.getParameter("FlowUnid");
String ProductId = CurPage.getParameter("ProductId");
String sRightType= CurPage.getParameter("RightType");
String taskno = CurPage.getParameter("TaskNo");
String flowNo = CurPage.getParameter("FlowNo");
String phaseNo = CurPage.getParameter("PhaseNo");
String settleMethod="";
String rentOrRate="";
BizObject condition=null;
if(paymentNumber==null){
condition=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
paymentNumber=condition.getAttribute("payment_number").getString();
settleMethod=condition.getAttribute("SETTLE_METHOD").getString();
rentOrRate=condition.getAttribute("RENT_OR_RATE").getString();
}
String sTempletNo = "LCRentDormantInfo";//--Ä£°åºÅ--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
String groupHidden="";
doTemp.setDefaultValue("flowunid", flowunid);
doTemp.setDefaultValue("payment_number", paymentNumber);
doTemp.setHtmlEvent("START_LIST","onchange","startListChange");
doTemp.appendJboWhere(" and payment_number='"+paymentNumber+"'");
// if(null!=ishistory&&ishistory.equals("true")){
// doTemp.setDataQueryClass("com.tenwa.lease.flow.flowarchive.onhirechange.RentPlanChangeShow");//Èç¹ûÊÇÀúÊ·ÔòÐÂÏÔʾÀúÊ·Êý¾Ý
// }
BizObject boLCC=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION","PAYMENT_NUMBER=:paymentNumber").setParameter("paymentNumber", paymentNumber).getSingleResult(false);
String irr = boLCC.getAttribute("IRR").toString();
List<BizObject> rents=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP","select * from O where flowunid='"+flowunid+"' and payment_number='"+paymentNumber+"' order by plan_list").getResultList(false);
int rentLists = rents.size();
if(rentLists>0){
doTemp.setDefaultValue("DORMANT_YEAR_RATE",rents.get(rentLists-1).getAttribute("YEAR_RATE").getString());
doTemp.setDefaultValue("IRR_OLD",irr);
}
ASObjectWindowCalc dwTemp = new ASObjectWindowCalc(CurPage, doTemp,request);
/*Parameter p=new Parameter("NodeNo",nodeNo+"_1");
Parameter p2=new Parameter("payment_number",paymentNumber);
Vector<Parameter> v=CurPage.parameterList;
v.add(p);
v.add(p2);*/
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
if(null!=ishistory&&ishistory.equals("true") || !phaseNo.equals("0010")){
dwTemp.ReadOnly = "1";//Ö»¶Áģʽ
isShowButton=false;
}else{
isShowButton=true;
}
dwTemp.setGroupHidden(groupHidden);
dwTemp.setAttr("inputWidth","120");
dwTemp.setAttr("spanWidth","107");
dwTemp.genHTMLObjectWindow(flowunid);
String compClientID = request.getParameter("CompClientID");
String url="/Accounting/LoanSimulation_change/LoanBasicInfo.jsp";
dwTemp.replaceColumn("pay_condition", "<iframe type='iframe' id='pay_condition' name=\"pay_condition\" width=\"100%\" height=\"100%\" frameborder=\"0\" src=\""+sWebRootPath+url+"?CompClientID="+compClientID+"&flowunid="+flowunid+"&plannumber="+paymentNumber+"&IsHistory="+ishistory+"&NodeNo="+nodeNo+"&RightType=ReadOnly&calType="+calType+"&TaskNo="+taskno+"\"></iframe>", CurPage.getObjectWindowOutput());
String sButtons[][] = {
{"true","","Button","ÐÝÃß±ä¸ü","ÐÝÃß±ä¸ü","saveRecord()","","","","btn_icon_rentchange"},
//{"true","","Button","ÐÝÃß³·Ïú","ÐÝÃß³·Ïú","cancelChange()","","","","btn_icon_delete"}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(function(){
$("#START_LIST").keyup(function(){
var startList = $("#START_LIST").val();
var endList = $("#END_LIST").val();
if(startList.indexOf("-")!=-1){
alert("´Ë´¦²»ÄÜÊäÈ븺Êý!");
$("#START_LIST").val(startList.replace("-",""));
}
if(typeof(endList)!=undefined && endList !="" ){
if(Number(endList)<Number(startList)){
alert("½áÊøÆÚ´Î²»¿ÉÒÔСÓÚ¿ªÊ¼ÆÚ´Î!");
setItemValue(0,0,"END_LIST","");
return;
}
if(Number(endList)==<%=rentLists%>){
alert("ÐÝÃß½áÊøÆÚ´Î²»¿ÉÒÔΪ×î´óÆÚ´Î");
setItemValue(0,0,"END_LIST","");
return;
}
}
});
$("#END_LIST").change(function(){
var endList = $("#END_LIST").val();
var startList = $("#START_LIST").val();
if(endList.indexOf("-")!=-1){
alert("´Ë´¦²»ÄÜÊäÈ븺Êý!");
$("#END_LIST").val(endList.replace("-",""));
}
if(typeof(startList)!=undefined && startList !="" ){
if(Number(endList)<Number(startList)){
alert("½áÊøÆÚ´Î²»¿ÉÒÔСÓÚ¿ªÊ¼ÆÚ´Î!");
setItemValue(0,0,"END_LIST","");
return;
}
}
});
});
//±£´æÊý¾Ý
function saveRecord(sPostEvents)
{
/* if(!cheackFinalPayment()){
AsDebug.alert("Ìáʾ","Ö»ÓÐβ¿îµÄµÄÏîÄ¿²¢ÇÒ´óÓÚ»¹×â´ÎÊý²ÅÄÜÕ¹ÆÚ±ä¸ü£¡");
return;
} */
//¼ì²éÊÇ·ñ½øÐйý±ä¸ü
as_save("myiframe0","run()");
<%-- var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","checkIsRentChange","flowunid=<%=flowunid%>,plannumber=<%=plannumber%>");
if(result == 'true'){
as_save("myiframe0","run()");
}else{
alert('ÇëÏȳ·Ïú±ä¸ü£¬ÔÙ½øÐбä¸ü²Ù×÷£¡£¡£¡');
} --%>
}
function cheackFinalPayment(){
var finalPayment=pay_condition.getItemValue(0,0,"FINAL_PAYMENT");
var incomeNumber=pay_condition.getItemValue(0,0,"INCOME_NUMBER");
var adjustList=getItemValue(0,0,"ADJUST_LIST");
var startList=getItemValue(0,0,"START_LIST");
if(parseFloat(finalPayment)>0&&parseFloat(adjustList)>parseFloat(incomeNumber)&&parseFloat(startList)==parseFloat(incomeNumber)){
return true;
}else{
return false;
}
}
function cancelChange(){
openDWDialog();
setTimeout(function(){
var message = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","cancelRentChange","flowunid=<%=flowunid%>,plannumber=<%=paymentNumber%>");
if(message == 'true'){
resetDWDialog("±ä¸ü³·Ïú³É¹¦£¡£¡£¡",true);
window.location.href=window.location.href;
}else{
resetDWDialog("δ½øÐйý×â½ð¼Æ»®±ä¸üµÄ²Ù×÷£¡ÇëÏȽøÐÐ×â½ð¼Æ»®±ä¸ü£¡£¡£¡",true);
}
}, 500);
}
function run()
{
var result = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","runRentdormant","flowunid=<%=flowunid%>,plannumber=<%=paymentNumber%>,productId=<%=ProductId%>,calType=pay_process");
window.location.href=window.location.href;
}
function startListChange(){
var startList = getItemValue(0,getRow(),"START_LIST");
if(startList){
if(Number(startList) <= 0){
alert("ÊäÈëÆÚ´Î·¶Î§´íÎó,Çë¼ì²éºóÖØÐÂÊäÈ룡£¡£¡");
setItemValue(0,0,"START_LIST","");
return;
}else{
var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.RentCalHelper","findPlanDateByRentList","paymentnumber=<%=paymentNumber%>,startList="+startList);
if(result.result!= 'true'){
alert(result.message);
setItemValue(0,0,"START_LIST","");
return;
}
}
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>