2023-07-30 16:31:30 +08:00

365 lines
14 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="com.amarsoft.awe.control.model.Parameter"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="com.tenwa.reckon.product.ASObjectWindowCalc" %>
<%@ page import="com.tenwa.jbo.manager.DataUtil" %>
<%@ 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="";
String zcContractNum="";
BizObject condition=JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
if(paymentNumber==null ){
paymentNumber=condition.getAttribute("payment_number").getString();
settleMethod=condition.getAttribute("SETTLE_METHOD").getString();
rentOrRate=condition.getAttribute("RENT_OR_RATE").getString();
}
String contractId = condition.getAttribute("CONTRACT_ID").getString();
BizObject contract = JBOFactory.createBizObjectQuery("jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO","ID=:CONTRACT_ID").setParameter("CONTRACT_ID", contractId).getSingleResult(false);
zcContractNum=contract.getAttribute("ZC_CONTRACT_NUMBER").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.setHtmlEvent("DELAY_START_LIST", "onchange", "changeDelayStartList");
doTemp.setHtmlEvent("DELAY_END_LIST", "onchange", "changeDelayEndList");
doTemp.setHtmlEvent("CHANGE_TYPE", "onchange", "changeType");
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);
}
List<Map<String, String>> dataList = DataUtil.query("select 1 from lc_calc_subsection_info where payment_number = ?", Sqlca, paymentNumber);
String canChange = "yes";
if (dataList.size() > 1) {
canChange = "no";
}
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(){
changeType();
var zcContractNum=getItemValue(0,0,"zc_contract_num");
if(zcContractNum == undefined || zcContractNum == '' ){
setItemValue(0,0,"zc_contract_num","<%=zcContractNum%>");
}
$("#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","");
setItemValue(0, 0, 'DELAY_START_LIST', '');
setItemValue(0, 0, 'DELAY_END_LIST', '');
return;
}
if(Number(endList)==<%=rentLists%>){
alert("ÐÝÃß½áÊøÆÚ´Î²»¿ÉÒÔΪ×î´óÆÚ´Î");
setItemValue(0,0,"END_LIST","");
setItemValue(0, 0, 'DELAY_START_LIST', '');
setItemValue(0, 0, 'DELAY_END_LIST', '');
return;
}
}
});
$("#END_LIST").change(function(){
var endList = $("#END_LIST").val();
var startList = $("#START_LIST").val();
if(typeof(startList)!=undefined && startList !="" ){
if(Number(endList)<Number(startList)){
alert("½áÊøÆÚ´Î²»¿ÉÒÔСÓÚ¿ªÊ¼ÆÚ´Î!");
setItemValue(0,0,"END_LIST","");
setItemValue(0, 0, 'DELAY_START_LIST', '');
setItemValue(0, 0, 'DELAY_END_LIST', '');
return;
}
}
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
if (changeType === 'dormancy_delay') {
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
if (delayStartList !== '' && Number(delayStartList) <= Number(endList)) {
alert('ÑÓÆÚ¿ªÊ¼ÆÚ´Î±ØÐë´óÓÚÐÝÃß½áÊøÆÚ´Î');
setItemValue(0, 0, 'DELAY_START_LIST', '');
setItemValue(0, 0, 'DELAY_END_LIST', '');
}
}
});
});
//±£´æÊý¾Ý
function saveRecord(sPostEvents)
{
/* if(!cheackFinalPayment()){
AsDebug.alert("Ìáʾ","Ö»ÓÐβ¿îµÄµÄÏîÊ®¶þÌõÄ¿²¢ÇÒ´óÓÚ»¹×â´ÎÊý²ÅÄÜÕ¹ÆÚ±ä¸ü£¡");
return;
} */
if ('<%=canChange%>' === 'no') {
alert('·¢ÏÖ¶àÌõ·Ö¶ÎÈÚÊý¾Ý£¬²»ÔÊÐí½øÐбä¸ü');
return;
}
var zcContractNum=getItemValue(0,0,"zc_contract_num");
var contract_date=getItemValue(0,0,"contract_date");
if(zcContractNum == undefined || zcContractNum == '' ){
alert("ÖгµºÏͬ±àºÅ²»ÄÜΪ¿Õ£¡");
return;
}
if(contract_date == undefined || contract_date == '' ){
alert("ºÏͬǩÊðʱ¼ä²»ÄÜΪ¿Õ£¡");
return;
}
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
if (changeType === 'delay') {
setItemValue(0, 0, 'START_LIST', '');
}
var result = AsControl.RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantAction","saveRentDormantAction","flowUnid=<%=flowunid%>,contractDate="+contract_date+",zcContractNum="+zcContractNum);
// alert("ÐÝÃß»¹¿îЭÒé±àºÅΪ£º" + result);
//¼ì²éÊÇ·ñ½øÐйý±ä¸ü
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,expandList="+getItemValue(0,getRow(),"EXPAND_LIST"));
if (result.result === 'false') {
alert('²âËãʧ°Ü: ' + result.msg);
}
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;
}
}
}
}
function changeType() {
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
if (changeType) {
const startList = getItemValue(0, 0, 'START_LIST');
const endList = getItemValue(0, 0, 'END_LIST');
const dormantYearRate = getItemValue(0, 0, 'DORMANT_YEAR_RATE');
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
const delayEndList = getItemValue(0, 0, 'DELAY_END_LIST');
switch (changeType) {
case 'dormancy':
hideItem(0, 'DELAY_START_LIST');
setItemRequired(0, 'DELAY_START_LIST', false);
if (delayStartList) {
setItemValue(0, 0, 'DELAY_START_LIST', '');
}
hideItem(0, 'DELAY_END_LIST');
setItemRequired(0, 'DELAY_END_LIST', false);
if (delayEndList) {
setItemValue(0, 0, 'DELAY_END_LIST', '');
}
showItem(0, 'START_LIST');
setItemRequired(0, 'START_LIST', true);
showItem(0, 'END_LIST');
setItemRequired(0, 'END_LIST', true);
showItem(0, 'DORMANT_YEAR_RATE');
setItemRequired(0, 'DORMANT_YEAR_RATE', true);
break;
case "delay":
hideItem(0, 'START_LIST');
setItemRequired(0, 'START_LIST', false);
if (startList) {
setItemValue(0, 0, 'START_LIST', '');
}
hideItem(0, 'END_LIST');
setItemRequired(0, 'END_LIST', false);
if (endList) {
setItemValue(0, 0, 'END_LIST', '');
}
hideItem(0, 'DORMANT_YEAR_RATE');
setItemRequired(0, 'DORMANT_YEAR_RATE', false);
if (dormantYearRate) {
setItemValue(0, 0, 'DORMANT_YEAR_RATE', '');
}
showItem(0, 'DELAY_START_LIST');
setItemRequired(0, 'DELAY_START_LIST', true);
showItem(0, 'DELAY_END_LIST');
setItemRequired(0, 'DELAY_END_LIST', true);
break;
case 'dormancy_delay':
showItem(0, 'START_LIST');
setItemRequired(0, 'START_LIST', true);
showItem(0, 'END_LIST');
setItemRequired(0, 'END_LIST', true);
showItem(0, 'DORMANT_YEAR_RATE');
setItemRequired(0, 'DORMANT_YEAR_RATE', true);
showItem(0, 'DELAY_START_LIST');
setItemRequired(0, 'DELAY_START_LIST', true);
showItem(0, 'DELAY_END_LIST');
setItemRequired(0, 'DELAY_END_LIST', true);
setItemRequired(0, 'END_LIST', false);
if (!endList) {
setItemValue(0, 0, 'DELAY_START_LIST', '');
setItemValue(0, 0, 'DELAY_END_LIST', '');
}
break;
}
}
}
function changeDelayStartList() {
const changeType = getItemValue(0, 0, 'CHANGE_TYPE');
const endList = getItemValue(0, 0, 'END_LIST');
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
if (changeType === 'dormancy_delay') {
if (!endList) {
alert('ÇëÏÈÌîдÐÝÃß½áÊøÆÚ´Î');
setItemValue(0, 0, 'DELAY_START_LIST', '');
return;
}
if (Number(delayStartList) <= Number(endList)) {
alert('ÑÓÆÚ¿ªÊ¼ÆÚ´Î±ØÐë´óÓÚÐÝÃß½áÊøÆÚ´Î');
setItemValue(0, 0, 'DELAY_START_LIST', '');
return;
}
}
if (delayStartList !== '') {
if (Number(delayStartList) <= 0) {
alert('ÑÓÆÚ¿ªÊ¼ÆÚ´Î±ØÐë´óÓÚ0');
setItemValue(0, 0, 'DELAY_START_LIST', '');
} else {
const result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.RentCalHelper", "findPlanDateByRentList", "paymentnumber=<%=paymentNumber%>,startList=" + delayStartList);
if(result.result !== 'true') {
alert(result.message);
setItemValue(0 ,0, 'DELAY_START_LIST', '');
}
}
}
}
function changeDelayEndList() {
const delayStartList = getItemValue(0, 0, 'DELAY_START_LIST');
if (delayStartList === '') {
alert('ÇëÏÈÌîдÑÓÆÚ¿ªÊ¼ÆÚ´Î');
setItemValue(0, 0, 'DELAY_END_LIST', '');
return;
}
const delayEndList = getItemValue(0, 0, 'DELAY_END_LIST');
if (delayEndList !== '') {
if (Number(delayEndList) < Number(delayStartList)) {
alert('ÑÓÆÚºó×ÜÆÚÊý±ØÐë´óÓÚ»òµÈÓÚÑÓÆÚ¿ªÊ¼ÆÚ´Î');
setItemValue(0, 0, 'DELAY_END_LIST', '');
}
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>