Commit 8beb33de authored by stone's avatar stone

【fix】罚息减免测算逻辑修改

parent 5c4321c7
...@@ -17,115 +17,117 @@ ...@@ -17,115 +17,117 @@
//测算逻辑 //测算逻辑
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
//锁屏 //锁屏
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id1 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_penalty_reduce'); var ds_id1 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_penalty_reduce');
var record1 = $(ds_id1).getCurrentRecord(); var record1 = $(ds_id1).getCurrentRecord();
if($(ds_id1).validate()){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_info_save/execute', url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_info_save/execute',
para: { para: {
penalty_reduce_id: record1.get('penalty_reduce_id'), penalty_reduce_id: record1.get('penalty_reduce_id'),
base_date: record1.get('base_date'), base_date: record1.get('base_date'),
penalty_reduction: record1.get('penalty_reduction'), penalty_reduction: record1.get('penalty_reduction'),
reduce_amount_total: record1.get('reduce_amount_total'), reduce_amount_total: record1.get('reduce_amount_total'),
reduce_amount_total_ratio: record1.get('reduce_amount_total_ratio') reduce_amount_total_ratio: record1.get('reduce_amount_total_ratio')
}, },
success: function (res) { success: function (res) {
if (res.result.header_result == 'success') { if (res.result.header_result == 'success') {
var ds_id2 = 'CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds'; var ds_id2 = 'CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds';
$(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id')); $(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id'));
$(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id')); $(ds_id2).setQueryParameter('copy_contract_id',record1.get('copy_contract_id'));
$(ds_id2).query(); $(ds_id2).query();
debugger debugger
var records2 = $(ds_id2).getAll(); var records2 = $(ds_id2).getAll();
if (records2 && records2.length != 0) { if (records2 && records2.length != 0) {
var param_list = []; var param_list = [];
var param = {}; var param = {};
for (var i = 0; i < records2.length; i++) { for (var i = 0; i < records2.length; i++) {
param['penalty_info_id'] = records2[i].get('penalty_info_id'); param['penalty_info_id'] = records2[i].get('penalty_info_id');
param['penalty_reduce_amount'] = records2[i].get('penalty_reduce_amount'); param['penalty_reduce_amount'] = records2[i].get('penalty_reduce_amount');
param['_status'] = 'update'; param['_status'] = 'update';
param_list.push(param); param_list.push(param);
}
Leaf.request({
url: $('contract_penalty_calc_link_id').getUrl(),
para: param_list,
success: function (res1) {
var copy_contract_id = record1.get('copy_contract_id');
var base_date = record1.get('base_date');
Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_calculate/update',
para: {
copy_contract_id: copy_contract_id,
base_date: base_date
},
success: function (res2) {
Leaf.SideBar.show({
msg: '测算成功',
duration: 2000
});
$('CON_PENALTY_REDUCTION_MAINTAIN_F_QUERY_con_contract_penalty_reduce_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_F_CASHFLOW_DETAIL_con_contract_cashflow_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds').query();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} else {
var copy_contract_id = record1.get('copy_contract_id');
var base_date = record1.get('base_date');
Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_calculate/update',
para: {
copy_contract_id: copy_contract_id,
base_date: base_date
},
success: function (res3) {
Leaf.SideBar.show({
msg: '测算成功',
duration: 2000
});
$('CON_PENALTY_REDUCTION_MAINTAIN_F_QUERY_con_contract_penalty_reduce_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_F_CASHFLOW_DETAIL_con_contract_cashflow_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds').query();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} }
Leaf.request({
url: $('contract_penalty_calc_link_id').getUrl(),
para: param_list,
success: function (res1) {
var copy_contract_id = record1.get('copy_contract_id');
var base_date = record1.get('base_date');
Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_calculate/update',
para: {
copy_contract_id: copy_contract_id,
base_date: base_date
},
success: function (res2) {
Leaf.SideBar.show({
msg: '测算成功',
duration: 2000
});
$('CON_PENALTY_REDUCTION_MAINTAIN_F_QUERY_con_contract_penalty_reduce_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_F_CASHFLOW_DETAIL_con_contract_cashflow_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds').query();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} else {
var copy_contract_id = record1.get('copy_contract_id');
var base_date = record1.get('base_date');
Leaf.request({
url: '${/request/@context_path}/autocrud/cont.CON1020.con_contract_penalty_calculate/update',
para: {
copy_contract_id: copy_contract_id,
base_date: base_date
},
success: function (res3) {
Leaf.SideBar.show({
msg: '测算成功',
duration: 2000
});
$('CON_PENALTY_REDUCTION_MAINTAIN_F_QUERY_con_contract_penalty_reduce_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_F_CASHFLOW_DETAIL_con_contract_cashflow_ds').query();
$('CON_PENALTY_REDUCTION_MAINTAIN_G_PENALTY_DETAIL_con_contract_cashflow_ds').query();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} }
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}; };
//分配罚息 //分配罚息
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
......
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