Commit 21e37b0a authored by 李贺贺's avatar 李贺贺

租金计算器保存与计算按钮校验修改

parent e4b91448
......@@ -94,11 +94,11 @@
// Leaf.Masker.unmask(body);
// return false;
// }
if(H1>51){
/*if(H1>51){
Leaf.showMessage('${l:PROMPT}', '还款期数应小于51期');
Leaf.Masker.unmask(body);
return false;
}
}*/
var all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
......
......@@ -1524,11 +1524,11 @@
// Leaf.showMessage('${l:PROMPT}', '系统暂时不支持还款期数小于2期的租金计划');
// return false;
// }
if (H1 > 51) {
Leaf.showMessage('${l:PROMPT}', '还款期数应小于51期');
unlock_calc_current_window();
return false;
}
// if (H1 > 51) {
// Leaf.showMessage('${l:PROMPT}', '还款期数应小于51期');
// unlock_calc_current_window();
// return false;
// }
if (H54 < 0) {
Leaf.showMessage('${l:PROMPT}', '利率最低值不能低于4.75');
unlock_calc_current_window();
......@@ -1553,7 +1553,7 @@
unlock_calc_current_window();
return;
}
//if ('${/parameter/@document_category}' == 'PROJECT' && '${/parameter/@business_type}' == 'LEASE') {
if ('${/parameter/@document_category}' == 'PROJECT'||'${/parameter/@document_category}' == 'CONTRACT') {
Leaf.request({
url: $('prj_check_prj_record_link_id').getUrl(),
para: {
......@@ -1565,33 +1565,33 @@
var price_list = res.result.price_list;
var down_payment_rate_new = res.result.down_payment_rate_new;
if ('${/parameter/@document_category}' == 'PROJECT' && '${/parameter/@business_type}' == 'LEASE') {
if ((price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') && secondary_lease == 'NO') {
//比例=(H16+H97)/(H99+H102-H16)
var H16, H97, H99, H102;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H97') {
H97 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H99') {
H99 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H102') {
H102 = temp_head_records[i].get('column_value') || 0
if ((price_list == 'HL_PRICR_E' || price_list == 'HL_PRICR_TEST' || price_list == 'HL_PRICR_NTEST' || price_list == 'HL_PRICR_EN') && secondary_lease == 'NO') {
//比例=(H16+H97)/(H99+H102-H16)
var H16, H97, H99, H102;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H97') {
H97 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H99') {
H99 = temp_head_records[i].get('column_value') || 0
} else if (temp_head_records[i].get('column_code') == 'H102') {
H102 = temp_head_records[i].get('column_value') || 0
}
}
var aa = H16 + H97;
var bb = H99 + H102 - H16;
var cc = div((H16 + H97), (H99 + H102 - H16));
// alert(div((H16+H97), (H99+H102-H16)).toFixed(2) * 1);
var show = down_payment_rate_new * 100;
if ((div((H16 + H97), (H99 + H102 - H16)).toFixed(2) * 1) < down_payment_rate_new) {
unlock_calc_current_window();
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于' + down_payment_rate_new * 100 + '%');
return false;
}
}
var aa = H16 + H97;
var bb = H99 + H102 - H16;
var cc = div((H16 + H97), (H99 + H102 - H16));
// alert(div((H16+H97), (H99+H102-H16)).toFixed(2) * 1);
var show = down_payment_rate_new * 100;
if ((div((H16 + H97), (H99 + H102 - H16)).toFixed(2) * 1) < down_payment_rate_new) {
unlock_calc_current_window();
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于' + down_payment_rate_new * 100 + '%');
return false;
}
}
}
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
......@@ -1624,7 +1624,7 @@
// temp_head_records[i].set('column_value_c',0);
}
}
}else if( '${/parameter/@business_type}' == 'LEASEBACK'){
}else if( '${/parameter/@business_type}' == 'LEASEBACK'){
if (payment_deduction != 'DOWN_PAYMENT_DEDUCTION') {
if (temp_head_records[i].get('column_code') == 'H109') {
temp_head_records[i].set('column_value', 0);
......@@ -1719,47 +1719,47 @@
});
// } else {
// var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
// for (var i = 0; i < temp_head_records.length; i++) {
// if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
// $('temp_hd_attribute_ds').create(temp_head_records[i].data);
// }
// var H16;
// if (temp_head_records[i].get('column_code') == 'H16') {
// H16 = temp_head_records[i].get('column_value');
// }
// if (temp_head_records[i].get('column_code') == 'H109') {
// temp_head_records[i].set('column_value', H16);
// // temp_head_records[i].set('column_value_c',0);
// }
// }
// var all_records = $('temp_hd_attribute_ds').getAll();
// var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
// headRecord.isNew = false;
// headRecord.dirty = true;
// create_record_column(all_records, headRecord);
//
// function hls_fin_cal_save_hd_submitsuccess_new(ds, res) {
// if (typeof (nextStep) == 'function') {
// nextStep(source_procedure);
// } else {
// function on_ln_formula_load(ds) {
// Leaf.SideBar.enable = true;
// success_sidebar_show();
// unlock_calc_current_window();
// $('ln_formula_ds').un('load', on_ln_formula_load);
// }
//
// $('ln_formula_ds').on('load', on_ln_formula_load);
// $('ln_formula_ds').query();
// }
// }
//
// $('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess_new);
// Leaf.SideBar.enable = false;
// $('hls_fin_cal_save_hd_ds').submit();
// }
} else {
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0; i < temp_head_records.length; i++) {
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
var H16;
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value');
}
if (temp_head_records[i].get('column_code') == 'H109') {
temp_head_records[i].set('column_value', H16);
// temp_head_records[i].set('column_value_c',0);
}
}
var all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
headRecord.isNew = false;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess_new(ds, res) {
if (typeof (nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
Leaf.SideBar.enable = true;
success_sidebar_show();
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess_new);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment