冲突解决
commit
e26f517df1
@ -0,0 +1,461 @@
|
||||
<?php
|
||||
namespace Admin\Controller;
|
||||
/**
|
||||
* 结算单
|
||||
* @author ylw
|
||||
*/
|
||||
class SettlementController extends ThinkController
|
||||
{
|
||||
// 汇总结算单列表
|
||||
public function sheetList($row = 10, $p = 1)
|
||||
{
|
||||
$map = [];
|
||||
if (I('settlement_type')) {
|
||||
$map['settlement_type'] = I('settlement_type');
|
||||
}
|
||||
if (I('settlement_time_type')) {
|
||||
$map['settlement_time_type'] = I('settlement_time_type');
|
||||
}
|
||||
if (I('creater_id')) {
|
||||
$map['creater_id'] = I('creater_id');
|
||||
}
|
||||
if (I('all_status')) {
|
||||
$map['all_status'] = I('all_status');
|
||||
}
|
||||
if (I('create_time_start')) {
|
||||
$map['_string'] = "create_time >= ".strtotime(I('create_time_start'));
|
||||
}
|
||||
if (I('create_time_end')) {
|
||||
$map['_string'] = "create_time <= ".strtotime(I('create_time_end'));
|
||||
}
|
||||
$login_uid = is_login();
|
||||
$list = M('settlement_sheet', 'tab_')->where($map)->page($p, $row)->order("if (audit_user ={$login_uid}, 0,1 ) and status = 3, all_status desc, create_time desc")->select();
|
||||
$count = M('settlement_sheet', 'tab_')->where($map)->count();
|
||||
if (!empty($list)) {
|
||||
foreach ($list as &$item) {
|
||||
switch ($item['settlement_type']) {
|
||||
case '1':
|
||||
$item['settlement_type_name'] = '上游结算单';
|
||||
break;
|
||||
case '2':
|
||||
$item['settlement_type_name'] = '下游-内团结算单';
|
||||
break;
|
||||
case '3':
|
||||
$item['settlement_type_name'] = '下游-外团结算单';
|
||||
break;
|
||||
case '4':
|
||||
$item['settlement_type_name'] = '下游-个人结算单';
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($item['settlement_time_type']) {
|
||||
case '1':
|
||||
$item['settlement_time_type_name'] = '周结';
|
||||
break;
|
||||
case '2':
|
||||
$item['settlement_time_type_name'] = '月结';
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($item['status']) {
|
||||
case '1':
|
||||
$item['status_name'] = '审核通过';
|
||||
break;
|
||||
case '2':
|
||||
$item['status_name'] = '审核未通过';
|
||||
break;
|
||||
case '3':
|
||||
$item['status_name'] = '待审核';
|
||||
break;
|
||||
}
|
||||
$item['audit_users'] = json_decode($item['audit_users'], true);
|
||||
}
|
||||
}
|
||||
$this->assign('admin_users', M('member')->field('uid, nickname')->select());
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->assign('list_data', $list);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
// 生成结算单 月结算补点 周结不算
|
||||
public function generateSettlementSheet($settlement_type = 0, $settlement_time_type = 0, $time_start=0, $time_end = 0, $delete=0, $id=0, $action='')
|
||||
{
|
||||
$msg = '';
|
||||
$this->assign(I(''));
|
||||
$this->assign('action', $action);
|
||||
if ($delete) {
|
||||
$res = M('settlement_sheet', 'tab_')->where(['id'=>$id])->delete();
|
||||
return $res ? $this->success('删除成功', '', true) : $this->success('删除失败', '', true);
|
||||
}
|
||||
$this->meta_title = '结算单管理';
|
||||
if (empty($settlement_type)) {
|
||||
$msg = '请选择汇总结算单类型';
|
||||
}
|
||||
if (empty($settlement_time_type)) {
|
||||
$msg = '请选择结算方式';
|
||||
}
|
||||
$settlement_time = I('settlement_time', '');
|
||||
if ($settlement_time_type == 1) {
|
||||
$settlement_time = explode(' 至 ', $settlement_time);
|
||||
if (count($settlement_time) != 2) {
|
||||
$msg = '请选择正确的时间区间';
|
||||
} else {
|
||||
$time_start = strtotime($settlement_time[0]);
|
||||
$time_end = strtotime($settlement_time[1]) + 3600 * 24 - 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
$time_start = strtotime($settlement_time);
|
||||
$time_end = strtotime('+1 month', $time_start) - 1;
|
||||
}
|
||||
if ($time_end > time()) {
|
||||
$msg = "结算结算时间无法大于当前时间";
|
||||
}
|
||||
if (empty($time_start) || empty($time_end)) {
|
||||
$msg = '请选择正确的时间区间';
|
||||
}
|
||||
if (IS_GET) {
|
||||
|
||||
// 判断结算时间是否冲突
|
||||
$isExsist = M('settlement_sheet', 'tab_')->where(['settlement_type'=>$settlement_type, 'time_start'=>$time_start, 'time_end'=>$time_end, 'settlement_time_type'=>$settlement_time_type])->find();
|
||||
if ($isExsist) {
|
||||
$msg = "已存在此类型结算单";
|
||||
}
|
||||
// 生成结算单数据
|
||||
$generate = false;
|
||||
if (!$msg) {
|
||||
$generate = true;
|
||||
if ($settlement_type == 1) {
|
||||
if ($settlement_time_type == 1) {
|
||||
$map = " and p.settlement_type = 1";
|
||||
} else {
|
||||
$map = '';
|
||||
}
|
||||
$result = M('spend', 'tab_')->query("
|
||||
SELECT
|
||||
sum(s.pay_amount) as amount, g.relation_game_id, g.relation_game_name, p.partner, p.id as p_id, p.channel_rate, p.invoice_rate, g.id as game_id
|
||||
FROM
|
||||
tab_spend as s
|
||||
INNER JOIN tab_game g on s.game_id = g.id
|
||||
INNER JOIN tab_partner p on p.id = g.partner_id {$map}
|
||||
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
|
||||
GROUP BY relation_game_id, p.id
|
||||
ORDER BY p_id asc");
|
||||
$list = [];
|
||||
foreach ($result as $key => $item) {
|
||||
if (!isset($list[$item['p_id']])) {
|
||||
// 奖罚金额
|
||||
$reward = M('reward_record', 'tab_')
|
||||
->field('sum(money) as money, reward_type')
|
||||
->where("company_type = 1 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
|
||||
->group('reward_type')
|
||||
->select();
|
||||
if (!empty($reward)) {
|
||||
$reward = array_column($reward, 'money', 'reward_type');
|
||||
}
|
||||
$list[$item['p_id']] = [
|
||||
'company_id'=>$item['p_id'],
|
||||
'company_name'=>$item['partner'],
|
||||
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
|
||||
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
|
||||
'channel_rate' => $item['channel_rate'], // 渠道费
|
||||
'invoice_rate' => $item['invoice_rate'], // 税费
|
||||
'time_start' => date('Y-m-d', $time_start),
|
||||
'time_end' => date('Y-m-d', $time_end)
|
||||
];
|
||||
}
|
||||
$data = [];
|
||||
// 获取分成比例
|
||||
if ($settlement_time_type == 1) {
|
||||
$data['game_ratio'] = getGameCpRadio($item['game_id'], $item['amount'], false);
|
||||
} else {
|
||||
$data['game_ratio'] = getGameCpRadio($item['game_id'], $item['amount'], true);
|
||||
}
|
||||
$data['relation_game_id'] = $item['relation_game_id'];
|
||||
$data['relation_game_name'] = $item['relation_game_name'];
|
||||
$data['amount'] = $item['amount'];
|
||||
$data['self_game_ratio'] = 100 - $data['game_ratio'];
|
||||
$data['parter_settlement'] = $item['amount'] * $data['game_ratio']/100 - ($item['amount']*$item['channel_rate'] ) + $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
|
||||
$list[$item['p_id']]['channels'][] = array_merge($data, [
|
||||
'company_id'=>$item['p_id'],
|
||||
'company_name'=>$item['partner'],
|
||||
'bonuses'=>$list[$item['p_id']]['bonuses'],
|
||||
'fine'=>$list[$item['p_id']]['fine'],
|
||||
'channel_rate' => $item['channel_rate'],
|
||||
'invoice_rate' => $item['invoice_rate']]);
|
||||
}
|
||||
} else if (\in_array($settlement_type, [2, 3])) {
|
||||
$map = "p.account_type = 1 and p.`level` = 1 and p.company_belong " . ($settlement_type == 2 ? " = 0 " : " in (1, 2) ") ;
|
||||
if ($settlement_time_type == 1) {
|
||||
$map .= " and p.settlement_type = {$settlement_time_type} ";
|
||||
}
|
||||
$result = M()->query("
|
||||
SELECT
|
||||
p.id, p.account, pc.company_name, pc.id as p_id, pc.fax_ratio, pc.settlement_contact
|
||||
FROM
|
||||
tab_promote p
|
||||
INNER JOIN tab_promote_company pc on p.company_id = pc.id
|
||||
where {$map}
|
||||
order by pc.id asc
|
||||
");
|
||||
$list = [];
|
||||
foreach ($result as $key => $item) {
|
||||
$res = M()->query("
|
||||
select
|
||||
g.relation_game_name, g.relation_game_id, sum(s.pay_amount) as amount
|
||||
from
|
||||
tab_spend s
|
||||
inner join tab_promote p on p.chain like '/{$item['id']}/%' and s.promote_id = p.id
|
||||
inner join tab_game g on s.game_id = g.id
|
||||
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
|
||||
group by g.relation_game_id
|
||||
");
|
||||
|
||||
if ($res) {
|
||||
if (!isset($list[$item['p_id']])) {
|
||||
// 奖罚金额
|
||||
$reward = M('reward_record', 'tab_')
|
||||
->field('sum(money) as money, reward_type')
|
||||
->where("company_type = 2 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
|
||||
->group('reward_type')
|
||||
->select();
|
||||
if (!empty($reward)) {
|
||||
$reward = array_column($reward, 'money', 'reward_type');
|
||||
}
|
||||
$list[$item['p_id']] = [
|
||||
'company_id'=>$item['p_id'],
|
||||
'company_name'=>$item['company_name'],
|
||||
'fax_ratio' => $item['fax_ratio'],
|
||||
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
|
||||
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
|
||||
'settlement_contact' => $item['settlement_contact'],
|
||||
'create_time' => time(),
|
||||
'time_start' => date('Y-m-d', $time_start),
|
||||
'time_end' => date('Y-m-d', $time_end)
|
||||
];
|
||||
$list[$item['p_id']]['total_amount'] = $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
|
||||
}
|
||||
foreach ($res as $k => $val) {
|
||||
$gameRatio = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, true);
|
||||
if ($settlement_time_type == 2) {
|
||||
$gameRatioMax = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, false);
|
||||
} else {
|
||||
$gameRatioMax = $gameRatio;
|
||||
}
|
||||
$price = $val['amount']*$gameRatioMax/100 - $val['amount']*$item['fax_ratio']/100;
|
||||
$list[$item['p_id']]['channels'][] = [
|
||||
'promote_id' => $item['id'],
|
||||
'account'=>$item['account'],
|
||||
'relation_game_name'=>$val['relation_game_name'],
|
||||
'relation_game_id'=>$val['relation_game_id'],
|
||||
'game_ratio'=>$gameRatio,
|
||||
'game_ratio_max'=>$gameRatioMax-$gameRatio,
|
||||
'price'=> $price,
|
||||
'amount' => $val['amount']
|
||||
];
|
||||
$list[$item['p_id']]['total_amount'] += $price;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($settlement_type == 4) {
|
||||
$map = "p.account_type = 2 and p.`level` = 1 " ;
|
||||
if ($settlement_time_type == 1) {
|
||||
$map .= " and p.settlement_type = {$settlement_time_type} ";
|
||||
}
|
||||
$result = M()->query("
|
||||
SELECT
|
||||
p.id, p.account, pc.company_name, pc.id as p_id, company_relation, p.admin_id, pc.bank_card, pc.bank_cardname, pc.bank_name, pc.bank_address
|
||||
FROM
|
||||
tab_promote p
|
||||
INNER JOIN tab_promote_company pc on p.company_id = pc.id
|
||||
where {$map}
|
||||
order by pc.id asc
|
||||
");
|
||||
$list = [];
|
||||
foreach ($result as $key => $item) {
|
||||
$res = M()->query("
|
||||
select
|
||||
g.relation_game_name, g.relation_game_id, sum(s.pay_amount) as amount
|
||||
from
|
||||
tab_spend s
|
||||
inner join tab_promote p on p.chain like '/{$item['id']}/%' and s.promote_id = p.id
|
||||
inner join tab_game g on s.game_id = g.id
|
||||
where s.pay_status = 1 and s.pay_time BETWEEN {$time_start} and {$time_end}
|
||||
group by g.relation_game_id
|
||||
");
|
||||
|
||||
if ($res) {
|
||||
if (!isset($list[$item['p_id']])) {
|
||||
// 奖罚金额
|
||||
$reward = M('reward_record', 'tab_')
|
||||
->field('sum(money) as money, reward_type')
|
||||
->where("company_type = 2 and company_id = {$item['p_id']} and reward_time between {$time_start} and {$time_end}")
|
||||
->group('reward_type')
|
||||
->select();
|
||||
if (!empty($reward)) {
|
||||
$reward = array_column($reward, 'money', 'reward_type');
|
||||
}
|
||||
$list[$item['p_id']] = [
|
||||
'company_id'=>$item['p_id'],
|
||||
'company_name'=>$item['company_name'],
|
||||
'bonuses'=>isset($reward[1]) ? $reward[1] : 0,
|
||||
'fine'=>isset($reward[2]) ? $reward[2] : 0 ,
|
||||
'settlement_contact' => $item['settlement_contact'],
|
||||
'bank_card' => $item['bank_card'],
|
||||
'bank_address' => $item['bank_address'],
|
||||
'create_time' => time(),
|
||||
'time_start' => date('Y-m-d', $time_start),
|
||||
'time_end' => date('Y-m-d', $time_end)
|
||||
];
|
||||
$list[$item['p_id']]['total_amount'] = $list[$item['p_id']]['bonuses'] - $list[$item['p_id']]['fine'];
|
||||
}
|
||||
foreach ($res as $k => $val) {
|
||||
$gameRatio = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, true);
|
||||
if ($settlement_time_type == 2) {
|
||||
$gameRatioMax = getPromoteGameRatio($item['id'], $val['relation_game_id'], $val['amount'], $time_start, $time_end, false);
|
||||
} else {
|
||||
$gameRatioMax = $gameRatio;
|
||||
}
|
||||
|
||||
$price = $val['amount']*$gameRatioMax/100;
|
||||
$list[$item['p_id']]['channels'][] = [
|
||||
'promote_id' => $item['id'],
|
||||
'account'=>$item['account'],
|
||||
'relation_game_name'=>$val['relation_game_name'],
|
||||
'relation_game_id'=>$val['relation_game_id'],
|
||||
'game_ratio'=>$gameRatio,
|
||||
'game_ratio_max'=>$gameRatioMax-$gameRatio,
|
||||
'price'=> $price,
|
||||
'amount' => $val['amount'],
|
||||
'type_name' => '个人',
|
||||
'company_relation_name' => $item['company_relation'] == 0 ? "自主开发及维护" : ($item['company_relation'] == 1 ? "只维护" : "无"),
|
||||
'admin_name' => get_admin_nickname($item['admin_id']) ?: '无'
|
||||
];
|
||||
$list[$item['p_id']]['total_amount'] += $price;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$generate = false;
|
||||
$msg = "请选择正确的结算单类型";
|
||||
}
|
||||
}
|
||||
$this->assign("generate", $generate);
|
||||
$this->assign('admin_users', M('member')->where(['status'=>1])->field('uid, nickname')->select());
|
||||
$this->assign('listData', array_values($list));
|
||||
$this->assign('msg', $msg);
|
||||
$this->assign('settlement_type', $settlement_type);
|
||||
$this->meta_title = '结算单管理';
|
||||
$this->display();
|
||||
} else {
|
||||
// 判断结算时间是否冲突
|
||||
if ($msg) {
|
||||
return $this->error($msg, true, true);
|
||||
}
|
||||
if ($id) {
|
||||
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
|
||||
if (!$info) {
|
||||
return $this->error('未找到该记录');
|
||||
}
|
||||
|
||||
} else {
|
||||
if (\sizeof($_POST['settlement_sheet']) == 0) {
|
||||
return $this->error('无法生成无记录的结算单', true, true);
|
||||
}
|
||||
$isExsist = M('settlement_sheet', 'tab_')->where(['settlement_type'=>$settlement_type, 'time_start'=>$time_start, 'time_end'=>$time_end, 'settlement_time_type'=>$settlement_time_type])->find();
|
||||
if ($isExsist) {
|
||||
return $this->error('已存在此类型结算单', true, true);
|
||||
}
|
||||
$data['creater_id'] = is_login();
|
||||
$data['create_time'] = time();
|
||||
$data['orderid'] = $settlement_type.$settlement_time_type.date('YmdHis').$data['creater_id'].rand(1000, 9999);
|
||||
$data['settlement_type'] = $settlement_type;
|
||||
$data['settlement_time_type'] = $settlement_time_type;
|
||||
$data['time_start'] = $time_start;
|
||||
$data['time_end'] = $time_end;
|
||||
$data['audit_users'] = json_encode($_POST['audit_users']);
|
||||
$data['settlement_sheet'] = json_encode($_POST['settlement_sheet']);
|
||||
$data['audit_user'] = $_POST['audit_users'][0];
|
||||
$res = M('settlement_sheet', 'tab_')->add($data);
|
||||
// 生成消息
|
||||
$notice['user_id'] = $_POST['audit_users'][0];
|
||||
$notice['content'] = "结算单汇总审核:有一个结算单待你审核,请尽快处理!";
|
||||
$notice['type'] = 3;
|
||||
$notice['status'] = 2;
|
||||
$notice['create_time'] = time();
|
||||
$notice['game_id'] = $res;
|
||||
M('msg', 'tab_')->add($notice);
|
||||
return $res ? $this->success('生成成功', true, true) : $this->error('生成失败', true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function sheetDetail($id=0)
|
||||
{
|
||||
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
|
||||
if (!$info) {
|
||||
return $this->error('未找到该记录');
|
||||
}
|
||||
$info['listData'] = json_decode($info['settlement_sheet'], true);
|
||||
$info['audit_users'] = json_decode($info['audit_users']);
|
||||
$login_uid = is_login();
|
||||
$arr_index = array_search($login_uid, $info['audit_users']);
|
||||
$audit_auth = true;
|
||||
if ($arr_index === false) {
|
||||
$audit_auth = false;
|
||||
} else if ($arr_index + 1 != $info['step']) {
|
||||
$audit_auth = false;
|
||||
} else if ($arr_index + 1 == sizeof($info['audit_users']) && $info['status'] != 3) {
|
||||
$audit_auth = false;
|
||||
} else if ($info['status'] != 3) {
|
||||
$audit_auth = false;
|
||||
}
|
||||
$this->assign(['audit_auth'=>$audit_auth]);
|
||||
$this->assign($info);
|
||||
$this->meta_title = '结算单管理';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function auditSheet($id=0, $audit_type = 2, $remark = '' )
|
||||
{
|
||||
$info = M('settlement_sheet', 'tab_')->where(['id'=>$id])->find();
|
||||
if (!$info) {
|
||||
return $this->error('未找到该记录', true, true);
|
||||
}
|
||||
$info['audit_users'] = json_decode($info['audit_users']);
|
||||
$login_uid = is_login();
|
||||
$arr_index = array_search($login_uid, $info['audit_users']);
|
||||
if ($arr_index === false) {
|
||||
return $this->error('无权审核改结算单', true, true);
|
||||
} else if ($arr_index + 1 != $info['step']) {
|
||||
return $this->error('您已审核过此结算单', true, true);
|
||||
} else if ($arr_index + 1 == sizeof($info['audit_users']) && $info['status'] != 3) {
|
||||
return $this->error('该结算单已经审核完毕', true, true);
|
||||
}
|
||||
$is_last = ($info['setp'] + 1 >= sizeof($info['audit_users']));
|
||||
$update['remark'] = $remark;
|
||||
$update['status'] = $audit_type == 1 ? ($is_last ? 1 : 3) : 2;
|
||||
$update['step'] = ($audit_type == 1 && !$is_last) ? $info['step'] + 1 : $info['step'];
|
||||
$update['audit_user'] = $login_uid;
|
||||
if ($audit_type == 1 && $is_last) {
|
||||
$update['all_status'] = 1;
|
||||
} else if ($audit_type == 2) {
|
||||
$update['all_status'] = 2;
|
||||
}
|
||||
// 通知审核
|
||||
if ($update['status'] == 3 && !$is_last) {
|
||||
$notice['user_id'] = $info['audit_users'][$info['step']];
|
||||
$notice['content'] = "结算单汇总审核:有一个结算单待你审核,请尽快处理!";
|
||||
$notice['type'] = 3;
|
||||
$notice['status'] = 2;
|
||||
$notice['create_time'] = time();
|
||||
$notice['game_id'] = $id;
|
||||
M('msg', 'tab_')->add($notice);
|
||||
}
|
||||
$upt = M('settlement_sheet', 'tab_')->where(['id'=>$id])->save($update);
|
||||
return $upt ? $this->success('审核成功', true, true) : $this->error('审核失败', true, true);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":2,"player":0,"money":0},"active":[{"time":"0:00","count":1},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}
|
@ -0,0 +1,559 @@
|
||||
<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;
|
||||
}
|
||||
.data_game_list table td{
|
||||
line-height:1;
|
||||
padding: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
#form .txt_area.download_url {width:400px;}
|
||||
.tabcon1711 .table_radio2 .table_btn {width:215px;}
|
||||
.bnt_add,.bnt_remove,.bnt_save{
|
||||
height: 30px;
|
||||
width: 20px;
|
||||
font-size: 20px;
|
||||
line-height: 10px;
|
||||
color: #3399ff;
|
||||
background: none;
|
||||
border: none;
|
||||
margin-left: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.bnt_remove{
|
||||
color: #F70909;
|
||||
}
|
||||
.bnt_save{
|
||||
color: #4DB361;
|
||||
}
|
||||
</style>
|
||||
<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;}
|
||||
</style>
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">{$meta_title}</h3>
|
||||
</div>
|
||||
<div class="jssearch search_list fl cf">
|
||||
|
||||
<div class="cf top_nav_list">
|
||||
<!-- 高级搜索 -->
|
||||
<div class="cf top_nav_list">
|
||||
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="settlement_type" name="settlement_type" class="select_gallery" <?php echo $generate ? 'disabled="disabled"' : ""?></select>>
|
||||
<option value="">请选择结算单类型</option>
|
||||
<option value="1" <?php echo $settlement_type === 1 ? "selected" : ''?>>上游-汇总结算单</option>
|
||||
<option value="2" <?php echo $settlement_type === 2 ? "selected" : ''?>>下游-内团汇总结算单</option>
|
||||
<option value="3" <?php echo $settlement_type === 3 ? "selected" : ''?>>下游-外团汇总结算单</option>
|
||||
<option value="4" <?php echo $settlement_type === 4 ? "selected" : ''?>>下游-个人汇总结算单</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="settlement_time_type" name="settlement_time_type" class="select_gallery" <?php echo $generate ? 'disabled="disabled"' : ""?>>
|
||||
<option value="">结算方式</option>
|
||||
<option value="1" <?php $settlement_time_type === 1 ? "selected" : ''?>>周结</option>
|
||||
<option value="2" <?php $settlement_time_type == 2 ? "selected" : ''?>>月结</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-list" id="pay_time">
|
||||
<input type="text" class="txt range-date" id="time" name="settlement_time" placeholder="结算时间" value="{$settlement_time}" <?php echo $generate ? 'disabled="disabled"' : ""?> style="width: 180px;" readonly="readonly">
|
||||
</div>
|
||||
|
||||
<?php if (!$generate) :?>
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="/admin.php?s=/settlement/generateSettlementSheet">生成</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($msg):?>
|
||||
<div class="data_list data_game_list">
|
||||
<div class="">
|
||||
<table border="1">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:10%;min-width:150px;">{$msg}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif ($settlement_type == 1):?>
|
||||
<span style="color: red;">上游-汇总结算单</span>
|
||||
<div class="data_list data_game_list">
|
||||
<div class="">
|
||||
<table border="1">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:10%;min-width:150px;">平台</th>
|
||||
<th>时间</th>
|
||||
<th>游戏名称</th>
|
||||
<th>平台流水</th>
|
||||
<th>分成比例</th>
|
||||
<th>我方比例</th>
|
||||
<th>渠道费率</th>
|
||||
<th>税费费率</th>
|
||||
<th>合作方结算分成</th>
|
||||
<th>违规罚款</th>
|
||||
<th>奖励</th>
|
||||
<th style="width:20%;min-width:150px;">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<empty name ="listData">
|
||||
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
|
||||
<else />
|
||||
<?php foreach ($listData as $index => $item): ?>
|
||||
<?php foreach ($item['channels'] as $k => $channel): ?>
|
||||
<?php if ($k == 0) :?>
|
||||
<tr>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
|
||||
<td>123</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['self_game_ratio']}%</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['channel_rate']*100}%</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['invoice_rate']*100}%</td>
|
||||
<td>{$channel['parter_settlement']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}"><textarea class="remark-txt" style="height: 100%;width: 100%;" oninput="updateDataRemark({$index}, this)"></textarea></td>
|
||||
</tr>
|
||||
<?php else :?>
|
||||
<tr>
|
||||
<td>123</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['self_game_ratio']}%</td>
|
||||
<td>{$channel['parter_settlement']}</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</empty>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif (in_array($settlement_type, [2, 3])):?>
|
||||
<!-- 下游-内团/外团汇总结算单 -->
|
||||
<span style="color: red;">下游-<?php echo $settlement_type == 2 ? "内团" : "外团"?>汇总结算单</span>
|
||||
<div class="data_list data_game_list">
|
||||
<div class="">
|
||||
<table border="1">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>排序</th>
|
||||
<th style="width:10%;">平台</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:20%;min-width:150px;">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<empty name ="listData">
|
||||
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
|
||||
<else />
|
||||
<?php foreach ($listData as $index => $item): ?>
|
||||
<?php foreach ($item['channels'] as $k => $channel): ?>
|
||||
<?php if ($k == 0) :?>
|
||||
<tr>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
|
||||
<td>{$channel['account']}</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['game_ratio_max']}%</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['fax_ratio']*100}%</td>
|
||||
<td>{$channel['price']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
|
||||
<td>{$item['time_start']} 至 {$item['time_end']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">备注</td>
|
||||
</tr>
|
||||
<?php else :?>
|
||||
<tr>
|
||||
<td>{$channel['account']}</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['game_ratio_max']}%</td>
|
||||
<td>{$channel['price']}</td>
|
||||
<td>{$item['time_start']} 至 {$item['time_end']}</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</empty>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif ($settlement_type == 4):?>
|
||||
<span style="color: red;">下游-个人汇总结算单</span>
|
||||
<div class="data_list data_game_list">
|
||||
<div class="">
|
||||
<table border="1">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>排序</th>
|
||||
<th style="width:10%;min-width:150px;">公司名称</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>开户网点</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<empty name ="listData">
|
||||
<td colspan="99" class="text-center">aOh! 暂时还没有可结算内容!</td>
|
||||
<else />
|
||||
<?php foreach ($listData as $index => $item): ?>
|
||||
<?php foreach ($item['channels'] as $k => $channel): ?>
|
||||
<?php if ($k == 0) :?>
|
||||
<tr>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$index+1}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item.company_name}</td>
|
||||
<td>{$channel['account']}</td>
|
||||
<td>{$channel['admin_name']}</td>
|
||||
<td>{$channel['company_relation_name']}</td>
|
||||
<td>{$channel['type_name']}</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td >{$item['time_start']} 至 {$item['time_end']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['game_ratio_max']}%</td>
|
||||
<td>{$channel['price']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['bonuses']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['fine']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['total_amount']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['settlement_contact']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_card']}</td>
|
||||
<td rowspan="{:sizeof($item['channels'])}">{$item['bank_address']}</td>
|
||||
</tr>
|
||||
<?php else :?>
|
||||
<tr>
|
||||
<td>{$channel['account']}</td>
|
||||
<td>{$channel['admin_name']}</td>
|
||||
<td>{$channel['company_relation_name']}</td>
|
||||
<td>{$channel['type_name']}</td>
|
||||
<td>{$channel['relation_game_name']}</td>
|
||||
<td >{$item['time_start']} 至 {$item['time_end']}</td>
|
||||
<td>{$channel['amount']}</td>
|
||||
<td>{$channel['game_ratio']}%</td>
|
||||
<td>{$channel['game_ratio_max']}%</td>
|
||||
<td>{$channel['price']}</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</empty>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<br>
|
||||
<?php if ($generate):?>
|
||||
<span>请选择审核人:</span>
|
||||
<div>
|
||||
<span class="audit_user">
|
||||
<select class="first_audit">
|
||||
<?php foreach ($admin_users as $admin):?>
|
||||
<option value="{$admin['uid']}" >{$admin['nickname']}</option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
<button type="button" class="bnt_save">→</button>
|
||||
</span>
|
||||
<button type="button" class="bnt_add">✚</button>
|
||||
<button type="button" class="bnt_remove">✖</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="submit_btn" id="submit" type="submit" target-form="form-horizontal">
|
||||
确认保存
|
||||
</button>
|
||||
<button class="submit_btn" onclick="javascript:history.back(-1)">
|
||||
返回
|
||||
</button>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
</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>
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
|
||||
<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>
|
||||
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
|
||||
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
|
||||
<script src="__STATIC__/flatpickr/l10n/zh.js"></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('settlement/sheetList')}");
|
||||
var data = {:json_encode($listData)};
|
||||
$(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;
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
|
||||
// 提交
|
||||
$('#submit').on('click', function(){
|
||||
var first_audit_arr = [];
|
||||
var first_audits = $('.first_audit');
|
||||
if (first_audits.size() <= 0) {
|
||||
layer.msg("请选择至少一名一级审核人")
|
||||
return false;
|
||||
} else {
|
||||
$.each(first_audits, function(index, item){
|
||||
first_audit_arr.push($(item).val());
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
url:"{:U('settlement/generateSettlementSheet')}",
|
||||
method:'POST',
|
||||
dataType:'JSON',
|
||||
data:{
|
||||
settlement_sheet:data,
|
||||
audit_users:first_audit_arr,
|
||||
settlement_type : $('#settlement_type').val(),
|
||||
settlement_time_type : $('#settlement_time_type').val(),
|
||||
settlement_time : $('#time').val()
|
||||
},
|
||||
success:function(response){
|
||||
layer.msg(response.info);
|
||||
if (response.status != 0) {
|
||||
window.location.href = "{:U('settlement/sheetList')}";
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".bnt_add").bind("click",function(){
|
||||
console.log(1)
|
||||
var a = $(this).parent('div').children('.audit_user:last').clone();
|
||||
//$(".user-account:last").after(a);
|
||||
$(this).before(a);
|
||||
});
|
||||
|
||||
$(document).on('click', '.bnt_remove', function(){
|
||||
if ($(this).parent('div').find('.audit_user').size() == 1) {
|
||||
return false;
|
||||
}
|
||||
$(this).parent('div').find('.audit_user:last').remove();
|
||||
});
|
||||
|
||||
function setTimeByWeek() {
|
||||
var defaultDate = $('#time').val()
|
||||
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
|
||||
$('#time').flatpickr({
|
||||
mode: 'range',
|
||||
locale: 'zh',
|
||||
dateFormat: "Y-m-d",
|
||||
defaultDate: defaultDate,
|
||||
onChange: function (selectedDates, dateStr, instance) {
|
||||
if (dateStr.indexOf('至') === -1) {
|
||||
var thisDate = new Date(Date.parse(dateStr));
|
||||
if (thisDate.getDay() !== 1) {
|
||||
layer.msg('请选择周一到周日');
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
var thisDate = dateStr.split(' 至 ');
|
||||
var startDate = new Date(Date.parse(thisDate[0]));
|
||||
if (startDate.getDay() !== 1 || Date.parse(thisDate[1]) / 1000 - Date.parse(thisDate[0]) / 1000 !== 518400) {
|
||||
layer.msg('请选择周一到周日');
|
||||
$('#time').val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setTimeByMonth() {
|
||||
$('#time').datetimepicker({
|
||||
format: 'yyyy-mm',
|
||||
language: "zh-CN",
|
||||
autoclose: true,
|
||||
scrollMonth: false,
|
||||
scrollTime: false,
|
||||
scrollInput: false,
|
||||
startView: 'year',
|
||||
minView:'year',
|
||||
maxView:'year',
|
||||
});
|
||||
}
|
||||
|
||||
function resetTime() {
|
||||
$('#time').remove();
|
||||
var html = '<input type="text" class="txt range-date" id="time" name="settlement_time" placeholder="结算时间" value="" style="width: 180px;" readonly="readonly">';
|
||||
$('#pay_time').html(html);
|
||||
}
|
||||
|
||||
switch (parseInt("{:(I('settlement_time_type', 0))}")) {
|
||||
case 1:
|
||||
setTimeByWeek();
|
||||
break;
|
||||
case 2:
|
||||
setTimeByMonth();
|
||||
break;
|
||||
}
|
||||
|
||||
$('#settlement_time_type').change(function () {
|
||||
var settlementType = parseInt($(this).val());
|
||||
switch (settlementType) {
|
||||
case 1:
|
||||
resetTime();
|
||||
setTimeByWeek();
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
resetTime();
|
||||
setTimeByMonth();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
function updateDataRemark(index, obj)
|
||||
{
|
||||
data[index].remark = $(obj).val();
|
||||
}
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,135 @@
|
||||
{
|
||||
"id": "1392920",
|
||||
"name": "project",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "577306",
|
||||
"name": "方形未选中",
|
||||
"font_class": "fangxingweixuanzhong",
|
||||
"unicode": "e720",
|
||||
"unicode_decimal": 59168
|
||||
},
|
||||
{
|
||||
"icon_id": "577307",
|
||||
"name": "方形选中-fill",
|
||||
"font_class": "fangxingxuanzhongfill",
|
||||
"unicode": "e721",
|
||||
"unicode_decimal": 59169
|
||||
},
|
||||
{
|
||||
"icon_id": "577313",
|
||||
"name": "加号1",
|
||||
"font_class": "jiahao1",
|
||||
"unicode": "e727",
|
||||
"unicode_decimal": 59175
|
||||
},
|
||||
{
|
||||
"icon_id": "577315",
|
||||
"name": "减号",
|
||||
"font_class": "jianhao",
|
||||
"unicode": "e729",
|
||||
"unicode_decimal": 59177
|
||||
},
|
||||
{
|
||||
"icon_id": "1718321",
|
||||
"name": "返回",
|
||||
"font_class": "fanhui",
|
||||
"unicode": "e600",
|
||||
"unicode_decimal": 58880
|
||||
},
|
||||
{
|
||||
"icon_id": "1718323",
|
||||
"name": "更多",
|
||||
"font_class": "gengduo",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "2674472",
|
||||
"name": "返回",
|
||||
"font_class": "fanhui1",
|
||||
"unicode": "e625",
|
||||
"unicode_decimal": 58917
|
||||
},
|
||||
{
|
||||
"icon_id": "2674473",
|
||||
"name": "关闭",
|
||||
"font_class": "guanbi",
|
||||
"unicode": "e624",
|
||||
"unicode_decimal": 58916
|
||||
},
|
||||
{
|
||||
"icon_id": "4765734",
|
||||
"name": "plus-circle",
|
||||
"font_class": "plus-circle",
|
||||
"unicode": "e781",
|
||||
"unicode_decimal": 59265
|
||||
},
|
||||
{
|
||||
"icon_id": "4765972",
|
||||
"name": "minus-square",
|
||||
"font_class": "minus-square",
|
||||
"unicode": "e796",
|
||||
"unicode_decimal": 59286
|
||||
},
|
||||
{
|
||||
"icon_id": "4765973",
|
||||
"name": "plus-square",
|
||||
"font_class": "plus-square",
|
||||
"unicode": "e797",
|
||||
"unicode_decimal": 59287
|
||||
},
|
||||
{
|
||||
"icon_id": "4936531",
|
||||
"name": "minus-square-fill",
|
||||
"font_class": "minus-square-fill",
|
||||
"unicode": "e84b",
|
||||
"unicode_decimal": 59467
|
||||
},
|
||||
{
|
||||
"icon_id": "4936538",
|
||||
"name": "plus-square-fill",
|
||||
"font_class": "plus-square-fill",
|
||||
"unicode": "e84c",
|
||||
"unicode_decimal": 59468
|
||||
},
|
||||
{
|
||||
"icon_id": "6151304",
|
||||
"name": "reply",
|
||||
"font_class": "reply",
|
||||
"unicode": "e82f",
|
||||
"unicode_decimal": 59439
|
||||
},
|
||||
{
|
||||
"icon_id": "6151371",
|
||||
"name": "sort",
|
||||
"font_class": "sort",
|
||||
"unicode": "e842",
|
||||
"unicode_decimal": 59458
|
||||
},
|
||||
{
|
||||
"icon_id": "6151377",
|
||||
"name": "sort-down",
|
||||
"font_class": "sort-down",
|
||||
"unicode": "e843",
|
||||
"unicode_decimal": 59459
|
||||
},
|
||||
{
|
||||
"icon_id": "6151384",
|
||||
"name": "sort-up",
|
||||
"font_class": "sort-up",
|
||||
"unicode": "e844",
|
||||
"unicode_decimal": 59460
|
||||
},
|
||||
{
|
||||
"icon_id": "8776842",
|
||||
"name": "search",
|
||||
"font_class": "icon-test",
|
||||
"unicode": "e63c",
|
||||
"unicode_decimal": 58940
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue