<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:   
    $Date: 2014-8-4 下午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_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="pageLink_bpQueryScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="pageLink_insurance_claim_matain" url="${/request/@context_path}/modules/ins/INS503/ins_insurance_claim_matain.lview"/>
        <script type="text/javascript"><![CDATA[
            function open_bp_modify_win(ds_id, record_id) {
                 var param = new Object();
                if ('null' == record_id) {
                   
                     param['url_title'] = '保险理赔新增';
                } else {
                    var record = $(ds_id).findById(record_id);
                     param = record.data; // new Object();
                     param['url_title'] = '保险理赔修改';
                }
            
                //  alert(param['policy_id']);
                param['function_code'] = 'INS503D';
                param['function_usage'] = 'CREATE';
                param['master_type'] = 'INSURANCE';
                param['master_id'] = param['claims_id'];
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'pageLink_insurance_claim_matain', ds_id);
                // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_bp_master_modify_link', ds_id);
            }
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'machine_number' && value) {
                    return '<a href="javascript:open_bp_modify_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                }
                return '';
            };
            
            
            
            //新增
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
              
            
                open_bp_modify_win(ds_id, 'null');
                /*  var win = new Leaf.Window({
                 id: 'insurance_claim_matain_screen',
                 url: $('pageLink_insurance_claim_matain').getUrl(),
                 params: {
                 layout_code : 'INSURANCE_CLAIM_MATAIN',
                 usage_type : '',
                 calc_type : '',
                 winid	: 'insurance_claim_matain_screen'
                 },
                 title: '保险理赔新增(INSURANCE_CLAIM_MATAIN)',
                 fullScreen: true,
                 draggable: true
                 }); */
            };
            
            //修改
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
                var record = $(ds_id).getSelected()[0];
                open_bp_modify_win(ds_id, record.id);
            
            };
            
            //删除
            window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
            
               };
            
            //上传
            window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
            
               };
            
            
            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'], 'cla_insurance_claims_policy');
            
                if (ds == $(ds_id)) {
                    aut_authority_list_validate_query(ds, qpara);
            
                }
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=INSURANCE&amp;function_code=INS503"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>