<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:  Yimeng
    $Date: 2014-11-27 下午01:58:31  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="con_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con_contract_confirm_link" url="${/request/@context_path}/modules/cont/CON543/con_contract_content_confirm.lview"/>
        <a:link id="print_doc_link_id" url="${/request/@context_path}/modules/cont/CON543/contract_approval_signment_print_word.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 con_contract_ds = $(ds_id);
                var records = con_contract_ds.getSelected();
                var record = records[0];
                var contract_id = record.get('contract_id');
                var param = record.data;
                param['function_code'] = 'CON543D';
		        param['contract_id'] = contract_id;
		        param['url_title'] = '合同正本';
		        // param['winid'] = 'con_content_detail_win';
		        hls_doc_get_layout_code('con_get_layout_code_link_id', param, 'con_contract_confirm_link', ds_id);
            };
            
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function(){
                Leaf.showConfirm('提示', '确定打印选中项？', function() {
		             Leaf.Masker.mask(Ext.getBody(), '正在提交');
		             var head_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
		             var record = $(head_id).getSelected()[0];
		             var templt_name = 'contract_approval_signment.xml';
		             var contract_id = record.get('contract_id');
		             var url = $('print_doc_link_id').getUrl() + '?templt_name=' + templt_name + '&contract_id=' + contract_id;
		             var form = document.createElement("form");
		             form.target = "word_export_window";
		             form.method = "post";
		             form.action = url;
		             var iframe = Ext.get('word_export_window') || new Ext.Template('<iframe id ="word_export_window" name="word_export_window" style="position:absolute;left:-10000px;top:-10000px;width:1px;height:1px;display:none"></iframe>').insertFirst(document.body, {}, true);
		             document.body.appendChild(form);
		             form.submit();
		             Ext.fly(form).remove();
		             Leaf.Masker.unmask(Ext.getBody());
		         });
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
