<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-8-30 上午10:24:11  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
            function hls_doc_get_layout_code(bm_url_link, param, win_url_link, list_ds) {
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: $(bm_url_link).getUrl(),
                    para: param,
                    success: function(res) {
                        Leaf.Masker.unmask(Ext.getBody());
                        if (!res.result.layout_code) {
                            Leaf.showMessage('${l:PROMPT}', '${l:HLS.LAYOUT_CODE_IS_NULL}');
                            return;
                        }
                        var win = new Leaf.Window({
                            id: 'hls_doc_get_layout_code_winid',
                            params: {
                                document_id: param['document_id'],
                                change_req_id: param['change_req_id'],
                                document_category: param['document_category'],
                                document_type: param['document_type'],
                                company_id: param['company_id'],
                                cdd_list_id: param['cdd_list_id'],
                                default_value_dsid: param['default_value_dsid'],
                                layout_code: res.result.layout_code,
                                calc_type: res.result.cond_para1,
                                function_usage: param['function_usage'],
                                usage_type: param['usage_type'],
                                function_code: param['function_code'],
                                maintain_type: param['maintain_type'],
                                number_of_tenant: param['number_of_tenant'],
                                number_of_guarantor: param['number_of_guarantor'],
                                number_of_actual_controller: param['number_of_actual_controller'],
                                winid: 'hls_doc_get_layout_code_winid'
                            },
                            url: $(win_url_link).getUrl(),
                            //title: param['url_title'] + '(' + res.result.layout_code + ')',
                            title: param['url_title'],
                            fullScreen: true,
                            draggable: true
                        });
                        win.on('close', function() {
                            if (list_ds) {
                                $(list_ds).query();
                            }
                        });
                    },
                    failure: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
            }
        ]]></script>
    </a:view>
</a:screen>
