外团推广功能提交

master
zhengyongxing 4 years ago
parent a00834e4e5
commit f8a7d53ac8

@ -0,0 +1,507 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">市场毛利统计(不结算)</h3>
<p class="description_text">说明:不结算的市场毛利统计</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<if condition="$caculate_check eq true">
<empty name="show_status">
<a class="recaculate" url="{:U('reCaculateBonus?pay_time='.$_GET['pay_time'])}" style="width: 60px;text-align: center;padding-right: 0;margin-right: 0;">重算</a>
</empty>
</if>
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-resway search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" style="width:150px;">
<option value="">请选择推广公司</option>
<volist name=":getPromoteCompany()" id="vo">
<option value="{$vo.id}" <if condition="I('company_id') && $vo.id eq I('company_id')">selected
</if> >{$vo.company_name}</option>
</volist>
</select>
</div>
<!-- <div class="input-list input-list-promote search_label_rehab">-->
<!-- <select id="pay_time" name="pay_time" class="select_gallery" style="width:150px;">-->
<!-- <option value="">请选择月份</option>-->
<!-- <volist name=":getMonth()" id="vo">-->
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['pay_time']">selected=selected</if>>{$vo}</option>-->
<!-- </volist>-->
<!-- </select>-->
<!-- </div>-->
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-parent search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width:120px;">
<option value="">请选择会长账号</option>
<volist name=":promote_listsMarket(1)" id="vo">
<option data-company_belong="{$vo['company_belong']}" data-belong="{:getCompanyBlong($vo['company_belong'])}" promote_id-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['promote_id']">selected=selected</if>>{$vo.account}</option>
</volist>
</select>
</div>
<div class="input-list input-list-parent search_label_rehab">
<select id="admin_id" name="admin_id" class="select_gallery" style="width:120px;">
<option value="">请选择人员</option>
<volist name=":getMarketAdmin()" id="vo">
<option value="{$vo.uid}" <if condition="$vo.uid eq $_GET['admin_id']">selected=selected</if>>{$vo.real_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="relation_game_id" name="relation_game_id" class="select_gallery" style="width:120px;">
<option value="" selected="">请选择游戏</option>
<volist name=':get_game_list(null,2)' id='vo'>
<option value="{$vo.relation_game_id}" <if condition="$vo.relation_game_id eq $_GET['relation_game_id']"></if>>{$vo.relation_game_name}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('index','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<empty name="show_status">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>时间</th>
<th>公司名称</th>
<th>会长账号</th>
<th>内外团</th>
<th>所属市场专员</th>
<th>类型</th>
<th >游戏名称</th>
<th >总流水</th>
<th>上游结算流水</th>
<th>下游结算流水</th>
<th>支付渠道费用</th>
<th><a href="{:U('editTaxRatio')}" style="text-decoration:none;">公司税费</a></th>
<th>税后毛利额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($list_data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "list_data">
<volist name="list_data" id="data">
<tr>
<td>{$data.pay_time}</td>
<td>{$data.company_name}</td>
<td>{$data.promote_account}</td>
<td>{$data.company_belong}</td>
<td>{$data.real_name}</td>
<td>{$data['develop_type']}</td>
<td>{$data['game_name']}</td>
<td>{$data['pay_amount']}</td>
<td>{$data['cp_amount']}</td>
<td>{$data['promote_amount']}</td>
<td>{$data['channel_amount']}</td>
<td>{$data['company_tax']}</td>
<td>{$data['company_profit']}</td>
</tr>
</volist>
<tr>
<td></td>
<td></td>
<td></td>
<td>合计</td>
<td></td>
<td></td>
<td></td>
<td>{$sum['pay_amount']}</td>
<td>{$sum['cp_amount']}</td>
<td>{$sum['promote_amount']}</td>
<td>{$sum['channel_amount']}</td>
<td>{$sum['company_tax']}</td>
<td>{$sum['company_profit']}</td>
</tr>
</notemtpy>
</tbody>
</table>
</div>
<else/>
</empty>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
</block>
<block name="script">
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('MarketPercentage/indexuncaculate')}');
$(function(){
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
var start = $("#time_start").val();
var end = $("#time_end").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
$('#time_start').datetimepicker({
format: 'yyyy-mm',
language:"zh-CN",
// minView:2,
weekStart: 1,
todayBtn: true,
todayHighlight: false,
startView: 3,
minView: 3,
forceParse: 0,
autoclose:true,
pickerPosition:'bottom-left'
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm',
language:"zh-CN",
// minView:2,
weekStart: 1,
todayBtn: true,
todayHighlight: false,
startView: 3,
minView: 3,
forceParse: 0,
autoclose:true,
pickerPosition:'bottom-left'
})
//下拉内容框
$(".drop-down2").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
/* 状态搜索子菜单 */
/*渠道删除*/
$('.delete').click(function(){
var id = $(this).attr('data-id');
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
title:'确定要删除该渠道?',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_promote')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg(data.msg);
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
})
$('.recaculate').click(function(){
var url = $(this).attr('url');
layer.confirm('是否确认重算提成!', {
title:'重算提成?',
icon:0,
btn: ['重算','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: url,
dataType: 'json',
async: false,
success:function(data){
if(data.status == 1) {
layer.msg("重新计算需要时间,请等待5分钟后再查看");
setTimeout(function(){
window.location.reload();
},1500);
} else {
layer.msg(data.info);
}
},
});
}, function(){
layer.close();
});
});
})
</script>
<script type="text/javascript">
//点击字母按照条件按钮筛选
$(".pro_promot_select_list_con").click(function(){
//选中高亮样式
$(this).addClass('active');
$(this).siblings().removeClass('active');
var that = $(this);
var index = $(this).attr("data-index");
$("#game_list li").each(function(index,ele){
var short = $(this).attr('data-short');
$(this).show();
if(that.attr('data-index')){
if(that.attr('data-index')!=short.charAt(0)){
$(this).hide();
}
}
})
});
//打开弹窗
$(".ajax-view").click(function(){
//获取游戏列表
var url = "{:U('Promote/getPromoteGame')}";
var id = $(this).attr('data-id');
var checked = 'checked';
$.post(url,{id:id},function(res){
if(res.code==1){
$(".pro_promot_select_list a").eq(0).addClass('active');
$(".pro_promot_select_list a").eq(0).siblings().removeClass('active');
var game_list = res.data.game_list;
var promote_info = res.data.promote_info;
var lis = [];
$.each(game_list,function(index,ele){
if(ele.game_name.length>6){
ele.game_name = ele.game_name .substring(0,6)+"..."
}
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
if(promote_info['game_ids']==''){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
if(promote_info['game_ids'].indexOf(ele.id)>-1){
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
}else{
$(".jsgamecheckall").attr('checked',false);
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" class="fl pro_promot_game_check jsgameid" id="gameCheck'+index+'" />');
checked = '';
}
}
lis.push('<label for="gameCheck'+index+'" class="fl"></label>');
lis.push('<span class="fl pro_promot_game_name">'+ele.game_name+'</span>');
lis.push('</li>');
});
$(".jsgamecheckall").attr('checked',checked);
$("#game_list").html(lis.join(''));
$(".pro_promot_number").text(res.data.promote_info.account);
$("#se_promote_id").val(res.data.promote_info.id);
$(".pro_promot").css("display","block");
jsgameid();
}else{
var tip_msg = res.info ? res.info : '操作失败';
layer.msg(tip_msg);
}
});
});
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
layer.msg(res.msg);
$(".pro_promot").hide();
});
return false;
});
//关闭弹窗
$(".pro_promot_close").click(function(){
$(".pro_promot").css("display","none");
});
//取消修改
$(".pro_promot_btn_cancel").click(function(){
$(".pro_promot").css("display","none");
layer.msg('修改已取消');
});
$(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
});
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
function jsgameid(){
$(".jsgameid").click(function(){
var option = $(this).closest('ul').find(".jsgameid"),
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
option.each(function(i){
if(!this.checked){
checkall.prop("checked", false);
return false;
}else{
checkall.prop("checked", true);
}
});
});
}
</script>
</block>
Loading…
Cancel
Save