<?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="con638_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="leg820_import_upload_link_id" url="${/request/@context_path}/modules/leg/LEG820/leg_import_upload.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_cashflow');
                var grid_id = ds_id.replace('ds', 'layout_grid_id');
                $(grid_id)._export('xls','${/model/default_function_name/record/@function_name}');
            
            
            };
            
            //发票号导入
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
            
                 new Leaf.Window({
                    id: 'upload_window',
                    url: $('leg820_import_upload_link_id').getUrl() + '?batch_id=${/session/@session_id}',
                    title: '发票号导入',
                    width: 420,
                    height: 280
                }); 
            
            };
            
           
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>