{% load i18n %}




<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" />
    </div>
    <div class="col-sm-3 input-group">
        <span class="input-group-addon">{% trans "结束日期"%}</span>
        <input class="datepicker form-control" id="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>        
    </div>
</form>
<div class="clearfix"></div>



<script type="text/javascript">
    $(document).ready(function(){     
        $('.datepicker').datepicker({dateFormat: 'yy-mm-dd'});
        $('.datepicker').datepicker('setDate',new Date());
        setDatePickerZh();

        $('#dt_fr').val('{{date_from}}');
        $('#dt_to').val('{{date_to}}');

        $('.btn-qry').click(function(){
            var date_from,date_to;
            date_fr=$('#dt_fr').val();
            date_to=$('#dt_to').val();
            var params=[];
            if(date_fr!=''){params.push('date_from='+date_fr)};
            if(date_to!=''){params.push('date_to='+date_to)};

            if(params.length==0){
                bootbox.alert("{% trans '请先输入查询条件！'%}");
            }else{
                $.RefreshContent('{{request.path}}?'+params.join('&'));
            }
        });
        
        var table=$('#tb_lv1').DataTable({                        
            dom: 'Bfrtip',
            autoWidth: false,
            buttons: [{extend:'excelHtml5',text:'导出到Excel'}],           
            language:lng,       
            pageLength: 5,
            data:{{lv1|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();
                }
            });
        });  

        var table=$('#tb_lv2').DataTable({
            dom: 'Bfrtip',
            autoWidth: false,
            buttons: [{extend:'excelHtml5',text:'导出到Excel'}],           
            language:lng,    
            pageLength: 5,
            data:{{lv2|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();
                }
            });
        });  
    });
</script>


<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>{% trans "平台商 (一级经销商)" %}</h2>
                <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>                      
                      <li><a class="close-link"><i class="fa fa-close"></i></a></li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <table id="tb_lv1" class="display" width="100%">
                <thead><tr>
                    <th  style='width:40%'>{% trans "经销商名称" %}</th>
                    <th  style='width:10%'>{% trans "内参发货" %}</th>
                    <th  style='width:10%'>{% trans "扫码出库" %}</th>
                    <th  style='width:10%'>{% trans "扫码率" %}</th>
                </tr></thead>
                <tbody></tbody>
                <tfoot>
                    <th><input type="text" placeholder="{% trans '搜索名称' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索数量' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索数量' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索百分比' %}"></th>
                </tfoot>
                </table>       
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>{% trans "门店 (二级经销商)" %}</h2>
                <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>                      
                      <li><a class="close-link"><i class="fa fa-close"></i></a></li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <table id="tb_lv2" class="display" width="100%">
                <thead> <tr>
                    <th  style='width:20%'>{% trans "所属平台商" %}</th>
                    <th  style='width:20%'>{% trans "门店名称" %}</th>
                    <th  style='width:10%'>{% trans "平台商发货" %}</th>
                    <th  style='width:10%'>{% trans "扫码入库" %}</th>
                    <th  style='width:10%'>{% trans "扫码出库" %}</th>                              
                </tr> </thead>
                <tbody></tbody>
                <tfoot>
                    <th><input type="text" placeholder="{% trans '搜索名称' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索名称' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索数量' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索数量' %}"></th>
                    <th><input type="text" placeholder="{% trans '搜索数量' %}"></th>
                </tfoot>
                </table>       
            </div>
        </div>
    </div>
</div>

