<style>
    .div-tb{
        margin-top:20px;
        height:150px;
        font-size:16px;
        color:black;
    }
    .div-tb table{
        width:100%;
    }
    .div-tb table td{
        height:50px;
    }

    .div-tb td img{
        height:100px;
    }
    
    #print-area .div-tb table tbody td{
        border: 1px solid black;            
    } 

    

    #pg-title .tt{
        color:black;
        font-weight:bold;
        font-size:20px;
        padding-right:20px;
    }


</style>

<script type="text/JavaScript" src="/static/js/jquery-print.min.js"></script>
<link rel="stylesheet" href="/static/css/print/inventorytickets.css" media="print">

<script type="text/javascript">    
    $(document).ready(function(){
    
        $('.btn-print').click(function(){
            $("#print-area").print({
        	    globalStyles: false,
        	    mediaPrint: true,
        	    stylesheet: null,
        	    noPrintSelector: ".no-print",
        	    iframe: true,
        	    append: null,
        	    prepend: null,
        	    manuallyCopyFormValues: true,
        	    deferred: $.Deferred(),
        	    timeout: 750,
        	    title: null,
        	    doctype: '<!doctype html>'
	        });            
        });
    });
</script>

<ol class="breadcrumb">        
    <li>物流工具</li>
    <li>入库启票</li>
</ol>
<div id='pg-title' style="display:flex;">
    <span class='tt'>入库启票打印列表</span>
    <span class='input-group-btn'>
        <a type="button" class='btn btn-primary btn-print'>
            <span class='glyphicon glyphicon-print' style='padding-right:5px;'>
        </span>打印</a>
    </span>
</div>

<div id='print-area'>
    {% for t in tickets %}
    <div class='div-tb'>
        <div>
            <span class='tt' style='font-size:20px;margin-right:20px;'>入库启票</span>
            <span class='dt'>录入日期：{{t.date}}</span>
            <span class='tm pull-right'>打印时间：{{time}}</span>
        </div>
        <table class="table" style='border-collapse: collapse;'>            
            <tbody>
                <tr>
                    <td style='width:20%;'>产品名称</td>
                    <td style='width:10%;'>批次</td>
                    <td style='width:10%;'>批号</td>
                    <td style='width:10%;'>原产地</td>
                    <td style='width:10%;'>生产时间</td>
                    <td style='width:10%;'>生产组装地</td>
                    <td style='width:10%;'>检验员编号</td>
                    <td style='width:10%;'>检验时间</td>
                    <td style='width:8%' rowspan=2><img src="/media/{{user.company.name}}/inboundtickets/{{t.id}}.png"></img></td>
                </tr>
                <tr>
                    <td>{{t.product_name}}</td>
                    <td>{{t.pici}}</td>
                    <td>{{t.pihao}}</td>
                    <td>{{t.origin}}</td>
                    <td>{{t.first_tm}}</td>
                    <td>{{t.assembly}}</td>
                    <td>{{t.check_user}}</td>
                    <td>{{t.check_tm}}</td>
                </tr>
            </tbody>
        </table>
    </div>
    {% endfor %}
</div>
