{% load i18n %}

<ol class="breadcrumb">
    <li> {% trans "物流查询" %}</li>
    <li> {% trans "标签查询" %}</li>
</ol>

<script type="text/javascript">

    $(document).ready(function () {
        $('#xFile').change(function () {
            var f = document.getElementById('xFile').files[0];
            var formData = new FormData();
            formData.append("file", f);
            $.ajax({
                url: "/inventory/query/label_query/",
                type: 'POST',
                data: formData,
                contentType: false,
                processData: false,
                success: function (data) {
                    console.log("111111111111111", data);
                        $('#tb').dataTable().fnDestroy();
                        table = $('#tb').DataTable({
                            dom: 'Bfrtip',
                            autoWidth: true,
                            distory: true,
                            pageLength: 20,
                            buttons: [{extend: 'excelHtml5', text: '导出到Excel'}],
                            language: lng,
                            data: data.data
                        });
                        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();
                                }
                            });
                        });
                        $("#table11").show();
            }})
        });
    });

</script>


<div>
    <div class="col-md-12 col-sm-12 col-xs-12">{% trans "点击右边按钮，选择标签号码TXT文件进行查询：" %}
        <label class="btn btn-primary btn-upload btn-sm" for="xFile">{% trans "上传文件" %}</label>
    </div>
    <form>
        <input type="file" id="xFile" accept="text/plain" style="position:absolute;clip:rect(0 0 0 0);">
    </form>
</div>

<div  id= "table11" class="col-md-12 col-sm-12 col-xs-12"  style="display: none">
    <div class="x_panel">
        <div class="table-responsive">
            <table id='tb'  class="table table-striped table-bordered dt-responsive nowrap " cellspacing="0" width="100%">
                <thead>
                    {% for c in clmns %}
                    <th>{{c}}</th>
                    {% endfor %}
                </thead>
                <tbody></tbody>
                 <tfoot>
                    {% for c in clmns %}
                    <th><input type="text" placeholder="{{c}}"></th>
                    {% endfor %}
                </tfoot>
            </table>
        </div>
    </div>
</div>