<?xml version="1.0" encoding="UTF-8"?>
<!--
  create by nyl  2014-12-3 
  for contract context create
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="con624_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con_contract_rent_dun_link_id" url="${/request/@context_path}/modules/cont/CON621/con_contract_rent_dun_modify.lview"/>
        <a:link id="con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON301/con_contract_query_n.lview"/>
        <script type="text/javascript"><![CDATA[
            function con620n_open_contract_win(record_id, ds_id) {
            
                //var record = $(ds_id).getCurrentRecord();
                var record = $(ds_id).findById(record_id);
                var param = record.data; // new Object();
                maintain_type = 'READONLY';
                param['function_code'] = 'CON301R';
                param['function_usage'] = 'MODIFY';
                param['url_title'] = '合同明细';
                url_l = 'con_contract_update_link_id';
                param['maintain_type'] = maintain_type;
                new Leaf.Window({
                    id: 'con_get_layout_code_winid',
                    params: param,
                    url: $('con_contract_update_link_id').getUrl(),
                    title: param['url_title'] + '(' + 'CONTRACT_QUERY' + ')',
                    fullScreen: true,
                    draggable: true
                });
                // hls_doc_get_layout_code('con624_get_layout_code_link_id', param, 'con_contract_update_link_id', ds_id);
            }
            
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'contract_number') {
                    return '<a href="javascript:con620n_open_contract_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
                }
                return value;
            };
            
            //租金催收记录
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                var records = $(ds_id).getSelected();
                if (records.length != 1) {
                    Leaf.showMessage('提示', '请选择单条数据！', null, 350);
                    return;
                }
                var param = records[0].data;
                param['function_code'] = 'CON621';
                param['function_usage'] = 'MODIFY';
                param['url_title'] = '租金催收';
                param['winid'] = 'con621_get_layout_code_winid';
                new Leaf.Window({
                    id: 'con_get_layout_code_winid',
                    params: param,
                    url: $('con_contract_rent_dun_link_id').getUrl(),
                    title: param['url_title'] + '(' + 'AST_COLLECTION_RECORD' + ')',
                    fullScreen: true,
                    draggable: true
                });
            
                //  hls_doc_get_layout_code('con624_get_layout_code_link_id', param, 'con_contract_rent_dun_link_id', ds_id);
            };
            
            //查询时调用(grid,table,gridBox)
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
                var contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                qpara['collector_user_id'] = ${/parameter/@collector_user_id};
            
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
