<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-8-1 下午01:54:29  
    $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_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/CON301/con_contract_query_n.lview"/>
        <script type="text/javascript"><![CDATA[
            function open_contract_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                // $(ds_id).find(record_id);
                var param = record.data;
                param['function_code'] = 'CON301ZXD';
                param['function_usage'] = 'MODIFY';
                param['maintain_type'] = 'UPDATE';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                
                
                //var ds_id_new = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                //var con_contract_ds_new = $(ds_id_new);
                //var records_new = con_contract_ds_new.getSelected();
                //var business_type = records_new[0].get('business_type');
                //var document_type = records_new[0].get('document_type');
                //alert(document_type);
                //param['business_type'] = business_type;
                //param['document_type'] = document_type;
                
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_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;
            };
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            
                if (ds == $(ds_id)) {
                    aut_authority_list_validate_query(ds, qpara);
            
                }
            };
            
            
            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('提示', '请选择一条记录进行操作!');
                    return;
                }
                
                //window.open('http://10.164.12.204/AFP/AFP_auto_muluJuan.aspx?heid='+records[0].get('contract_number'));

            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON301ZX"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
