{% load i18n %}

<script type="text/javascript">
    $(document).ready(function(){
        var table=$('#tb').DataTable({
            dom: 'Bfrtip',
            autoWidth: true,
            buttons: [{extend:'excelHtml5',text: '导出到Excel'}],
            language:lng,
            data:{{data|safe}}
        });
        table.columns().every( function () {
            var that = this;
            $('input', this.footer() ).on( 'keyup change clear', function () {
                if ( that.search() !== this.value ) {
                    that.search( this.value ).draw();
                }
            });
        });

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

        {% ifnotequal dt_fr '' %}
            $('#dt_fr').val('{{dt_fr}}');
        {% endifnotequal  %}
        {% ifnotequal dt_to '' %}
            $('#dt_to').val('{{dt_to}}');
        {% endifnotequal  %}
        $('.btn-qry').click(function(){
            var dt_fr,dt_to;
            dt_fr=$('#dt_fr').val();
            dt_to=$('#dt_to').val();
            $.RefreshContent('{{request.path}}?dt_fr='+dt_fr+'&dt_to='+dt_to);
        });

        /*
        $('#data-content').on("click","a.btn-obj-add",function(){
            event.preventDefault();
            $.RefreshContent($(this).attr('href'));
        });
        $('#tb').on("click","td a",function(event){
            event.preventDefault();
            $.RefreshContent($(this).attr('href'));
        });
        */

    });
</script>
<style>
    #tb tbody img{
        height:30px;
    }
    #tb thead th.img{
        width:60px;
    }
</style>

<ol class="breadcrumb">
        <li>{% trans "领用核销" %}</li>
        <li>{% trans "经销商核销列表" %}</li>
</ol>


<form role="form"  class="form-inline" style="margin-top:0px;">
    <div class="col-sm-3 input-group">
        <span class="input-group-addon">{% trans "开始日期"%}</span>
        <input class="datepicker form-control" id="dt_fr"  value="{{dt_fr}}"/>
    </div>
    <div class="col-sm-3 input-group">
        <span class="input-group-addon">{% trans "结束日期"%}</span>
        <input class="datepicker form-control" id="dt_to" value="{{dt_to}}"/>
    </div>

    <div style="float:right;">
        <span class='input-group-btn'>
            <a type="button" class='btn btn-primary btn-qry'>
                <span class='glyphicon glyphicon-search' style='padding-right:5px;'></span>{% trans '查找' %}
            </a>
        </span>
        <!--
        <button class="btn btn-sm btn-primary btn-qry" type="button"><i class="fa fa-search"></i> {% trans '查找' %}</button>
        -->
    </div>
</form>

<div class="clearfix"></div>



    <div class="x_panel">
        <div  class="table-responsive">
            <table id='tb'  class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
            <thead>
                {% for c in clmns %}
                    <th class="{{c.cls}}">{{c.tt}}</th>
                {% endfor %}
            </thead>
            <tbody></tbody>
            <tfoot>
                {% for c in clmns %}
                    <th><input type="text" placeholder="{{c.tt}}"></th>
                {% endfor %}
            </tfoot>
            </table>
        </div>
    </div>

