<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LPC
    $Date: 2018-6-26 11:08:57
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" 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="lon100Q_detail_open_link" url="${/request/@context_path}/modules/lon/LON110/bp_contract_credit_query.lview"/>
        <a:link id="credit_detail_open_link" url="${/request/@context_path}/modules/lon/LON100/bp_credit_query.lview"/>
        <script type="text/javascript"><![CDATA[

        function open_detail_win(credit_contract_id) {
            var lon_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'lon_credit_contract');
            var record = $(lon_ds_id).getCurrentRecord();
            var param = record.data;
            param['function_code'] = 'LON110H';
            param['function_usage'] = 'QUERY';
            param['credit_contract_id']=record.get('credit_contract_id');
            param['url_title'] = '额度占用查询';
            param['winid'] = 'lon100Q_detail_open_winid';
            hls_doc_get_layout_code('get_layout_code_link_id', param, 'lon100Q_detail_open_link');
            // $jq('#widget512_detail_open_winid').css('z-index',160);
        }

        function open_credit_detail_win(credit_contract_id) {
            var lon_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'lon_credit_contract');
            var record = $(lon_ds_id).getCurrentRecord();
            var param = record.data;
            param['function_code'] = 'LON100C';
            param['function_usage'] = 'QUERY';
            param['credit_contract_id']=record.get('credit_contract_id');
            param['url_title'] = '授信额度查询';
            param['winid'] = 'credit_detail_open_winid';
            hls_doc_get_layout_code('get_layout_code_link_id', param, 'credit_detail_open_link');
            // $jq('#widget512_detail_open_winid').css('z-index',160);
        }

        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
            if (name == 'detail') {
                return '<a href="javascript:open_detail_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + '额度占用' + '</a>';
            }
            if (name == 'credit_contract_name') {
                return '<a href="javascript:open_credit_detail_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
            }
            return value;
        };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>