369 lines
22 KiB
PHP
369 lines
22 KiB
PHP
@extends('layouts.base')
|
||
@section('title', trans($title))
|
||
@section('content')
|
||
<style>
|
||
.time {
|
||
width: 30%;
|
||
float: left;
|
||
}
|
||
table a {
|
||
color: #333;
|
||
}
|
||
|
||
.table-responsive {
|
||
padding-bottom: 80px;
|
||
overflow: hidden !important;
|
||
}
|
||
.panel-body .label{
|
||
font-size: 13px!important;
|
||
}
|
||
</style>
|
||
<div class="w1200 ">
|
||
<div class=" rightlist ">
|
||
<div class="right-titpos">
|
||
<ul class="add-snav">
|
||
<li class="active"><a href="#">{{$title}}</a></li>
|
||
<a class="btn btn-primary" href="{!! yzWebUrl('plugin.team-dividend.admin.team-agency.add') !!}"><i class="fa fa-plus"></i> 添加经销商</a>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="right-addbox"><!-- 此处是右侧内容新包一层div -->
|
||
<div class="panel panel-info">
|
||
<div class="panel-body" style="padding: 15px;">
|
||
<div>经销商概况 | 经销商总人数 {{$total}}</div>
|
||
</div>
|
||
</div>
|
||
<div class="panel panel-info">
|
||
<div class="panel-body">
|
||
<form action="{!! yzWebUrl('plugin.team-dividend.admin.team-agency') !!}" method="post" class="form-horizontal" role="form" id="form1">
|
||
<div class="form-group col-xs-12 col-sm-2">
|
||
<!-- <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
|
||
<div class="">
|
||
<input type="text" class="form-control" name="realname" value="{{$request['realname']}}" placeholder="可搜索昵称/姓名/手机号"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-xs-12 col-sm-2">
|
||
<div class="">
|
||
<input type="text" class="form-control" name="member_id" value="{{$request['member_id']}}" placeholder="会员ID"/>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-xs-12 col-sm-2">
|
||
<select class="form-control tpl-category-parent" id="level" name="level_id">
|
||
<option value="0">经销商等级</option>
|
||
@foreach($level as $item)
|
||
<option value="{{$item->id}}"
|
||
@if($request['level_id']==$item->id)
|
||
selected
|
||
@endif
|
||
>{{$item->level_name}}</option>
|
||
@endforeach
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group col-xs-12 col-sm-2">
|
||
<select class="form-control tpl-category-parent" id="cultural_level" name="cultural_level_id">
|
||
<option value="0">文创等级</option>
|
||
@foreach($culturalLevel as $item)
|
||
<option value="{{$item->id}}" @if($request['cultural_level_id']==$item->id) selected @endif>{{$item->level_name}}</option>
|
||
@endforeach
|
||
</select>
|
||
</div>
|
||
|
||
|
||
<div class="form-group col-xs-12 col-sm-4">
|
||
<div class="time">
|
||
<select name='searchtime' class='form-control'>
|
||
<option value=''>成为经销商时间</option>
|
||
<option value='1'
|
||
@if($request['searchtime']=='1')
|
||
selected
|
||
@endif>不限</option>
|
||
<option value='2'
|
||
@if($request['searchtime']=='2')
|
||
selected
|
||
@endif>搜索</option>
|
||
</select>
|
||
</div>
|
||
<div class="search-select">
|
||
{!! app\common\helpers\DateRange::tplFormFieldDateRange('times', [
|
||
'starttime'=>date('Y-m-d H:i', $starttime),
|
||
'endtime'=>date('Y-m-d H:i',$endtime),
|
||
'start'=>0,
|
||
'end'=>0
|
||
], true) !!}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-xs-12 col-sm-6">
|
||
<!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label"></label>-->
|
||
<div class="">
|
||
<button type="button" name="export" value="1" id="export" class="btn btn-default excel back ">导出 Excel</button>
|
||
<input type="hidden" name="token" value="{{$var['token']}}" />
|
||
<input type="hidden" name="uid" value="{{request()->uid}}" />
|
||
<button class="btn btn-success "><i class="fa fa-search"></i> 搜索</button>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="clearfix">
|
||
<div class="panel panel-default">
|
||
<div class="panel-body table-responsive">
|
||
<table class="table table-hover" >
|
||
<thead class="navbar-inner">
|
||
<tr>
|
||
<th style="width: 80px;text-align: center;">
|
||
<span class="label label-default">ID</span>
|
||
<br>
|
||
<span class="label label-warning">UID</span>
|
||
</th>
|
||
<th style="width: 160px;">成为经销商时间<br>普通等级升级时间<br>文创等级升级时间</th>
|
||
<th style="width: 120px;">经销商</th>
|
||
<th style="width: 120px;">等级</th>
|
||
<th style="width: 100px;">排名</th>
|
||
<th style="width: 150px;">名额(剩余/已使用)</th>
|
||
<th width="8.5%">直属总经销商人数</th>
|
||
<th width="8.5%">
|
||
提成比例<br>累计提成
|
||
<hr style="margin: 5px 0!important;"/>
|
||
补贴(津贴)比例<br>累计补贴(津贴)
|
||
</th>
|
||
<th width="8.5%">已结算提成<br>未结算提成</th>
|
||
<th width="13%">黑名单<br>变动时间</th>
|
||
<th width="8.5%">团队业绩<br>团队商品销量</th>
|
||
<th width="8.5%">操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($list['data'] as $item)
|
||
<tr>
|
||
<td style="text-align: center;">
|
||
<span class="label label-default">{{$item['id']}}</span>
|
||
<br>
|
||
<span class="label label-warning">{{$item['has_one_member']['uid']}}</span>
|
||
</td>
|
||
<td>
|
||
{{$item['created_at']}}
|
||
<br>
|
||
{{$item['upgrade_at'] ? date('Y-m-d H:i:s',$item['upgrade_at']) : '/'}}
|
||
<br>
|
||
{{$item['cultural_upgrade_at'] ? date('Y-m-d H:i:s',$item['cultural_upgrade_at']) : '/'}}
|
||
</td>
|
||
<td>
|
||
@if ($item['has_one_member'])
|
||
<a href="{!! yzWebUrl('member.member.detail', ['id'=>$item['has_one_member']['uid']]) !!}">
|
||
<img src="{{$item['has_one_member']['avatar']}}" style="width:30px;height:30px;padding:1px;border:1px solid #ccc">
|
||
<br>
|
||
{{$item['has_one_member']['nickname']}}
|
||
</a>
|
||
@else
|
||
未更新
|
||
@endif
|
||
</td>
|
||
<td title="{{$item['has_one_level']['level_name']}}" class='tdedit'>
|
||
<span class=' fa-edit-item' style='cursor:pointer'>
|
||
<span class="title">{{$item['has_one_level']['level_name'] ?? '/'}}</span>
|
||
<i class='fa fa-pencil' style="display:none"></i>
|
||
</span>
|
||
<div class="input-group level" style="display:none">
|
||
<select class="form-control tpl-agent-level" name="level_id" data-agencyid="{{$item['id']}}">
|
||
<option>请选择等级</option>
|
||
@foreach($level as $value)
|
||
<option value="{{$value->id}}" @if($item['level']==$value->id) selected @endif>{{$value->level_name}}</option>
|
||
@endforeach
|
||
</select>
|
||
</div>
|
||
<br />
|
||
<span class=' fa-edit-item' style='cursor:pointer'>
|
||
<span class="title">{{$item['cultural_level']['level_name'] ?? '/'}}</span>
|
||
<i class='fa fa-pencil' style="display:none"></i>
|
||
</span>
|
||
<div class="input-group level" style="display:none">
|
||
<select class="form-control tpl-agent-level" name="level_id" data-agencyid="{{$item['id']}}" data-leve_type="cultural">
|
||
<option>请选择等级</option>
|
||
@foreach($culturalLevel as $value)
|
||
<option value="{{$value->id}}" @if($item['cultural_level_id']==$value->id) selected @endif>{{$value->level_name}}</option>
|
||
@endforeach
|
||
</select>
|
||
</div>
|
||
</td>
|
||
<td>
|
||
@foreach($item['rank_list'] as $rankItem)
|
||
<p>{{$rankItem['level_name']}}:{{$rankItem['ranking']}}</p>
|
||
@endforeach
|
||
</td>
|
||
<td>{{$item['surplus_quota']}} / {{$item['use_quota']}}</td>
|
||
<td>
|
||
{{$item['total'] ?? 0}}人
|
||
<a href="{{yzWebUrl('plugin.team-dividend.admin.team-agency',['uid'=>$item['uid']])}}">
|
||
查看
|
||
</a>
|
||
</td>
|
||
<td>
|
||
{{$item['has_one_level']['dividend_ratio']}}%
|
||
<br>
|
||
{{$item['has_many_team_dividend'][2]['total_amount'] + $item['has_many_team_dividend'][1]['total_amount'] + $item['has_many_team_dividend'][0]['total_amount']}}
|
||
<hr style="margin: 5px 0!important;"/>
|
||
{{$item['cultural_level']['dividend_ratio'] ?? 0}}%
|
||
<br>
|
||
0
|
||
</td>
|
||
<td>
|
||
@if($item['has_many_team_dividend'][0]['status'] == 1)
|
||
{{$item['has_many_team_dividend'][0]['total_amount']}}
|
||
@elseif($item['has_many_team_dividend'][1]['status'] == 1)
|
||
{{$item['has_many_team_dividend'][1]['total_amount']}}
|
||
@elseif($item['has_many_team_dividend'][2]['status'] == 1)
|
||
{{$item['has_many_team_dividend'][2]['total_amount']}}
|
||
@else
|
||
0
|
||
@endif
|
||
<br>
|
||
@if($item['has_many_team_dividend'][0]['status'] === 0)
|
||
{{$item['has_many_team_dividend'][0]['total_amount']}}
|
||
@elseif($item['has_many_team_dividend'][1]['status'] === 0)
|
||
{{$item['has_many_team_dividend'][1]['total_amount']}}
|
||
@elseif($item['has_many_team_dividend'][2]['status'] === 0)
|
||
{{$item['has_many_team_dividend'][2]['total_amount']}}
|
||
@else
|
||
0
|
||
@endif
|
||
</td>
|
||
<td>
|
||
@if($item['is_black'])
|
||
是
|
||
@else
|
||
否
|
||
@endif
|
||
<br>
|
||
@if($item['black_time'])
|
||
{{date('Y-m-d H:i:s',$item['black_time'])}}
|
||
@else
|
||
/
|
||
@endif
|
||
</td>
|
||
{{-- <td>{{$item['has_many_team_dividend'][2]['total_amount'] + $item['has_many_team_dividend'][1]['total_amount'] + $item['has_many_team_dividend'][0]['total_amount']}}</td>--}}
|
||
<td>{{$item['team_order_price']}}<br>{{$item['team_goods_total']}}</td>
|
||
<td style="position:relative;overflow:visible;" >
|
||
|
||
<div style="width: 100%" class="btn-group btn-group-sm dropdown-box" data-type="1">
|
||
<a class="btn btn-default dropdown" data-expanded="1"
|
||
href="javascript:;">操作 <span class="caret"></span></a>
|
||
<ul class="dropdown-menu" role="menu"
|
||
style='z-index: 99999; top:93%!important;'>
|
||
<li>
|
||
<a class='btn btn-default'
|
||
style="text-align: left"
|
||
href="{{yzWebUrl('plugin.team-dividend.admin.team-agency.daletedAgency',['id'=>$item['id']])}}"
|
||
onclick="return confirm('是否确认删除?');"
|
||
title='删除'>删除
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a class='btn btn-default'
|
||
target="_blank"
|
||
style="text-align: left"
|
||
href="{{yzWebUrl('member.member.agent',['id'=>$item['uid']])}}"
|
||
title='团队会员'>团队会员
|
||
</a>
|
||
</li>
|
||
@if(empty($item['is_black']))
|
||
<li>
|
||
<a class='btn btn-default'
|
||
style="text-align: left"
|
||
href="{{yzWebUrl('plugin.team-dividend.admin.team-agency.setBlack',['id'=>$item['id'],'is_black'=>1])}}"
|
||
title='加入黑名单'>加入黑名单
|
||
</a>
|
||
</li>
|
||
@else
|
||
<li>
|
||
<a class='btn btn-default'
|
||
style="text-align: left"
|
||
href="{{yzWebUrl('plugin.team-dividend.admin.team-agency.setBlack',['id'=>$item['id'],'is_black'=>0])}}"
|
||
title='取消黑名单'>取消黑名单
|
||
</a>
|
||
</li>
|
||
@endif
|
||
</ul>
|
||
</div>
|
||
|
||
{{-- <a href="{{yzWebUrl('plugin.team-dividend.admin.team-agency.daletedAgency',['id'=>$item['id']])}}" onclick="return confirm('是否确认删除?');--}}
|
||
{{-- return false;" class="btn btn-default btn-sm" title="删除"><i--}}
|
||
{{-- class="fa fa-trash"></i></a>--}}
|
||
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
{!!$pager!!}
|
||
<!--分页-->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script language='javascript'>
|
||
|
||
|
||
$('.tdedit').mouseover(function () {
|
||
$(this).find('.fa-pencil').show();
|
||
}).mouseout(function () {
|
||
$(this).find('.fa-pencil').hide();
|
||
});
|
||
$('.fa-edit-item').click(function () {
|
||
$(this).closest('span').hide();
|
||
$(this).next('.level').show();
|
||
|
||
});
|
||
$('.tpl-agent-level').change(function () {
|
||
var agencyId = $(this).data('agencyid');
|
||
var leve_type = $(this).data('leve_type');
|
||
var levelId = $(this).val();
|
||
fastChange(agencyId, levelId, leve_type);
|
||
});
|
||
function fastChange(id, value, leve_type) {
|
||
$.ajax({
|
||
url: "{!! yzWebUrl('plugin.team-dividend.admin.team-agency.change') !!}",
|
||
type: "post",
|
||
data: {id: id, value: value, leve_type: leve_type},
|
||
cache: false,
|
||
success: function ($data) {
|
||
console.log($data);
|
||
location.reload();
|
||
}
|
||
})
|
||
}
|
||
$(function () {
|
||
$('#export').click(function(){
|
||
$('#form1').get(0).action="{!! yzWebUrl('plugin.team-dividend.admin.team-agency.export') !!}";
|
||
$('#form1').submit();
|
||
$('#form1').get(0).action="{!! yzWebUrl('plugin.team-dividend.admin.team-agency.index') !!}";
|
||
});
|
||
});
|
||
$('.dropdown-box').hover(function () {
|
||
var _this = $(this);
|
||
$(".dropdown-menu").css('display','none');
|
||
|
||
if (_this.attr('data-type') == 1) {
|
||
_this.children("a").siblings(".dropdown-menu").show();
|
||
$('.dropdown-box').attr('data-type', 1);
|
||
_this.attr('data-type', 2);
|
||
} else {
|
||
_this.attr('data-type', 1);
|
||
}
|
||
});
|
||
</script>
|
||
<style>
|
||
.table-hover tr th, .table-hover tr td{text-align: center;}
|
||
.input-group{
|
||
margin: 4px auto;height: 30px; line-height: 30px;
|
||
}
|
||
</style>
|
||
@endsection |