@extends('vip.layouts')
@section('content')

    <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post"
          eventType="eventAjaxForm" lay-filter="submitForm">
        {!! csrf_field() !!}

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 200px;">代理名&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" id="agent_name" name="agent_name" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset(
      $data['agent_user'])?$data['agent_user']:''}}" readonly="readonly">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 200px;">个人分成比例（百分比）&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="ratio" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['ratio'])?$data['ratio']:''}}">
            </div>
            <div class="layui-input-inline">
                <span style="color: red">*若分成比例为0则按默认的等级分成比例计算</span>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 200px;">团队流水比例（百分比）&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="group_ratio" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['group_ratio'])?$data['group_ratio']:''}}">
            </div>
            <div class="layui-input-inline">
                <span style="color: red">*若分成比例为0则按默认的等级分成比例计算</span>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn sub" lay-submit lay-filter="submitForm">确认</button>
            </div>
        </div>
    </form>

    <script>
        //Demo
        layui.use(['form'], function () {
            var form = layui.form;
        //监听提交
            form.on('submit(submitForm)', function (data) {
                return true;
            });
        });
        function cbFormSuccess(data) {
            layer.alert(data.msg,{},function () {
                window.location.href='/admin/nagent/Settle?id={{$data["id"]}}';
            });
        }
    </script>
@endsection
