<!-- 导入指标源 -->
<div id="upload" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">导入造价文件</h5>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            </div>
            <form method="POST" action="/lib/upload?_csrf=<%= ctx.csrf %>" enctype="multipart/form-data" onsubmit="return checkfileupload();">
                <div class="modal-body">
                    <div class="form-group">
                        <label for="exampleFormControlFile1">上传造价文件</label>
                        <div class="form-control"><input class="form-control-file" id="exampleFormControlFile1" accept=".json" name="file" type="file"></div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary" type="submit">确认导入</button>
                    <button class="btn btn-secondary" type="button" data-dismiss="modal" aria-hidden="true">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function checkfileupload() {
        if($('#exampleFormControlFile1').val() == ''){
            alert('请选择上传文件');
            return false;
        }
    }
</script>