{% load i18n %}

<style>

    .inventory-tt .g{
        color:green;
        margin-right:10px;
    }
</style>





<script type="text/javascript">    
    $(document).ready(function(){    
        
        var table=$('#tb-dlg').DataTable({
            dom: 'Bfrtip',
            autoWidth: false,
            buttons: [{extend:'excelHtml5',text:'导出到Excel'}],           
            language:lng,            
            destroy:true,
            data:{{delivery.details|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='inventory-tt'>
    <div>
        <span>单据编号:<span class='g'>{{delivery.code}}</span></span>   
        <span>产品名称:<span class='g'>{{delivery.product.name}}</span></span>    
        <span>保质期限:<span class='g'>{{delivery.product.shelf_life}}</span></span>    
    </div>
    <div>
        <span>经销商名称:<span class='g'>{{delivery.agent.name}}</span></span>   
        <span>发货时间:<span class='g'>{{delivery.time}}</span></span>  
    </div>
</div>
<div class="clearfix"></div>


<div id="inventory-list" class="table-responsive">    

    <table id="tb-dlg" class="table table-striped table-bordered dt-responsive" width="100%">
        <thead>
            {% for c in clmns %}
                <th>{{c}}</th>
            {% endfor %}            
        </thead><tbody></tbody>
        <tfoot>
            {% for c in clmns %}
                <th><input tyext='text' placeholder='{{c}}' /></th>
            {% endfor %}            
        </tfoot>
    
    </table>       
</div>



