<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2012-1-17 上午09:03:15  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="hls_fin_calc_import_execute_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calc_import_execute.lview"/>
        <script type="text/javascript"><![CDATA[
            /* function saveClick(){
             if (document.getElementById('importFile').value){
             var fileName = document.getElementById('importFile').value;
             var fileType = fileName.substr(fileName.lastIndexOf("."));
             if (fileType != '.xls'){
             alert('${l:SELECT_CORRECT_IMPORT_FILE}');
             } else {
             document.getElementById('importForm').submit();
             }
             }
             } */
            
            function saveClick() {
                if (document.getElementById('importFile').value) {
                    var fileName = document.getElementById('importFile').value;
                    var fileType = fileName.substr(fileName.lastIndexOf("."));
                    if (fileType != '.xls' && fileType != '.xlsx') {
                        alert('${l:SELECT_CORRECT_IMPORT_FILE}');
                    } else {
                        doSubmit();
                    }
                }
            }
            var _input_window;
            
            function doSubmit() {
                _input_window = new $L.Window({
                    title: '${l:HLS.IMPORT}',
                    width: 600,
                    height: 400
                });
                new Ext.Template('<iframe id ="_input_window" name="_input_window" border="0" frameborder="0" height="100%"  width="100%"  style="border:none;padding:0px;margin:0px;"></iframe>').insertFirst(_input_window.body.dom, {}, true);
                $L.Masker.mask(_input_window.body, '${l:HLS.IMPORTING}');
                var form = document.getElementById('importForm');
                var url = $('hls_fin_calc_import_execute_link_id').getUrl() + '?calc_session_id=${/parameter/@calc_session_id}' + '&parent_winId=${/parameter/@parent_winId}' + '&winId=${/parameter/@winId}' + '&document_id=${/parameter/@document_id}' + '&document_category=${/parameter/@document_category}' + '&global_flag=${/parameter/@global_flag}' + '&calc_type=${/parameter/@calc_type}';
                form.action = url;
                form.submit();
                $('${/parameter/@winId}').close();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_calc_label_ds" autoCreate="true">
                <a:fields>
                    <!--<a:field name="label1" defaultValue="注意："/>-->
                    <a:field name="label2" defaultValue="${l:STRICT_IMPORTED_TEMPLATE_DATA}"/>
                    <a:field name="label3" defaultValue="${l:PRODUCT_MASTER_DATA_IMPORT}"/>
                    <a:field name="label4" defaultValue="${l:IMPORTER_ONLY_SUPPORTS}"/>
                    <a:field name="label5" defaultValue="${l:READ_THE_ABOVE_CAREFULLY}"/>
                    <a:field name="label6" defaultValue="${l:THE_IMPORT_IS_COMPLETE}"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="IMPORT_CONSIDERATIONS" width="400">
            <!--<a:label name="label1" bindTarget="hls_calc_label_ds" width="380"/>-->
            <a:label name="label2" bindTarget="hls_calc_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label3" bindTarget="hls_calc_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label4" bindTarget="hls_calc_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label5" bindTarget="hls_calc_label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
            <a:label name="label6" bindTarget="hls_calc_label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
        </a:fieldSet>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="HLS.IMPORT" width="400">
            <form name="upload" id="importForm" enctype="multipart/form-data" method="post" target="_input_window">
                <label style="margin-left:10px;margin-top:10px;font-size:13px"><![CDATA[${l:PLEASE_SELECT_A_FILE}]]></label>
                <input name="CONTENT" id="importFile" style="font-size:15px" type="file"/>
                <input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="${l:HLS.IMPORT_SURE}"/>
            </form>
        </a:fieldSet>
    </a:view>
</a:screen>
