@extends('vip.layouts')
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }

        .layui-form-switch em {
            width: auto;
        }

        .layui-form-switch {
            width: 44px;
            line-height: 23px;
        }

        .layui-form-item .checkbox {
            width: auto;
        }
    </style>
    <script type="text/html" id="tool">
       <a href="/admin/NagentTake/edit?id=@{{ d.id }}" >审核</a>
    </script>

    <script type="text/html" id="status">
        @{{#if(d.status==1){ }}
        <p style="color:blue;">申请中</p>
        @{{#}else{ }}
        @{{#if(d.status==2){ }}
         <p style="color:green;">成功</p>
        @{{#}else{ }}
         <p style="color:red;">失败</p>
        @{{#} }}
        @{{#} }}
    </script>
    <!---注单管理-->
    <div class="layui-row">

        <div class="layui-col-xs12">

            <form class="layui-form rewrite" action="" eventType=eventForm>
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('nagent.agent_user') }}</label>
                        <div class="layui-input-inline">
                            <input type="text" name="agent_name" id="form_agent_name" value="{{ $agent_name }}" eventType=event-query lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                        {{--<div class="layui-input-inline checkbox">--}}
                            {{--<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>--}}
                        {{--</div>--}}
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">订单状态</label>
                        <div class="layui-input-inline" style="width: 200px">
                            <select name="status" id="from_status" lay-verify="" autocomplete="off" eventType=event-query class="layui-input">
                                <option value="">选择订单状态</option>
                                <option @if($status==1) selected = "selected"   @endif value="1" selected>申请中</option>
                                <option @if($status==2)  selected= "selected"   @endif value="2">成功</option>
                                <option @if($status==3) selected = "selected"   @endif value="3">失败</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">金额区间</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="money_small" id="form_money_small" placeholder="￥0" autocomplete="off" class="layui-input" eventtype="event-query" value="">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="money_big" id="form_money_big" placeholder="￥0" autocomplete="off" class="layui-input" eventtype="event-query" value="">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">开始时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="start_time"  id="form_startime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item"  value="{{ $start_time }}" eventType=event-query>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="end_time"  id="form_endtime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" value="{{ $end_time }}" eventType=event-query>
                        </div>
                    </div>

                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-sm lay-btn-diy" eventType=event-query-submit  data-type="reload" style="opacity: 1; pointer-events: auto;"
                           eventType=event-query-submit>提交</a>
                        <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;"
                            eventType=event-query-submit>重置</a>
                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;" eventType=event-query-submit
                        >
                            <i class="layui-icon">ဂ</i>
                        </a>
                    </div>

                <!--  &nbsp;&nbsp;&nbsp;&nbsp;<div class="layui-inline"><a href="javascript:openWin('/admin/system/addMenu','{{ trans("menu.menu_add")}}','600px','800px','')"
                     class="layui-btn layui-btn-sm">添加</a></div>
                    <div class="layui-inline"><a href="/admin/menu/add"
                                                 class="layui-btn layui-btn-sm  layui-btn-danger">删除</a></div> -->

                </div>
            </form>
        </div>
    </div>
@push('dataTableJS')
/*var active = {
    reload: function(){
      //执行重载
      table.reload('{{ $dataId }}', {
        page: {
          curr: 1 //重新从第 1 页开始
        }
        ,where: {
            agent_user:$("#agent_user").val(),
            grade:$('#grade').val(),
            phone:$('#phone').val(),
            email:$('#email').val(),
            type:$('#type').val(),
            status:$('#status').val(),
            regist_startime:$('#regist_startime').val(),
            regist_endtime:$('#regist_endtime').val(),
			sureblur:$('.layui-form-switch').text(),
        }
      });
    }
  };
$('.lay-btn-diy').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });*/

  //重置表单
  $('.reset').on('click',function(){
	  $('input').val('');
	  $('#grade').val('');
	  $('#type').val('');
	  $('#status').val('');
//	  var type = $(this).data('type');
//	  active[type] ? active[type].call(this) : '';
  });

    //刷新表单
//    $('.set').on('click',function(){
//    var type = $(this).data('type');
//    active[type] ? active[type].call(this) : '';
//    });
@endpush

    @include('vip.datatable')
@endsection
