@extends('vip.layouts')
@section('seo_title')
    {{ trans('menu.finance') }}
@endsection
@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;
        }
        .red{
            color: red;
        }
        .blue{
            color: #1E9FFF;
        }
        .green{
            color: green;
        }
        .yellow{
            color: #ffca10;
        }
    </style>

    <script type="text/html" id="usergetmoney">
<!-- @{{1*d.get_money}} -->
@{{#if(1*d.winmoney>0){ }}
<p style="color:red;">@{{1*d.winmoney}}</p>
@{{#}else{ }}
 <p style="color:green;">@{{1*d.winmoney}}</p>
@{{#} }}

</script>

<script type="text/html" id="username">
<a href="/admin/MoneyList/index?account_name=@{{d.account_name}}&star_time=&end_time=">@{{ d.account_name}}</a>
</script>

<div class="layui-row">

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

		<form class="layui-form rewrite" action="" eventType=eventForm>
            <div class="layui-form-item">
                <input type="hidden" name="agent_name" id="form_agent_name" placeholder="请输入用户名" lay-verify="required" autocomplete="off" class="layui-input" value="{{$agent_name}}" eventType=event-query>
				<div class="layui-inline">
					<label class="layui-form-label">财务日志----活动金额：在加款扣款界面，如果理由包含‘用于活动’这四个字，那此次金额就属于活动金额，不算在盈范围内。</label>
                </div><br>
				<div class="layui-inline">
					<div class="layui-input-inline" style="width: 100px;">
                        <input type="text" name="startime" id="form_startime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item"
                        value="{{$startime}}" eventType=event-query>
                    </div>
					<div class="layui-form-mid">~</div>
                    <div class="layui-input-inline" style="width: 100px;">
						<input type="text" name="endtime"  id="form_endtime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item"
                        value="{{$endtime}}" 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="account_name" id="form_account_name" placeholder="请输入用户名" lay-verify="required" autocomplete="off" class="layui-input" value="{{$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="请输入忽略用户名"  lay-verify="" autocomplete="off" class="layui-input"  value="{{$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"   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>
    </div>
@push('dataTableJS')
/*var active = {
    reload: function(){
      //执行重载
      table.reload('{{ $dataId }}', {
        page: {
          curr: 1 //重新从第 1 页开始
        }
        ,where: {
            account_name:$("#account_name").val(),
            loss_name:$('#form_loss_name').val(),
            startime:$('#form_startime').val(),
            endtime:$('#form_endtime').val(),
        }
      });
    }
  };
$('.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('');
	  $('#form_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
