{% extends 'obj_form.html' %}
{% load i18n %}
{% load tj_filters %}


{% block js %}
{{ block.super }}
$('.btn-save').click(function(){
$.SubmitForm('#obj_form form','{{request.path}}');
});


{% endblock %}
{% block subtitle-1 %}
{% trans "公司管理" %}
{% endblock %}
{% block subtitle-2 %}
{% trans "绑定搜索" %}
{% endblock %}


{% block form_content %}
{{ block.super }}

<style>
    #data-content .div_x .sn, #data-content .sn-s {
        width: 210px;
    }

    #data-content .div_detail .sn {
        width: 100px;
    }

    #label_info {
        max-height: 500px;
        overflow-y: auto;
    }

    #qry_code {
        margin: 20px 0px;
    }

    .g {
        color: green;
        font-weight: bold;
    }

    .b {
        color: black;
    }

    .r {
        color: red;
        font-weight: bold;
    }

    #stk_dev thead td {
        color: black;
    }

    #qry_code {
        padding-bottom: 0px;
        margin-bottom: 0px;
    }

    #lbl_replace {
        padding-bottom: 20px;
        font-style: italic;
        color: red;
    }

</style>

<div class="alert alert-info">
    <b>标签绑定查询工具</b>
</div>
<div class="form-group ">
    <label class="col-sm-2 control-label ">
        对应关系
    </label>
    <div class="col-sm-10">
        <input type="text" placeholder="输入箱码或盒码或瓶码" name="label_code" id="code">
    </div>
</div>
<div class="form-group ">
    <label class="col-sm-2 control-label "></label>
    <div class="col-sm-10">
        <a class="btn btn-primary btn-qry btn-save">{% trans '查找绑定详情' %}</a>
    </div>
</div>


{% if search_label %}
<div id='qry_code'>
    <div class="row">
        <div class="col-md-2"><span>标签号码:</span><span class="g">{{search_label}}</span></div>
        <div class="col-md-2"><span>标签类型:</span><span class="g">{{search_label_type}}</span></div>
        <div class="col-md-2"><span>绑定规则:</span><span class="g">{{bind_rule}}</span></div>
        <div class="col-md-6"><span>第三方公司:</span><span class="g">{{search_label_third_company}}</span></div>
    </div>
</div>

<div class="div_detail table-responsive" style="margin-top: 20px;">
    <table class="table table-bordered table-condensed table-hover">
        <thead>
        <th>标签类型</th>
        <th>标签序号</th>
        <th>第三方标签序号</th>
        <th>产品码</th>
        <th>标签采集类型</th>
        </thead>
        <tbody>
        {% for label in labels %}
        <tr>
            <td>{{label.fields.label_type}}</td>
            <td>{{label.fields.label_code}}</td>
            <td>{{label.fields.label_code_out}}</td>
            <td>{{label.fields.label_bar_code}}</td>
            <td>
                {% ifequal label.fields.label_code_type 1 %}
                    条形码
                {% else %}
                     二维码
                {% endifequal%}
            </td>
        </tr>
        {% endfor %}

        </tbody>
    </table>
</div>

<div id="stk_dev" class="table-responsive" style="display: block;">
    <p>操作信息：</p>
    <table class="table table-bordered table-condensed table-hover">
        <tbody>
        <tr class="b">
            <td>时间</td>
            <td>批次</td>
            <td>操作员</td>
            <td>第三方公司</td>
            <td>绑定规则</td>
        </tr>
        <tr>
            <td>{{tm}}</td>
            <td>{{batch_id}}</td>
            <td>{{u_name}}</td>
            <td>{{search_label_third_company}}</td>
            <td>{{bind_rule}}</td>
        </tr>
        </tbody>
    </table>
</div>
{% endif %}


<script>

</script>
{% endblock %}
