@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.点位设置') }}</h4>
                            <table class="table table-bordered">
                                    <input class="form-control" type="text" id="num" value="{{$data->Commission}}" />
                                    <input type="hidden" id="spreader_id"  value="{{$data->SpreaderID}}">
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="set({{ $data->UserID }})">
                                        {{ __('auto.提交') }}
                                    </button>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function set(id){
            myConfirm("{{ __('auto.是否继续') }}?",function(){
                var num= document.getElementById('num').value;
                var spreader_id= document.getElementById('spreader_id').value;
                myRequest("/admin/subordinate/setcommission/"+id,"post",{num:num,spreader_id:spreader_id},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        parent.location.reload();
                    },1500)
                });
            });
        }
    </script>
@endsection
