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

{% block css %}
    {{ block.super }}    
   
{% endblock %}



{% block js %}
    {{ block.super }}
    $('.btn-save').click(function(){
        $.SubmitForm('#obj_form form','{{request.path}}');
    });
	
	/**
    $('#product_label').autocomplete({
        source: function (request, response) {
            $.ajax({
                url: '/obj/ajax/autocomplete/product/',
                dataType: "json",
                data: {
                    term: $("#product_label").val(),//搜索栏里的内容
                    company_id: $('#id_company').val(),//额外参数
                },
                success: function (data) {
                    response(data);
                }
            });
        },
        select: function (event, ui) {
            $("#product_id").val(ui.item.value);
            $("#product_label").val(ui.item.label);
            return false;
        }
    });**/
   
{% endblock %}

 
{% block subtitle-1 %}
    {% trans '康年皇冠' %}
{% endblock %}
{% block subtitle-2 %}
    {% trans '仓库库存管理' %}
{% endblock %}   

    


{% block form_content %}
    {{ block.super }}
    
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '仓库:' %} </label>
        <div class="col-sm-10">{{ form.storehouse }}</div>
    </div>   

	<div class="form-group ">
        <label class="col-sm-2 control-label ">操作: </label>
        <div class="col-sm-10">
            <select class="form-control" name="method" id="">
                <option value="1">增加</option>
                <option value="0">减少</option>
            </select>
        </div>
    </div>
      
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '变更原因:' %} </label>
        <div class="col-sm-10">{{ form.reason }}</div>
    </div>    
	
    <!--<div id="chooseProduct"> 
        <div class="form-group " >
            <label class="col-sm-2 control-label">产品选择</label>
            <div class='col-sm-5'>
                <div class="input-group">
                    <input type="text" class="form-control" id="product_label" placeholder="所有产品">
                    <input type="hidden" id="product_id" />
                    <span class="input-group-btn"><button type="button" class="btn btn-success add-product">
                            <span class='glyphicon glyphicon-arrow-down'></span></button></span>
                </div>
            </div>
            <div class="col-sm-1">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="数量" id="product_num">
                </div>
            </div>
        </div> 
        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class='col-sm-6'>
                <select class="select2_multiple form-control" id="sel-product" multiple="multiple"> 
				
                </select>
            </div>
        </div>
    </div>-->

	
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '产品:' %} </label>
        <div class="col-sm-10">{{ form.product }}</div>
    </div>   
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '数量' %} </label>
        <div class="col-sm-10">{{ form.amount }}</div>
    </div>   

    <div>
        <a class="btn btn-primary btn-save" type="submit" style="float:right;">{% trans '保存' %}</a>
    </div>

{% endblock %}
