tre_withdraw_query_entrance.lview 6.33 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyu  
    $Date: 2016-8-3 上午11:02:22  
    $Revision: 1.0  
    $Purpose: 提款明细查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <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="tre_factoring_contract_modify_detail_link_id" url="${/request/@context_path}/modules/tre/tre503/tre_factoring_contract_add.lview"/>
        <a:link id="hls_fin_calculator_query_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calculator_readonly.lview"/>
        <a:link id="hn_repayment_approval_template_link" url="${/request/@context_path}/modules/tre/TRE650/hn_repayment_approval_template_print.lview"/>
        <script type="text/javascript"><![CDATA[
            function loan_contract_number(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var loan_contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'tre_loan_contract');
                var param = {};
                param['loan_contract_id'] = record.get('loan_contract_id');
                param['function_code'] = 'TRE503D_QUERY';
                param['function_usage'] = 'QUERY';
                param['cond_para2'] = record.get('way_of_increasing_trust');
                param['document_category'] = record.get('document_category');
                param['document_type'] = record.get('document_type');
                param['document_type_2nd'] = record.get('document_type');
                param['url_title'] = '借款明细';
                param['winid'] = 'tre503d_tre_loan_contract_modify_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'tre_factoring_contract_modify_detail_link_id', loan_contract_ds_id);
            }
            
            function tre_loan_con_quote(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var calc_type = 'CLASSIC_CALCULATOR';
                if (record.get('calc_session_id')) {
                    quo_win_query = new Leaf.Window({
                        id: '${/parameter/@layout_code}_hls_fin_calc_quotation_query_link_winid',
                        params: {
                            document_id: record.get('loan_contract_id'),
                            document_category: record.get('document_category'),
                            maintain_type: 'QUERY',
                            calc_session_id: record.get('calc_session_id'),
                            quotation_id: null,
                            dsId: null,
                            winId: '${/parameter/@layout_code}_hls_fin_calc_quotation_query_link_winid',
                            global_flag: 'Y',
                            id_num: 0,
                            calc_type: calc_type,
                            recreate_L_formula: 'N'
                        },
                        url: $('hls_fin_calculator_query_link_id').getUrl(),
                        fullScreen: true,
                        draggable: true
                    });
                }
            }
            
            //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                var link_function = '';
                window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                if (name == 'loan_contract_number') {
                    link_function = 'loan_contract_number';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
                } else if (name == 'quotation') {
                    link_function = 'tre_loan_con_quote';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                }
            };
            
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                $('${/parameter/@layout_code}_G_RESULT_prj_quotation_layout_grid_id')._export();
            };
            
            //生成提款审批表
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
                var repayment_ds = $(ds_id);
                var records = repayment_ds.getSelected();
                if (records.length != 1) {
                    Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
                    return;
                }
                var quotation_id = records[0].get('quotation_id');
                var loan_contract_id = records[0].get('loan_contract_id');
                Leaf.showConfirm('${l:HLS.PROMPT}', '您确定要生成提款审批表吗?', function() {
                    var templt_name = 'hn_repayment_approval_template.xml';
                    var url = $('hn_repayment_approval_template_link').getUrl() + '?templt_name=' + templt_name + '&loan_contract_id=' + loan_contract_id + '&quotation_id=' + quotation_id;
                    var form = document.createElement("form");
                    form.target = "word_export_window";
                    form.method = "post";
                    form.action = url;
                    var iframe = Ext.get('word_export_window') || new Ext.Template('<iframe id ="word_export_window" name="word_export_window" style="position:absolute;left:-10000px;top:-10000px;width:1px;height:1px;display:none"></iframe>').insertFirst(document.body, {}, true);
                    document.body.appendChild(form);
                    form.submit();
                    Ext.fly(form).remove();
                });
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>