新增税费费率

master
chenzhi 4 years ago
parent 58c8508ce4
commit 0c2e2db65d

@ -873,7 +873,7 @@ function checkPhone($phone) {
* @return false|int
*/
function checkNumber($num) {
return preg_match("/^([1-9][0-9]*)+(.[0-9]{1,2})?$/",$num);
return preg_match("/^([1-9][0-9]*)+(.[0-9]{1,3})?$/",$num);
}
//获取sdk类型名称

@ -3,8 +3,6 @@
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
use OSS\OssClient;
use OSS\Core\OSsException;
use Think\Controller;
/**
@ -201,14 +199,22 @@ class PartnerController extends ThinkController
$this->meta_title = '合作方管理';
$this->display();
}
//审核列表
public function index()
{
$model = M("partner_verify", 'tab_');
$map = [];
//
$this->display();
}
//添加
public function add()
{
$model = M($this->modelName, 'tab_');;
if ($_POST) {
$save = I("post.");
$this->checkData($save);
$save['uid'] = UID;
$save['create_time'] = time();
$res = $model->add($save);
@ -284,9 +290,6 @@ class PartnerController extends ThinkController
$data['validity_end_time']='';
}
$data['channel_rate'] *= 100;//存的是小数,显示百分比
$data['invoice_rate'] *= 100;//存的是小数,显示百分比
// dd($data);
$this->assign('data', $data);
$action = I('action');
$this->assign('action', $action);
@ -361,22 +364,37 @@ class PartnerController extends ThinkController
if(!empty(I('reg_phone')) && !checkPhone(I('reg_phone'))) {
$this->error('注册电话格式不正确');
}
if(!empty(I('taxation_rate'))) {
if(!checkNumber(I('taxation_rate'))){
$this->error('税费费率格式错误');
}else{
$save['taxation_rate'] = ($save['taxation_rate'] ?: 0);
}
}else{
$save['taxation_rate']=0;
}
if(!empty(I('channel_rate'))) {
if(!checkNumber(I('channel_rate'))){
$this->error('渠道费率格式不对');
}else{
$save['channel_rate'] = ($save['channel_rate'] ?: 0)/100;
$save['channel_rate'] = ($save['channel_rate'] ?: 0);
}
}else{
$save['channel_rate']=0;
}
if(!empty(I('invoice_rate'))) {
if(!checkNumber(I('invoice_rate'))){
$this->error('开票税点格式不对');
}else{
$save['invoice_rate'] = ($save['invoice_rate'] ?: 0)/100;
$save['invoice_rate'] = ($save['invoice_rate'] ?: 0);
}
}else{
$save['invoice_rate']=0;
}
if(!empty(I('server_fee')) && !checkNumber(I('server_fee'))) {
if(!empty(I('server_fee')) && !checkNumber(I('server_fee')) && I("has_server_fee") == 1) {
$this->error('服务器费用格式不对');
}else{
$save['server_fee']=0;
}
$time = time();
$save['contract_start_time'] = strtotime($save['contract_start_time']);

@ -63,18 +63,23 @@
<tr>
<td class="l">渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
<input type="text" class="txt " name="channel_rate" value="" placeholder="渠道费率(最多两位小数)"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l">开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="invoice_rate" value="" placeholder="请输入开票税点"><span style="margin-left: 3px;padding-top: 5px">%</span>
<input type="text" class="txt " name="invoice_rate" value="" placeholder="开票税点(最多两位小数)"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l">税费费率:</td>
<td class="r" >
<input type="text" class="txt " name="taxation_rate" value="" placeholder="税费费率(最多三位小数)"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">是否签署合同:</td>

@ -62,14 +62,20 @@
<tr>
<td class="l">渠道费率:</td>
<td class="r" >
<input type="text" class="txt " name="channel_rate" value="{$data.channel_rate}" placeholder="请输入渠道费率"> <span style="margin-left: 3px;padding-top: 5px">%</span>
<input type="text" class="txt " name="channel_rate" value="{$data.channel_rate}" placeholder="渠道费率(最多两位小数)"> <span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l">开票税点:</td>
<td class="r" >
<input type="text" class="txt " name="invoice_rate" value="{$data.invoice_rate}" placeholder="请输入开票税点"><span style="margin-left: 3px;padding-top: 5px">%</span>
<input type="text" class="txt " name="invoice_rate" value="{$data.invoice_rate}" placeholder="开票税点(最多两位小数)"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l">税费费率:</td>
<td class="r" >
<input type="text" class="txt " name="taxation_rate" value="{$data.taxation_rate}" placeholder="税费费率(最多三位小数)"><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
@ -425,14 +431,11 @@
});
});
$("#submit2").on("click",function(){
console.log(111);
var cres = $('form').serializeArray();
console.log(222);
//验证通过
if(doc.length > 0){
cres.push({"name":"file_info", "value":JSON.stringify(doc)});
}
console.log(333);
//添加
$.ajax({
url:"{:U('partner/edit')}",

@ -74,6 +74,9 @@
<th>开票税点</th>
<th>发票类型</th>
<th>发票类型</th>
<th>税费费率</th>
<th>渠道费率</th>
<th>注册地址</th>
<th>注册电话</th>
@ -127,6 +130,7 @@
<td rowspan="{$data.row}">{$data.invoice_rate}%</td>
<td rowspan="{$data.row}">{$data.invoice_type}</td>
<td rowspan="{$data.row}">{$data.taxation_rate}%</td>
<td rowspan="{$data.row}">{$data.channel_rate}%</td>
<td rowspan="{$data.row}">{$data.reg_address}</td>
<td rowspan="{$data.row}">{$data.reg_phone}</td>

@ -0,0 +1,313 @@
<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;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
</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="partner" class="search-input" value="{:I('partner')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_type" name="company_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">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list data_game_list">
<div class="">
<table border="1">
<!-- 表头 -->
<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>是否有预付款</th>
<th style="width:8%;min-width:10px;">操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="15" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data">
<tr>
<td rowspan="{$data.row}">{$data.partner}</td>
<td rowspan="{$data.row}">{$data.matche_platform}</td>
<td rowspan="{$data.row}">{$data.company_type}</td>
<notempty name="data.game">
<td rowspan="{$data['game'][0]['row']}">{$data['game'][0]['original_package_name']}</td>
<td rowspan="{$data['game'][0]['row']}">{$data['game'][0]['relation_game_name']}</td>
<td rowspan="{$data['game'][0]['row']}">{$data['game'][0]['game_type_name']}</td>
<notempty name="data['game'][0]['game_ratio']">
<td>{$data['game'][0]['game_ratio'][0]['name']}</td>
<td>{$data['game'][0]['game_ratio'][0]['ratio']}%</td>
<else />
<td >-</td>
<td>-</td>
</notempty>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</notempty>
<td rowspan="{$data.row}">{$data.settlement_type}</td>
<td rowspan="{$data.row}">{$data.payee_name}</td>
<td rowspan="{$data.row}">{$data.bank_account}</td>
<td rowspan="{$data.row}">{$data.opening_bank}</td>
<td rowspan="{$data.row}">{$data.has_advance_charge}</td>
<td rowspan="{$data.row}">{$data.is_collection}</td>
<td rowspan="{$data.row}">
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('edit',array('id'=>$data['id'],'action' => 'show'))}">查看</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
</td>
</tr>
<if condition="$data['game'][0]['row'] gt 1">
<foreach name="data['game'][0]['game_ratio']" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']}</td>
<td>{$game_ratio['ratio']}%</td>
</tr>
</if>
</foreach>
</if>
<notempty name="data['game'][1]">
<foreach name="data['game']" item="game" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td rowspan="{$game['row']}">{$game['original_package_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<notempty name="game['game_ratio']">
<td>{$game['game_ratio'][0]['name']}</td>
<td>{$game['game_ratio'][0]['ratio']}%</td>
<else />
<td >-</td>
<td>-</td>
</notempty>
</tr>
<if condition="$game['row'] gt 1">
<foreach name="game['game_ratio']" item="game_ratio" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game_ratio['name']}</td>
<td>{$game_ratio['ratio']}%</td>
</tr>
</if>
</foreach>
</if>
</if>
</foreach>
</notempty>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</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();
}
});
});
</script>
</block>

@ -72,6 +72,13 @@
<input type="text" class="txt " name="inoice_rate" value="{$data.inoice_rate}" placeholder="请输入开票税点" readonly><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>
<tr>
<td class="l">税费费率:</td>
<td class="r" >
<input type="text" class="txt " name="taxation_rate" value="{$data.taxation_rate}" placeholder="请输入税费费率" readonly><span style="margin-left: 3px;padding-top: 5px">%</span>
</td>
</tr>

@ -2091,3 +2091,24 @@ ALTER TABLE `tab_partner`
MODIFY COLUMN `settlement_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '结算方式(作废,请查看tab_company_relation表)' AFTER `is_sign_contract`;
ALTER TABLE `sys_shift_task`
ADD COLUMN `change_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '推广员充值换榜执行状态 0 未处理 1 已处理' AFTER `status`;
--CP cz
ALTER TABLE `tab_partner`
ADD COLUMN `taxation_rate` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '开票税点' AFTER `cooperation_status`;
CREATE TABLE `tab_partner_verify` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`partner_id` int(11) NOT NULL COMMENT '0新增,其他修改',
`partner_name` varchar(60) NOT NULL DEFAULT '' COMMENT '上游公司名称',
`partner_info` text NOT NULL COMMENT '公司信息',
`verify_status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态 -1拒绝 0未审核 1审核通过',
`create_admin_id` int(11) NOT NULL DEFAULT '0' COMMENT '添加人ID',
`create_admin_account` int(11) NOT NULL DEFAULT '0' COMMENT '添加人账号',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
`verify_log` text NOT NULL COMMENT '审批相关信息json',
PRIMARY KEY (`id`),
KEY `partner_id` (`partner_id`) USING BTREE,
KEY `partner_name` (`partner_name`) USING BTREE,
KEY `verify_status` (`verify_status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

Loading…
Cancel
Save