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

79 lines
2.7 KiB
JavaScript
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.

/*~[Describe=保存前校验方法;InputParam=无;OutPutParam=无;]~*/
function beforeSave(){
var transDate = getItemValue(0,getRow(),"TransDate");
if(transDate < businessDate){
alert("生效日期不能早于当前日期");
return false;
}
initMaturity();
var BusinessSum = getItemValue(0,getRow(0),"BusinessSum");
if(parseFloat(BusinessSum) <= 0.00){
alert("放款金额必须大于0");
return;
}
var maturityDate = getItemValue(0, getRow(0), "MATURITYDATE");
var PutOutDate = getItemValue(0, getRow(0), "PutOutDate");
//随借随还到期日重新计算
var subdwname = ALSObjectWindowFunctions.getSubObjectWindowName(0,"RPT");
var RPTTermID = getItemValue(subdwname,getRow(subdwname),"TermID");
var defaultDueday = getItemValue(subdwname,getRow(subdwname),"defaultDueday");
if(RPTTermID=="RPT-03"){
maturityDate = AsControl.RunJavaMethodTrans("com.amarsoft.app.lending.bizlets.CalcMaturity","getMaturity","RPTTermID="+RPTTermID+",DefaultDueday="+defaultDueday+",PutOutDate="+PutOutDate);
if(maturityDate!=""){
setItemValue(0,getRow(0),"BusinessTerm",1);
setItemValue(0,getRow(0),"MaturityDate",maturityDate);
}
}
if(maturityDate<="<%=DateHelper.getBusinessDate()%>"){
alert("额度到期日必须晚于当前日期!");
setItemValue(0,0,"MATURITYDATE", "");
return;
}else if(maturityDate<=PutOutDate){
alert("贷款到期日必须晚于贷款起始日!");
setItemValue(0,0,"MATURITYDATE", "");
return;
}
var ContractArtificialNo = getItemValue(0,getRow(0),"ContractArtificialNo");
var SerialNo = getItemValue(0,getRow(0),"SerialNo");
var returnValue = AsControl.RunASMethod("WorkFlowEngine","CheckBusinessSum",ContractArtificialNo+","+SerialNo+","+BusinessSum);
if(returnValue.split("@")[0] == "false"){
alert(returnValue.split("@")[1]);
return;
}
return true;
}
/*~[Describe=保存后续逻辑;InputParam=无;OutPutParam=无;]~*/
function afterSave(){
RPTFrame.saveRecord();
}
function viewPayment(){
saveRecord();
var serialNo = getItemValue(0, getRow(0), "SERIALNO");
AsDialog.PopView("/Accounting/Simulation/PutOutSimulation.jsp","PutOutSerialNo="+serialNo);
}
/*~[Describe=初始化;InputParam=无;OutPutParam=无;]~*/
function initRow(){
var putOutDate = getItemValue(0,getRow(),"PutOutDate");
if(putOutDate == "" || putOutDate == null){
setItemValue(0,0,"PutOutDate",businessDate);
}
var maturityDate = getItemValue(0,getRow(),"maturityDate");
if(maturityDate != "" && maturityDate != null && !maturityDate ){
setItemValue(0,0,"MaturityDate",maturityDate);
}else{
initMaturity();
}
changePaymentType();
initTerm();
//initATT();
// initRepriceType();
initBusinessRate();
openRPT();
// setFineRateType();
checkAccount('ACT','AccountIndicator','AccountType','AccountNo','AccountName','AccountCurrency','AccountNo1','CustomerID','MFCustomerID');
}