<?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:init-procedure>
        <a:model-query defaultWhereClause="t1.function_code = ${/parameter/@function_code}" model="cus.CUS100.cus_default_function_name" rootPath="default_function_name"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con650_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="leg_legal_fee_modify_link_id" url="${/request/@context_path}/modules/cont/CON650/cus_con_auto_fee_modify.lview"/>
        <script type="text/javascript"><![CDATA[
            //导出
            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 grid_id = ds_id.replace('ds', 'layout_grid_id');
                $(grid_id)._export('xls','${/model/default_function_name/record/@function_name}');
            
            
            };
            
             function open_contract_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
 
                maintain_type = 'CREATE';
                param['function_code'] = 'CON650D';
                param['function_usage'] = 'CREATE'; 
                param['url_title'] = 'AUTO费用维护';
                url_l = 'leg_legal_fee_modify_link_id';
               
                param['maintain_type'] = maintain_type;
                
                hls_doc_get_layout_code('con650_get_layout_code_link_id', param, url_l,ds_id);
            
            }
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                
               /*  if (name == 'contract_number') {
                    if (record.get('legal_fee_count') >= 1) {
                        return '<a style="color:red"  href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                       
                    } else {
                        return '<a   href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                    }
                    
                }  */
                 if (name == 'contract_number') {
                    
                        return '<a   href="javascript:open_contract_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>
