{% load i18n %}


<script type="text/javascript">
    $(document).ready(function(){

        $('.datepicker').datepicker({dateFormat: 'yy-mm-dd'});       
        setDatePickerZh();
        
       

        $('.btn-confirm').removeAttr("style",""); 
        $('.btn-confirm').unbind('click').bind('click',function(){    
            $(this).hide();
            $('form').ajaxSubmit({
                type: 'post',
                url: '{{request.path}}',    
                success: function(html) {
                    $('form').html(html);         
                        
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert('连接服务器失败');                        
                }                    
            });
            return; // 阻止表单自动提交事件  
        }).show();

        



        
        {% if is_saved %}   
            $('#confirm-url-modal').modal('hide');                 
            var url=$('#list-tt').attr('current');
            $.ajax({
                type:'GET',
                processData: false,
                contentType: 'application/json; charset=utf-8',
                url:url,
                success: function (html) { 
                    $('#div-list').html(html);                    
                    return;
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert('连接服务器失败');
                    return;
                }
            });
            
        {% endif %}
       
    });
</script>
<style>
    .ui-autocomplete { z-index: 215000000 !important; }
</style>

   
<div class="row">    
    <form role="form" method='POST' class="form-horizontal">    
        {% if messages %}
            {% for message in messages %}
                <div class="alert {% if message.tags %} alert-{{ message.tags }}{% endif %}">{{ message|safe }}</div>
            {% endfor %}
        {% endif %}
        {% if form.errors %}
            <div class="alert alert-error">
                <h4>{% trans '数据输入有错误,请先改正以下错误:' %}</h4>
                <ul>
                    {% for field in form %}
                        {% if field.errors %}
                            {% for error in field.errors %}
                                <li class="error">{{ field.label}}: {{ error|escape }}</li>
                            {% endfor %}
                        {% endif %}
                    {% endfor %}
                </ul>
                {% if form.non_field_errors %}
                    {{ form.non_field_errors }}
                {% endif %}
            </div>
        {% endif %}
        {% for hidden_field in form.hidden_fields %}
            {{ hidden_field }}
        {% endfor %}      

        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '会计期名称:' %} </label>
            <div class="col-sm-10">{{ form.name }}</div>
        </div> 
         <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '期结类型:' %} </label>
            <div class="col-sm-10">{{ form.period }}</div>
        </div>   
        <div>二级商期结：</div>
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '开始日期:' %} </label>
            <div class="col-sm-10">{{ form.dt_fr }}</div>
        </div>   
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '结束日期:' %} </label>
            <div class="col-sm-10">{{form.dt_to}}</div>
        </div>  
        <div>平台商期结：</div>
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '开始日期:' %} </label>
            <div class="col-sm-10">{{ form.lv1_dt_fr }}</div>
        </div>   
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '结束日期:' %} </label>
            <div class="col-sm-10">{{form.lv1_dt_to}}</div>
        </div>  
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% trans '备注说明:' %} </label>
            <div class="col-sm-10">{{form.remark}}</div>
        </div>               
   
    </form>
</div>

