新增下游审批

master
chenzhi 4 years ago
parent 7d404c6904
commit afac0376be

@ -244,7 +244,7 @@ class PartnerController extends ThinkController
$map["create_time"] = ['ELT',$time_end];
}
$model = M("partner_verify", 'tab_');
$data = $model->where($map)->page($page,$row)->order("FIELD(verify_log,0,1,-1),create_time desc")->select();
$data = $model->where($map)->page($page,$row)->order("FIELD(verify_status,0,1,-1),create_time desc")->select();
foreach ($data as $k => &$v) {
$v['partner_info'] = json_decode($v['partner_info'],true);
if($v['partner_id'] == 0){

@ -15,7 +15,11 @@ use Think\Controller;
class PromoteCompanyController extends ThinkController
{
private $modelName = 'PromoteCompany';
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
parent::_initialize();
}
//列表
public function lists()
{
@ -229,6 +233,194 @@ class PromoteCompanyController extends ThinkController
$this->meta_title = '推广公司';
$this->display();
}
public function index()
{
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$row = intval(I('row', 0));
$row = empty($row) ? 10 : $row;//每页条数
$p = $_REQUEST;
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$map = [];
if (!empty(I('company_name'))) {
$map['company_name'] = ['like', '%' . I('company_name') . '%'];
}
if (!empty($p['verify_type'])) {
if($p['verify_type'] == 1){
$map['company_id'] = 0;
}else{
$map['company_id'] = ["neq",0];
}
}
if (!empty($p['verify_status'])) {
$map['verify_status'] = $p['verify_status'];
}
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$time_start = strtotime($_REQUEST['timestart']);
$time_end = strtotime($_REQUEST['timeend'])+ 86399;
$map["create_time"] =['BETWEEN',[$time_start, $time_end]];
} elseif (isset($_REQUEST['timestart'])) {
$time_start = strtotime($_REQUEST['timestart']);
$map["create_time"] =['EGT',$time_start];
} elseif (isset($_REQUEST['timeend'])) {
$time_end = strtotime($_REQUEST['timeend'])+ 86399;
$map["create_time"] = ['ELT',$time_end];
}
$model = M("promote_company_verify", 'tab_');
$data = $model->where($map)->page($page,$row)->order("FIELD(verify_status,0,1,-1,-2,2),id desc")->select();
foreach ($data as $k => &$v) {
$v['company_info'] = json_decode($v['company_info'],true);
if($v['company_id'] == 0){
$v['verify_type'] = "新增";
}else{
$v['verify_type'] = "修改";
}
$v['company_info']['company_type'] = $v['company_info']['company_type'] == 2 ? '个人' : '公司';
$contract_start_time = $v['company_info']['contact_begin'] ?
time_format($v['company_info']['contact_begin'], 'Y/m/d') : '-';
$contract_end_time = $v['company_info']['contact_end'] ?
time_format($v['company_info']['contact_end'], 'Y/m/d') : '-';
$v['contract_time'] = $contract_start_time . '-' . $contract_end_time;
$validity_start_time = $v['company_info']['validity_start_time'] ?
time_format($v['company_info']['validity_start_time'], 'Y/m/d') : '-';
$validity_end_time = $v['company_info']['validity_end_time'] ?
time_format($v['company_info']['validity_end_time'], 'Y/m/d') : '-';
$v['validity_time'] = $validity_start_time . '-' . $validity_end_time;
$create_time = date("Y-m-d H:i:s",$v["create_time"]);
$v['verify_log'] = json_decode($v['verify_log'], true);
$v["create"]= "{$v['verify_log']['create_user']} <br> {$v['verify_log']['create_time']}";
if(isset($v['verify_log']['market_user'])){
if($v['status'] == -1){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$v["market"]= "{$ts}({$v['verify_log']['market_user']}) <br> {$v['verify_log']['market_time']}";
}else{
$v["market"] = '--';
}
if(isset($v['verify_log']['admin_user'])){
if($v['status'] == -2){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$v["admin"]= "{$ts}({$v['verify_log']['admin_user']}) <br> {$v['verify_log']['admin_time']}";
}else{
$v["admin"] = '--';
}
}
$count = $model->where($map)->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('menubtn',$this->menuAuth());
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('VerifyStatus', D("PromoteCompanyVerify")->VerifyStatus);
$this->meta_title = '推广公司审核列表';
$this->display();
}
public function marketAgree(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if($v['verify_status'] != 0) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['market_user']=$this->admininfo["username"];
$v['verify_log']['market_time']=date("Y-m-d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=1;
M("PromoteCompanyVerify", 'tab_')->save($v);
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]);
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"市场部审核通过成功"
));
}
public function marketRefuse(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if($v['verify_status'] != 0) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['market_user']=$this->admininfo["username"];
$v['verify_log']['market_time']=date("Y-m-d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=-1;
M("PromoteCompanyVerify", 'tab_')->save($v);
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]);
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"市场部审核拒绝成功"
));
}
public function adminRefuse(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if($v['verify_status'] != 1) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['admin_user']=$this->admininfo["username"];
$v['verify_log']['admin_time']=date("Y-m-d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=-2;
M("PromoteCompanyVerify", 'tab_')->save($v);
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"管理员审核",'url'=>U('index')]);
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"管理员审核拒绝成功"
));
}
public function adminAgree(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = M("PromoteCompanyVerify", 'tab_')->field("*")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if($v['verify_status'] != 1) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['admin_user']=$this->admininfo["username"];
$v['verify_log']['admin_time']=date("Y-m-d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=2;
$company_info = json_decode($v['company_info'],true);
if($v['company_id'] == 0){
//新增
$v['company_id'] = M("promote_company","tab_")->add($company_info);
}else{
//编辑
M("promote_company","tab_")->save($company_info);
$this->changePromote($company_info);
}
//业务逻辑
M("PromoteCompanyVerify", 'tab_')->save($v);
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"管理员审核",'url'=>U('index')]);
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"管理员审核通过成功"
));
}
//添加
public function add()
@ -284,7 +476,7 @@ class PromoteCompanyController extends ThinkController
if($data['resources'] == ''){
$data['resources'] ="[]";
}
if($data['validity_start_time'] >0){
$data['validity_start_time']=date("Y-m-d",$data['validity_start_time']);
}else{
@ -302,8 +494,54 @@ class PromoteCompanyController extends ThinkController
$data['turnover_ratio'] = $data['turnover_ratio'] ? json_decode($data['turnover_ratio'], true) : $data['turnover_ratio'];
$this->assign('data', $data);
$this->meta_title ='推广公司信息查看';
$this->display();
}
public function verifyView()
{
if(!isset($_REQUEST['id'])) $this->error('数据异常', U('index'));
$id = $_REQUEST['id'];
$map['id'] = $id;
$dbres = M("PromoteCompanyVerify", 'tab_')->find($id);
$data = json_decode($dbres['company_info'],true);
if($data['contact_begin'] >0){
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
}else{
$data['contact_begin']='';
}
if($data['contact_end'] >0){
$data['contact_end']=date("Y-m-d",$data['contact_end']);
}else{
$data['contact_end']='';
}
if($data['resources'] == ''){
$data['resources'] ="[]";
}
if($data['validity_start_time'] >0){
$data['validity_start_time']=date("Y-m-d",$data['validity_start_time']);
}else{
$data['validity_start_time']='';
}
if($data['validity_end_time'] >0){
$data['validity_end_time']=date("Y-m-d",$data['validity_end_time']);
}else{
$data['validity_end_time']='';
}
if($data['resources'] == ''){
$data['resources'] ="[]";
}
$data['turnover_ratio'] = $data['turnover_ratio'] ? json_decode($data['turnover_ratio'], true) : $data['turnover_ratio'];
$this->assign('data', $data);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/edit'])->find());
$this->meta_title ='审核信息查看';
$this->display("view");
}
public function marketingDirectorShow($ids=[], $isShow=0)
{
@ -812,26 +1050,61 @@ class PromoteCompanyController extends ThinkController
protected function changePromote(&$save){
$is_change_belong = false;
$is_change_relation =false;
$is_change_game =false;
if(empty($save['id'])){
return false;
}
$company_id = $save['id'];
$old_info = M("PromoteCompany","tab_")->field("company_belong,develop_type")->where("id = {$save['id']}")->find();
$old_info = M("PromoteCompany","tab_")->field("company_belong,develop_type,game_ids")->where("id = {$save['id']}")->find();
if(isset($save['company_belong']) && ($old_info['company_belong'] != $save['company_belong'])){
$is_change_belong = true;
}
if(isset($save['develop_type']) && ($old_info['develop_type'] != $save['develop_type'])){
$is_change_relation = true;
}
//获取需要扣除的游戏
if($old_info['game_ids'] != $save['game_ids']){
// $is_change_game = true;
$oids = explode(',', $old_info['game_ids']);
$nids = explode(',', $save['game_ids']);
$diff_ids = [];
if(count($oids) == 0){
$is_change_game = false;
}elseif(count($nids) == 0){
$diff_ids = $oids;
}else{
foreach ($nids as $k => $v) {
if(!in_array($v,$oids)){
$diff_ids[] = $v;
}
}
}
if(count($diff_ids) > 0){
$is_change_game = true;
}
}
//处理底下所有会长的公会属性
if($is_change_belong || $is_change_relation){
$savedata = array(
"company_belong"=>$save['company_belong'],
"company_relation"=>$save['develop_type']
);
M("Promote","tab_")->where("company_id = '{$company_id}'")->save($savedata);
if($is_change_belong || $is_change_relation || $is_change_game){
if(!$is_change_game){
$savedata = array(
"company_belong"=>$save['company_belong'],
"company_relation"=>$save['develop_type']
);
M("Promote","tab_")->where("company_id = '{$company_id}'")->save($savedata);
}else{
//需要扣除游戏
$Promote = M("Promote","tab_");
$dbres = $Promote->field("id,game_ids,company_belong,company_relation")->where("company_id = '{$company_id}'")->select();
foreach($dbres as $k=>&$v){
$temp_ids = explode(',',$v['game_ids']);
$v['game_ids'] = implode(',', array_diff($temp_ids,$diff_ids));
$v['company_belong'] = $save['company_belong'];
$v['company_relation'] = $save['develop_type'];
$Promote->save($v);
}
}
// 权限跟随
if($is_change_belong){
$authGroup = M('auth_group',"sys_")->where(['title'=>'市场总监'])->find();
@ -846,6 +1119,27 @@ class PromoteCompanyController extends ThinkController
}
}
}
protected function menuAuth()
{
$addurl = U("addRelation");
$mentBtn = [
"marketAgree"=>"<a class='butn' id='marketAgree'>市场部审批通过</a>",
"marketRefuse"=>"<a class='butn' id='marketRefuse' style='background-color: red;'>市场部审核拒绝</a>",
"adminAgree"=>"<a class='butn' id='adminAgree'>管理员审核通过</a>",
"adminRefuse"=>"<a class='butn' id='adminRefuse' style='background-color: red;'>管理员审核拒绝</a>"
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
if(IS_ROOT){
$resarr[] = $v;
}else{
if(in_array($k,$this->OpAuthList)){
$resarr[] = $v;
}
}
}
return $resarr;
}
}

@ -8,9 +8,11 @@ class PromoteCompanyVerifyModel extends Model
{
protected $tablePrefix = 'tab_';
public $VerifyStatus=[
"-1"=>"审核拒绝",
"-2"=>"管理员审核拒绝",
"-1"=>"市场部审核拒绝",
"0"=>"未审核",
"1"=>"审核通过"
"1"=>"市场部审核通过",
"2"=>"管理员审核通过"
];
/**
* 新增

@ -0,0 +1,375 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<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;}
.data_list table td{
text-indent:0;
height: 30px;
line-height: 30px;
}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.butnbox a{
cursor:pointer
}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
.data_list table td{
line-height: 1.5;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a href="{:U('lists')}">生效列表</a>
<a class="tabchose" href="{:U('index')}">审核列表</a>
</div>
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">审核通过后的修改申请将覆盖旧值,如果旧公司已被删除,将忽略</p>
</div>
<div class="cf top_nav_list">
<div class="jssearch fl cf search_list" style="margin-bottom: 0px;">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="verify_type" name="verify_type" class="select_gallery" >
<option value="">审核类型</option>
<option value="1">新增</option>
<option value="2">修改</option>
</select>
</div>
<div class="input-list">
<input type="text" id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="操作开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="timeend" class="" value="{$endDate}"
placeholder="操作结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="verify_status" name="verify_status" class="select_gallery" >
<option value="">请选择审核状态</option>
<volist name="VerifyStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['verify_status']) && $key eq I('verify_status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<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="butnbox" style="margin-bottom: 10px;">
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<foreach name="menubtn" item="vo" >
{$vo}
</foreach>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th style="padding:0 5px;text-indent:0px">
<input class="check-all" type="checkbox">
</th>
<th>合同合作方名称</th>
<th>对应平台</th>
<th>审核类型</th>
<th>公司性质</th>
<th>合同期限</th>
<th>结算生效期限</th>
<th>渠道费率</th>
<th>开票税点</th>
<th>税费费率</th>
<th>帐户名</th>
<th>银行账号</th>
<th>收款银行</th>
<th>创建记录</th>
<th>市场部审批</th>
<th>管理员审批</th>
<th style="width:8%;min-width:10px;"> 操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data">
<tr>
<td>
<input class="ids" type="checkbox" data-status="{$data.verify_status}" value="{$data['id']}" name="ids[]" >
</td>
<td>{$data.company_name}</td>
<td>{$data.company_info.platform_name}</td>
<td>{$data.verify_type}</td>
<td>{$data.company_info.company_type}</td>
<td>{$data.contract_time}</td>
<td>{$data.validity_time}</td>
<td>{$data.company_info.channel_rate}%</td>
<td>{$data.company_info.fax_ratio}%</td>
<td>{$data.company_info.taxation_rate}%</td>
<td>{$data.company_info.bank_address}</td>
<td>{$data.company_info.bank_card}</td>
<td>{$data.company_info.bank_name}</td>
<td>{$data.create}</td>
<td>
<if condition="$data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
{$data.market}
</div>
<else />
<div style="line-height: 2;">
{$data.market}
</div>
</if>
</td>
<td>
<if condition="$data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">
{$data.admin}
</div>
<else />
<div style="line-height: 2;">
{$data.admin}
</div>
</if>
</td>
<td >
<a href="{:U('verifyView',array('id'=>$data['id']))}">查看</a>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></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>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
.layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
.layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
.layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
.layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
.layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
.layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
$(function(){
$("#downloadexcel").on("click",function(){
var url = $(this).attr("url");
var title = '合作方导出';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0,
area: ['40%', '60%'],
content: url,
zIndex :-5
});
// window.open(url, "blank");
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
//搜索功能
$("#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;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#marketAgree,#marketRefuse,#adminAgree,#adminRefuse").on("click",function(){
var id = $(this).attr("id");
if(id == "marketAgree"){
var opname = "市场部审批通过";
var opurl = "{:U('marketAgree')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="marketRefuse"){
var opname = "市场部审批拒绝";
var opurl = "{:U('marketRefuse')}";
var opst ="[未进行审批]";
var status = 0;
}else if(id=="adminAgree"){
var opname = "管理员审批通过";
var opurl = "{:U('adminAgree')}";
var opst ="[市场部审批通过]";
var status = 1;
}else if(id=="adminRefuse"){
var opname = "管理员审批拒绝";
var opurl = "{:U('adminRefuse')}";
var opst ="[市场部审批通过]";
var status = 1;
}
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") == status){
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的申请,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,操作不可逆,请慎重选择,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
function _doAgreeApply(){
layer.load(2);
//执行
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: {ids:text},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}
})
});
</script>
</block>

@ -44,6 +44,10 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a class="tabchose" href="{:U('lists')}">生效列表</a>
<a href="{:U('index')}">审核列表</a>
</div>
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:该功能是用于录入工会所属的推广公司名称 / 如需删除公司请先将公司底下会长移走后方可操作</p>
</div>
@ -272,7 +276,7 @@
<div class="pro_promot_con">
<div class="pro_promot_account">推广公司:<span class="pro_promot_number"></span></div>
<div class="pro_promot_select">
<div class="pro_promot_select_title fl">选择游戏:</div>
<div class="pro_promot_select_title fl">可推广游戏:</div>
<div class="pro_promot_select_list fl">
<a class="pro_promot_select_list_con fl active pro_promot_all pro_promot_mr20">全部 </a>
<a class="pro_promot_select_list_con fl" data-index="A">A</a>
@ -305,21 +309,11 @@
</div>
<div class="clear"></div>
<div class="pro_promot_game">
<div class="jsgamecheckallbox z_clearfix" >
<label class="custom-label">
<input type="checkbox" class="form_control jsgamecheckall" >
<i class="label_icon"></i>
<span class="label_text">全选</span></label>
</div>
<ul id="game_list" class="z_clearfix game_list" style="clear: both;">
</ul>
</div>
<div class="clear"></div>
<div class="pro_promot_btn">
<div class="fl pro_promot_btn_confirm">确定</div>
<div class="fr pro_promot_btn_cancel">取消</div>
</div>
</div>
</div>
</form>
@ -434,28 +428,14 @@
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>');
if(promote_info['game_ids'].indexOf(ele.id)>-1){
lis.push('<li class="fl pro_promot_game_con" data-short="'+ele.short+'">');
lis.push('<input type="checkbox" value="'+ele.id+'" name="game_ids[]" disabled class="fl pro_promot_game_check jsgameid" checked="checked" id="gameCheck'+index+'" />');
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.company_name);
$("#se_promote_id").val(res.data.promote_info.id);
@ -473,7 +453,6 @@
//保存修改
$(".pro_promot_btn_confirm").click(function(){
$("#ajaxForm").ajaxSubmit(function(res){
layer.msg(res.msg);
$(".pro_promot").hide();
});
return false;
@ -486,7 +465,6 @@
//取消修改
$(".pro_promot_btn_cancel").click(function(){
$(".pro_promot").css("display","none");
layer.msg('修改已取消');
});
$(".jsgamecheckall").click(function(){

@ -81,7 +81,7 @@
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">推广公司编辑</h3>
<h3 class="page_title">{$meta_title}</h3>
</div>
<div class="tab-content tabcon1711">
@ -527,41 +527,6 @@
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
layer.confirm('删除将即时生效,并且无法回退。请慎重选择', {icon: 2, title:'删除提示'}, function(index){
var path = $(this).data("path");
var index = $(this).data("index");
var id = {$data.id};
var doccopy = doc.concat();
doccopy.splice(index,1)
$.ajax({
url:"{:U('PromoteCompany/delFile')}",
type:"post",
data:{
"id":id,
"file_path":path,
"resources":doccopy
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1);
layer.msg(data.info,function(){
PROMOTE.juicerFun();
});
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
});
})
}
}
</script>
@ -570,7 +535,6 @@
if(!doc){
doc = [];
}
var id = {$data.id};
PROMOTE.juicerFun();
function addFile(info) {

Loading…
Cancel
Save