@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="agent_name">
       <a href="/admin/agentChild/report?agent_name=@{{d.agent_name}}">@{{d.agent_name}}</a>
    </script>
    <script type="text/html" id="sport_profit">
       @{{d.sport}}/ @{{d.sport_profit}}
    </script>
    <script type="text/html" id="real_man_profit">
        @{{d.real_man}}/ @{{d.real_man_profit}}
    </script>
    <script type="text/html" id="total_money_profit">
        @{{d.total_money}}/ @{{d.total_money_profit}}
    </script>
    <script type="text/html" id="six_money_profit">
        @{{d.six_money}}/ @{{d.six_money_profit}}
    </script>
    <script type="text/html" id="total_profit">
        @{{d.total}}/ @{{d.total_profit}}
    </script>
    <script type="text/html" id="toprofit">
        @{{#if(d.total_profit<0){ }}
        <span style="color: green">@{{d.total_profit}}</span>
        @{{#}else{ }}
        <span style="color: red">@{{d.total_profit}}</span>
        @{{#} }}
    </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">活动金额：在加款扣款界面，如果理由包含‘用于活动’这四个字，那此次金额就属于活动金额，不算在盈范围内。</label>
                    </div><br>
                <div class="layui-form-item">
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('agentReport.startime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="startime"  id="form_startime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" value="{{$startime?$startime:trans('status.default_time.seven_day')}}" eventType=event-query>


						</div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('agentReport.endtime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="endtime"  id="form_endtime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" value="{{$endtime?$endtime:trans('status.default_time.etime')}}" eventType=event-query>
						</div>
				   </div>
                            <div class="layui-inline">
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.today_start') }}" data-name="{{ trans('money.today_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">今日</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.yesterday_start') }}" data-name="{{ trans('money.yesterday_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">昨日</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.thisweek_start') }}" data-name="{{ trans('money.thisweek_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">本周</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.prevweek_start') }}" data-name="{{ trans('money.prevweek_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">上周</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.thismonth_start') }}" data-name="{{ trans('money.thismonth_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">本月</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.prevmonth_start') }}" data-name="{{ trans('money.prevmonth_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">上月</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.sevenday_start') }}" data-name="{{ trans('money.sevenday_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">最近7天</a>
                                <a class="layui-btn layui-btn-sm timebutton" data-id="{{ trans('money.thirtyday_start') }}" data-name="{{ trans('money.thirtyday_end') }}"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventtype="event-query-submit">最近30天</a>
                            </div>

                            <br>
                            <div class="layui-inline">
                                <label class="layui-form-label">{{ trans('money.account_name') }}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="agent_name" id="form_agent_name" placeholder="请输入用户名" lay-verify="required" autocomplete="off" class="layui-input" value="{{Request::has('agent_name')?Request::get('agent_name'):$account_name}}" eventType=event-query>
                                </div>
                                <label class="layui-form-label">（多个用户用,隔开）</label>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">{{ trans('money.loss_name') }}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="loss_name"  id="form_loss_name" placeholder="请输入忽略用户名" eventType=event-query  lay-verify="" autocomplete="off" class="layui-input"  value="{{Request::has('loss_name')?Request::get('loss_name'):$loss_name}}" eventType=event-query>
                                </div>
                                <label class="layui-form-label">（多个用户用,隔开）</label>
                            </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;">重置</a>
                                <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
                            </div>

                        </div>

                <!--  </form>
					<div class="layui-inline">
					<a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" style="opacity: 1; pointer-events: auto;">提交</a>
					<a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                    <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><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) : '';
  });*/

$('.timebutton').on('click', function(){
$('#form_startime').val($(this).attr('data-id'));
$('#form_endtime').val($(this).attr('data-name'));
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
