<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
    </a:init-procedure>
    <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_modify_link"
                url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="${/parameter/@layout_code}_contract_print_link_id"
                url="${/request/@context_path}/modules/cont/CON301N/con_contract_print.lview"/>
        <a:link id="${/parameter/@layout_code}con_contract_query_link"
                url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<!--        <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>-->
        <script type="text/javascript"><![CDATA[

        // stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_CONTRACT_RESULT', 'con_contract');

        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);
        }

        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>';
            }
            return value;
        };

        //页面加载事件
        Leaf.onReady(function() {
            var bp_code='${/model/user_agent_description/record/@bp_code}';


            // if (!Ext.isEmpty(bp_code)&&bp_code!== 'C00010168') {
            //     $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('branch_code_n');
            //     $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('branch_code');
            // }
            // if (!Ext.isEmpty(bp_code)) {
            //     if (bp_code == 'C00010168' || bp_code == 'C00010198' || bp_code == 'C00010170') {
            //         $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').showColumn('large_balance_n');
            //         $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').showColumn('large_balance');
            //     }else {
            //         $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('large_balance_n');
            //         $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('large_balance');
            //     }
            // }


            if (!Ext.isEmpty(bp_code)&&bp_code!== 'D00010001'&&bp_code!=='D00000009') {
                $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('branch_code_n');
                $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('branch_code');
            }
            if (!Ext.isEmpty(bp_code)) {
                if (bp_code == 'D00000041' || bp_code == 'D00010001' || bp_code == 'D00000026') {
                    $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').showColumn('large_balance_n');
                    $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').showColumn('large_balance');
                    document.getElementById('RENTAL_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE_prompt').style.display = 'block';
                    document.getElementById('RENTAL_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE').style.display = 'block';
                }else {
                    $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('large_balance_n');
                    $('RENTAL_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_cashflow_layout_grid_id').hideColumn('large_balance');

                    document.getElementById('RENTAL_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE_prompt').style.display = 'none';
                    document.getElementById('RENTAL_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE').style.display = 'none';

                }
            }
        });


        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
