{% 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:{{dataset|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();
                }
           });
        });     


        {% if perms.company.sys_admin %}
            $('.btn-edit').click(function(){                
                $("#bg-modal").modal('hide');                
                $.RefreshContent('/inventory/edit/batch/{{batch.id}}/');            
            });
        {% endif %}



    });
</script>

<div class='inventory-tt'>
    <span>单据编号:<span class='g'>{{batch.code}}</span></span>   
    <span>产品名称:<span class='g'>{{batch.product}}</span></span>
    {% if batch.plant %}
        <span>工厂名称:<span class='g'>{{batch.plant}}</span></span>
    {% endif %} 
    <span>客户名称:<span class='g'>{{batch.customer}}</span></span>
    <span>仓库名称:<span class='g'>{{batch.store_fr}}</span></span>

    <span>操作人:<span class='g'>{{batch.user}}</span></span>
    <span>上传时间:<span class='g'>{{batch.time}}</span></span>
    {% if perms.company.sys_admin %}
         <button type="button" class="btn btn-primary btn-edit" >修改单据</button>
    {% endif %}

</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>
            <th style='width:8%;'>{% trans "标签号码" %}</th>           
            <th style='width:40%;'>{% trans "发货产品名称" %}</th>
            <th style='width:40%;'>{% trans "入库产品名称" %}</th>
        </thead><tbody></tbody>
        <tfoot>
            <th><input  type="text" placeholder="标签号码"></th>         
            <th><input  type="text" placeholder="发货产品名称"></th>
            <th><input  type="text" placeholder="入库产品名称"></th>
        </tfoot>
    
    </table>       
</div>



