<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyu  
    $Date: 2016-3-10 下午15:11:25  
    $Revision: 1.0  
    $Purpose: 开户申请
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sdic200_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="sdic200_bank_account_modify_link_id" url="${/request/@context_path}/modules/sdic/SDIC200/sdic_bank_account_req_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_bank_account_req_hd');
                var param = {};
                param['function_code'] = 'SDIC200N';
                param['function_usage'] = 'CREATE';
                param['url_title'] = '开户申请';
                param['winid'] = 'sdic200_bank_account_modify_winid';
                hls_doc_get_layout_code('sdic200_get_layout_code_link_id', param, 'sdic200_bank_account_modify_link_id',ds_id);
            };
            
            //
            
            
            function sdic200_req_number_link(record_id, name) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][record_id + '---' + name];
                var hd_id = record.get('hd_id'),
                    approve_status = record.get('req_status');
                var param = record.data;
                param['hd_id'] = hd_id;

                if (approve_status == 'NEW' || approve_status == 'REJECT') {
                    param['function_code'] = 'SDIC200N';
                    param['function_usage'] = 'MODIFY';
                } else {
                    param['function_code'] = 'SDIC200N_WFL';
                    param['function_usage'] = 'QUERY';
                }
                param['url_title'] = '开户申请';
                param['winid'] = 'sdic200_bank_account_modify_winid';
                hls_doc_get_layout_code('sdic200_get_layout_code_link_id', param, 'sdic200_bank_account_modify_link_id',record.ds.id);
            }
            
            //超链接
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record, bp_seq) {
                var link_function = '';
                window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                if (name == 'req_number') {
                    link_function = 'sdic200_req_number_link';
                    if (record.get('hd_id')) {
                        return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + value + '</a>';
                    } else {
                        return '';
                    }
                }
                return value;
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
