添加校验

This commit is contained in:
tangfutang 2021-08-10 16:54:46 +08:00
parent c3ca6db246
commit e37a8b7f74
2 changed files with 20 additions and 3 deletions

View File

@ -78,7 +78,7 @@
fcleanLeaseMoney = Decimal( cleanLeaseMoney ).mul( cleanLeaseRatio ).div( 100 ).toFixed( 2 )
}
var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' ) ;
if( (fcleanLeaseMoney*1) > (maxLeaseMoney*1) ){
if( (Number(fcleanLeaseMoney) ) > ( Number(maxLeaseMoney) ) ){
alert("该段的融资金额不能大于:"+maxLeaseMoney+",请检查!");
setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', '');
setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', '');
@ -96,7 +96,7 @@
var cleanLeaseMoney = parent.getItemValue( 0, 0, 'CLEAN_LEASE_MONEY' );
var clm = getItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY' );
var maxLeaseMoney = getItemValue( 0, getRow(), 'MAX_LEASE_MONEY' );
if( (clm*1) > (maxLeaseMoney*1) ){
if( Number(clm) > Number(maxLeaseMoney) ){
alert("该段的融资金额不能大于:"+maxLeaseMoney+",请检查!");
setItemValue( 0, getRow(), 'CLEAN_LEASE_MONEY', '');
setItemValue( 0, getRow(), 'CLEAN_LEASE_RATIO', '');
@ -132,6 +132,16 @@
if ( '' === discount ) {
alert( '请填写第' + ( i + 1 ) + '行贴息金额' );
return;
}else{
var ifd = getItemValue( 0, i, 'IS_FIXED_DISCOUNT' );
if(ifd=="N"){
var mind = getItemValue( 0, i, 'MINIMUM_DISCOUNT' );
var maxd = getItemValue( 0, i, 'MAXIMUM_DISCOUNT' );
if( Number(discount) < Number(mind) || Number(discount)>Number(maxd) ){
alert( '请填写第' + ( i + 1 ) + '行贴息金额不在产品配置的区间内,请检查!' );
return;
}
}
}
} else {
var discountRate = getItemValue( 0, i, 'DISCOUNT_RATE' );
@ -179,6 +189,12 @@
$("input[id*=FINANCING_RATE_"+i+"]").attr('readonly',true);
$("input[id*=FINANCING_RATE_"+i+"]").css('border','0');
}
var ifdr = getItemValue( 0, i, 'IS_FIXED_DISCOUNT_RATE' );
if(ifdr=="Y"){
$("input[id*=DISCOUNT_RATE_"+i+"]").attr('readonly',true);
$("input[id*=DISCOUNT_RATE_"+i+"]").css('border','0');
}
}
}

View File

@ -765,7 +765,7 @@ public class ProductCondition {
if ( bos.size() == 0 ) {
Map<String, List<Map<String, String>>> configs = ProductParamUtil.getProductComponentDecisionTable( productId, "PRD0301",
"Rate", "Discount", "DiscountRate", "DiscountCalcMethod", "IsBalanceLending", "DiscountCollectionPeriod", "MaximumDiscount" ,"incomeNumber",
"isFixedDiscount","isUpdateLeaseMoneyRatio","maxLeaseMoney","MinimumDiscount");
"isFixedDiscount","isUpdateLeaseMoneyRatio","maxLeaseMoney","MinimumDiscount","isFixedDiscountRate");
List<Map<String, String>> sf = configs.get( "segmented_financing" );
int i = 1;
String discountCalcMethod = null ;
@ -806,6 +806,7 @@ public class ProductCondition {
bo.setAttributeValue( "IS_UPDATE_LEASE_MONEY_RATIO", f.get( "isUpdateLeaseMoneyRatio" ) );
bo.setAttributeValue( "MAX_LEASE_MONEY", f.get( "maxLeaseMoney" ) );
bo.setAttributeValue( "MINIMUM_DISCOUNT", f.get( "MinimumDiscount" ) );
bo.setAttributeValue( "IS_FIXED_DISCOUNT_RATE", f.get( "isFixedDiscountRate" ) );
bom.saveObject( bo );
i ++;