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

172 lines
7.2 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"%><%
/*
Author: undefined 2017-06-29
Content: ʾÀýÏêÇéÒ³Ãæ
History Log:
*/
String calType = CurPage.getParameter("calType");
String plannumber=CurPage.getParameter("plannumber");
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 settleMethod="";
String rentOrRate="";
if(plannumber==null){
BizObject condition=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
plannumber=condition.getAttribute("payment_number").getString();
settleMethod=condition.getAttribute("SETTLE_METHOD").getString();
rentOrRate=condition.getAttribute("RENT_OR_RATE").getString();
}else{
BizObject condition=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid and payment_number=:plannumber").setParameter("flowunid", flowunid).setParameter("plannumber", plannumber).getSingleResult(false);
settleMethod=condition.getAttribute("SETTLE_METHOD").getString();
rentOrRate=condition.getAttribute("RENT_OR_RATE").getString();
}
String sTempletNo = "LCRentChangeInfo";//--Ä£°åºÅ--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
String groupHidden="";
if(!(settleMethod.equals("even_corpus")||(rentOrRate.equals("rate")&&!settleMethod.equals("even_subsection")&&!settleMethod.equals("irregular_rent")))){
doTemp.setRequired("START_LIST", false);
doTemp.setVisible("START_LIST", false);
doTemp.setRequired("ADJUST_LIST", false);
doTemp.setVisible("ADJUST_LIST", false);
doTemp.setRequired("PAYDAY_ADJUST", false);
doTemp.setVisible("PAYDAY_ADJUST", false);
doTemp.setRequired("YEAR_RATE", false);
doTemp.setVisible("YEAR_RATE", false);
groupHidden="0010,0020";
}
doTemp.setDefaultValue("flowunid", flowunid);
doTemp.setDefaultValue("payment_number", plannumber);
doTemp.setHtmlEvent("START_LIST","onchange","startListChange");
doTemp.appendJboWhere(" and payment_number='"+plannumber+"'");
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.lease.flow.flowarchive.onhirechange.RentPlanChangeShow");//Èç¹ûÊÇÀúÊ·ÔòÐÂÏÔʾÀúÊ·Êý¾Ý
}
List<BizObject> rents=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP","select * from O where flowunid='"+flowunid+"' and payment_number='"+plannumber+"' order by plan_list").getResultList(false);
if(rents.size()>0){
doTemp.setDefaultValue("YEAR_RATE",rents.get(rents.size()-1).getAttribute("YEAR_RATE").getString());
}
ASObjectWindowCalc dwTemp = new ASObjectWindowCalc(CurPage, doTemp,request);
Parameter p=new Parameter("NodeNo",nodeNo+"_1");
Parameter p2=new Parameter("payment_number",plannumber);
Vector<Parameter> v=CurPage.parameterList;
v.add(p);
v.add(p2);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
if((null!=sRightType&&sRightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
isShowButton=false;
}else{
isShowButton=true;
}
dwTemp.setGroupHidden(groupHidden);
dwTemp.setAttr("inputWidth","120");
dwTemp.setAttr("spanWidth","107");
dwTemp.genHTMLObjectWindow(flowunid);
String compClientID = request.getParameter("CompClientID");
dwTemp.replaceColumn("pay_condition", "<iframe type='iframe' id='pay_condition' name=\"pay_condition\" width=\"100%\" height=\"500px\" frameborder=\"0\" src=\""+sWebRootPath+"/Accounting/LoanSimulation_change/LoanBasicInfo.jsp?CompClientID="+compClientID+"&flowunid="+flowunid+"&plannumber="+plannumber+"&IsHistory="+ishistory+"&NodeNo="+nodeNo+"&RightType="+sRightType+"&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 val = $("#START_LIST").val();
var ADJUST_LIST = $("#ADJUST_LIST").val();
if(val.indexOf("-")!=-1){
alert("´Ë´¦²»ÄÜÊäÈ븺Êý!");
$("#START_LIST").val(val.replace("-",""));
}
if(typeof(ADJUST_LIST)!=undefined && ADJUST_LIST !="" ){
if(Number(ADJUST_LIST)<Number(val)){
alert("×ÜÆÚ´Î²»¿ÉÒÔСÓÚ¿ªÊ¼ÆÚ´Î!");
setItemValue(0,0,"START_LIST","");
return;
}
}
});
$("#ADJUST_LIST").change(function(){
var val = $("#ADJUST_LIST").val();
var START_LIST = $("#START_LIST").val();
if(val.indexOf("-")!=-1){
alert("´Ë´¦²»ÄÜÊäÈ븺Êý!");
$("#ADJUST_LIST").val(val.replace("-",""));
}
if(typeof(START_LIST)!=undefined && START_LIST !="" ){
if(Number(val)<Number(START_LIST)){
alert("×ÜÆÚ´Î²»¿ÉÒÔСÓÚ¿ªÊ¼ÆÚ´Î!");
setItemValue(0,0,"ADJUST_LIST","");
return;
}
}
});
});
//±£´æÊý¾Ý
function saveRecord(sPostEvents)
{
//¼ì²éÊÇ·ñ½øÐйý±ä¸ü
var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","checkIsRentChange","flowunid=<%=flowunid%>,plannumber=<%=plannumber%>");
if(result == 'true'){
as_save("myiframe0","run()");
}else{
alert('ÇëÏȳ·Ïú±ä¸ü£¬ÔÙ½øÐбä¸ü²Ù×÷£¡£¡£¡');
}
}
function cancelChange(){
openDWDialog();
setTimeout(function(){
var message = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","cancelRentChange","flowunid=<%=flowunid%>,plannumber=<%=plannumber%>");
if(message == 'true'){
resetDWDialog("±ä¸ü³·Ïú³É¹¦£¡£¡£¡",true);
window.location.href=window.location.href;
}else{
resetDWDialog("δ½øÐйý×â½ð¼Æ»®±ä¸üµÄ²Ù×÷£¡ÇëÏȽøÐÐ×â½ð¼Æ»®±ä¸ü£¡£¡£¡",true);
}
}, 500);
}
function run()
{
var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","runRentChange","flowunid=<%=flowunid%>,plannumber=<%=plannumber%>,productId=<%=ProductId%>,calType=pay_process");
window.location.href=window.location.href;
}
function startListChange(){
var incomeNumber = document.getElementById('pay_condition').contentWindow.getItemValue(0,0,"INCOME_NUMBER");
var startList = getItemValue(0,getRow(),"START_LIST");
if(startList){
if(Number(startList) > Number(incomeNumber) || Number(startList) <= 0){
alert("ÊäÈëÆÚ´Î·¶Î§´íÎó,Çë¼ì²éºóÖØÐÂÊäÈ룡£¡£¡");
setItemValue(0,0,"START_LIST","");
return;
}else{
var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.RentCalHelper","findPlanDateByRentList","paymentnumber=<%=plannumber%>,startList="+startList);
if(result.result== 'true'){
setItemValue(0,0,"PAYDAY_ADJUST",result.message);
}else{
alert(result.message);
setItemValue(0,0,"START_LIST","");
}
}
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>