Commit 38ffcfd3 authored by panhong18943's avatar panhong18943

付款单生成功能优化

parent 6191c185
...@@ -10,7 +10,45 @@ ...@@ -10,7 +10,45 @@
<a:view> <a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="pageLink_choose_acount" url="${/request/@context_path}/modules/hsbc/HSBC100/csh_bank_account_choose.lview"/> <a:link id="pageLink_choose_acount" url="${/request/@context_path}/modules/hsbc/HSBC100/csh_bank_account_choose.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="transaction_return_downloadFile_link_id" url="${/request/@context_path}/downloadFile.lview"/>
<script src="${/request/@context_path}/javascripts/calculate.js"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
function open_contract_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_usage'] = 'QUERY';
param['function_code'] = 'CON3200Q';
param['maintain_type'] = 'QUERY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
}
function open_return_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var header_id = record.data.return_id;
var url = $('transaction_return_downloadFile_link_id').getUrl() + '?table_name=CSH_TRANSACTION_RETURN&_csrf=${/session/@_csrf.token}&header_id=' + header_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'transaction_return_uploadFile_id',
width: 850,
height: 400
});
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
if (name == 'attachment_r') {
return '<a href="javascript:open_return_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + '附件' + '</a>';
}
return value;
};
//创建代付单 //创建代付单
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln'); var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
...@@ -118,7 +156,57 @@ ...@@ -118,7 +156,57 @@
}); });
}; };
]]></script> window['${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_transaction_return');
var form_record = $(form_ds_id).getAt(0);
var req_records = $(req_ln_ds_id).getSelected();
var con_records = $(con_ds_id).getSelected();
if (req_ln_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < req_records.length;i++) {
sum = plus(sum, req_records[i].get('unpaid_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
if (con_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function(ds, record, bp_seq) {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_transaction_return');
var form_record = $(form_ds_id).getAt(0);
var req_records = $(req_ln_ds_id).getSelected();
var con_records = $(con_ds_id).getSelected();
if (req_ln_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < req_records.length;i++) {
sum = plus(sum, req_records[i].get('unpaid_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
if (con_ds_id == ds.id) {
var sum = 0;
for (var i = 0;i < con_records.length;i++) {
sum = plus(sum, con_records[i].get('this_return_amount'));
}
form_record.set('total_unpaid_amount', sum);
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view> </a:view>
</a:screen> </a:screen>
\ No newline at end of file
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