<?xml version="1.0" encoding="UTF-8"?>

<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
        function saveClick() {
            if (document.getElementById('general_importFile').value) {
                var fileName = document.getElementById('general_importFile').value;
                var fileType = fileName.substr(fileName.lastIndexOf("."));
                if (fileType != '.xls' && fileType != '.xlsx' && fileType != '.csv') {
                    Leaf.showInfoMessage("提示",'请选择正确的导入文件!');
                } else {
                    if ('${/parameter/@bank_type}' == 'ABC') {
                        $jq('#general_importForm').attr('action',
                            '${/request/@context_path}/modules/ccb/CCB600/abc_upload.lview?batch_id=${/parameter/@batch_id}&user_id=${/session/@user_id}&_csrf=${/session/@_csrf.token}');
                    } else if ('${/parameter/@bank_type}' == 'CCB') {
                        var due_date_to = new Date('${/parameter/@due_date_to}').format('yyyy-mm-dd');
                        $jq('#general_importForm').attr('action',
                            '${/request/@context_path}/modules/ccb/CCB600/ccb_upload.lview?batch_id=${/parameter/@batch_id}&due_date_to='+due_date_to+'&user_id=${/session/@user_id}&_csrf=${/session/@_csrf.token}');
                    }
                    document.getElementById('general_importForm').submit();
                }
            }
        }

        ]]></script>
        <a:dataSets>
            <a:dataSet id="hcl032_label_ds" autoCreate="true">
                <a:fields>
                    <a:field name="label2" defaultValue="1、请严格按照导入模板整理数据,检查必输项是否缺失。"/>
                    <a:field name="label3" defaultValue="2、目前仅支持 MS Excel。"/>
                    <a:field name="label4" defaultValue="3、执行导入前,请先关闭Excel文件。"/>
                    <a:field name="label6" defaultValue="4、导入完毕后,请在系统中核对数据。"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="注意事项" width="400">
            <!--<a:label name="label1" bindTarget="label_ds" width="380"/>-->
            <a:label name="label2" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label3" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label4" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label6" bindTarget="hcl032_label_ds" style="margin-left:10px;" width="380"/>
        </a:fieldSet>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
            <form name="upload" id="general_importForm"
                  action="abc_upload.lview?batch_id=${/parameter/@batch_id}&amp;user_id=${/session/@user_id}&amp;_csrf=${/session/@_csrf.token}"
                  enctype="multipart/form-data" method="post">
                <input name="CONTENT" id="general_importFile" style="margin-bottom:4px;width:250px;height:22px;"
                       type="file"/>
                <input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button"
                       value="导入"/>
            </form>
        </a:fieldSet>
    </a:view>
</a:screen>