{% load i18n %}





    <ol class="breadcrumb">
        <li>  {% trans "物流查询" %} </li> 
        <li> {% trans "数据检查" %} </li> 
    </ol>



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


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

       
        

        $('.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_fr='+date_fr)};
            if(date_to!=''){params.push('date_to='+date_to)};

            if(params.length==0){
                bootbox.alert("{% trans '请先输入查询条件！'%}");
            }else{
                $.RefreshContent('{{request.path}}?'+params.join('&'));


            }
        });

        {% ifnotequal params.dt_fr '' %}
            $('#dt_fr').val('{{params.dt_fr}}');
        {% endifnotequal  %}
        {% ifnotequal params.dt_to '' %}
            $('#dt_to').val('{{params.dt_to}}');
        {% endifnotequal  %}
        
       
        var table=$('#tb').DataTable({
            pageLength: 5,
            dom: 'Bfrtip',
            autoWidth: false,
            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();
                }
            });
        });  
        

        $('#tb').on("click","td a",function(){
            //$.RefreshContent($(this).attr('href'));  

             event.preventDefault();
             $.OpenDlg($(this).attr('href'),'数据检查-明细列表',1000,700);

            return false;
        });        
    });
</script>

<form role="form"  class="form-inline" style="margin-top:35px;">
    <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>


<div class='x_panel'>
<br/>
<div id="inventory-list" class="table-responsive">
    <table id="tb" class="table table-striped table-bordered dt-responsive" width="100%"  style='font-size:95%;'>
        <thead>
            <tr>
                <th  style='width:8%'>{% trans "上传时间" %}</th>
                <th  style='width:5%'>{% trans "单据" %}</th>               
                <th  style='width:5%'>{% trans "编号" %}</th>  
                <th  style='width:15%'>{% trans "产品名称" %}</th>   
                <th  style='width:15%'>{% trans "客户名称" %}</th>              
                <th  style='width:8%'>{% trans "仓库名称" %}</th>
                <th  style='width:4%'>{% trans "总数" %}</th>             
                <th  style='width:4%'>{% 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>                   
            <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>
