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


{% block subtitle %}
<ol class="breadcrumb">
        <li>{% trans '宴会管理' %}</li>
        <li>{% trans '宴会信息补充' %}</li>
</ol>
{% endblock %}

{% block form_content %}
<script>

    $(document).ready(function () {

        $('#btn_permit').click(function (event) { 
            event.preventDefault();
            var actual_table_num = $("#input_actual_table_num").val();
            var actual_qty_x = $("#input_actual_qty_x").val();

            $.ajax({
                url: '/banquet/ajax/information_edit',
                data:{
                    actual_table_num,
                    actual_qty_x,
                    id:"{{id}}",
                    uid:"{{uid}}"
                },
                success:function(res){
                    if(res.e === ''){
                        $(".alert-success").fadeIn();
                        $.RefreshContent("/banquet/list/apply/"); 
                        setTimeout(function(){ 
                            $(".alert-success").fadeOut();
                        },2000)
                    }
                    else{
                        alert(res.e);
                    }
                },
                error:function(){
                    alert('网络超时！请稍后再试！')
                }
            })
        }); 
		
    })

</script>
<style>
    input[type=checkbox]{
        display: inline-block;
        width: auto;
        height: auto;
        margin-top: 10px;
    }
</style>
<div class="alert alert-success" role="alert" style="display: none">提示：保存成功！</div>
<div class="form-group">
    <label class="col-sm-2 control-label">实际桌数</label>
    <div class="col-sm-8">
        <input type="number" id="input_actual_table_num" placeholder="请输入实际桌数" value="{{actual_table_num}}"/>
	</div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">实际箱数</label>
    <div class="col-sm-8">
        <input type="number" id="input_actual_qty_x" placeholder="请输入实际箱数" value="{{actual_qty_x}}"/>
	</div>
</div>
<div>
    <button class="btn btn-primary" id="btn_permit" style="float:right;">保存</button>
</div>
{% endblock %}