<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2016-1-5 下午5:21:04  
    $Revision: 1.0  
    $Purpose: 其他业务入口
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query model="sdic.SDIC100.get_deafault_parameter" rootPath="parameter_info"/>
    </a:init-procedure>
    <a:view>
        <a:link id="sdic100d_other_contract_modify_link_id" url="${/request/@context_path}/modules/sdic/SDIC100/sdic_other_contract_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'], 'sdic_other_contract');
                if ($(ds_id).validate()) {
                    var record = $(ds_id).getAt(0);
                    var param = record.data;
            
                    //保理
                    param['document_type_2nd'] = 'FACTORING_CONTRACT';
            
                    param['default_value_dsid'] = ds_id;
                    param['pre_layout_code'] = '${/parameter/@layout_code}';
                    param['function_code'] = 'SDIC100D';
                    param['function_usage'] = 'CREATE';
                    param['url_title'] = '其他业务明细';
                    param['winid'] = 'tre503d_loan_contract_detail_detail_winid';
                    hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'sdic100d_other_contract_modify_link_id');
                }
            };
            
            
            //加载时调用
            window['${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records) {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'sdic_other_contract');
                if (ds.id == ds_id && ds_id) {
                    head_record = $(ds_id).getAt(0);
                    head_record.set('employee_id', '${/model/parameter_info/record/@employee_id}');
                    head_record.set('employee_id_n', '${/model/parameter_info/record/@employee_id_n}');
                    head_record.set('unit_id', '${/model/parameter_info/record/@unit_id}');
                    head_record.set('unit_id_n', '${/model/parameter_info/record/@unit_id_n}');
                    head_record.set('employee_id_of_manager_n', '${/model/parameter_info/record/@employee_id_of_manager_n}');
                    head_record.set('employee_id_of_manager', '${/model/parameter_info/record/@employee_id_of_manager}');
                }
            };
        ]]></script>
    </a:view>
</a:screen>
