新增是否允许打款

master
chenzhi 4 years ago
parent 79a9a8c68c
commit 1f155020d4

@ -541,8 +541,10 @@ class CompanyStatementController extends ThinkController
}
if($k=="ups" || $k=='downs'){
$is_payment = 1;
$verify_status = 0;
}else{
$is_payment = 2;
$verify_status = 2;
}
//创建基础未满基础信息
@ -607,7 +609,8 @@ class CompanyStatementController extends ThinkController
"statement_begin_time"=>$v['statement_begin_time'],
"statement_end_time"=>$v['statement_end_time'],
"statement_info"=>json_encode($va['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>$va['statement_num']
"statement_num"=>$va['statement_num'],
"verify_status"=>$verify_status
];
$companyid = $StatementInfo->add($company);
$v['info_ids'][] =$companyid;

@ -210,7 +210,7 @@ class CompanyStatementLackController extends ThinkController
//保存公司信息
$company_list = $v['company_list'];
foreach ($company_list as $ke => $va) {
$this->addStatementInfo($va,$ke,$v);
$this->addStatementInfo($va,$ke,$v,$k);
}
if(empty($v['create_lack_ids']) && empty($v['del_lack_ids']) && empty($v['info_ids'])){ continue;}
@ -238,7 +238,13 @@ class CompanyStatementLackController extends ThinkController
"info"=>"汇总成功"
));
}
protected function addStatementInfo($va,$ke,&$v){
protected function addStatementInfo($va,$ke,&$v,$k){
if($k=="ups" || $k=='downs' || $k =="users"){
$verify_status = 0;
}else{
$verify_status = 2;
}
$StatementInfo = M("company_statement_info","tab_");
if($va['pay_amount'] > 0){
//存成功
@ -257,7 +263,8 @@ class CompanyStatementLackController extends ThinkController
"statement_begin_time"=>$v['statement_begin_time'],
"statement_end_time"=>$v['statement_end_time'],
"statement_info"=>json_encode($va['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>$va['statement_num']
"statement_num"=>$va['statement_num'],
"verify_status"=>$verify_status
];
$companyid = $StatementInfo->add($company);
$v['info_ids'][] =$companyid;

@ -90,7 +90,8 @@ class CompanyStatementPoolController extends ThinkController
$data = $this->DBModel
->field("*")
->where($map)
->order("op_time Desc")->page($page,$row)->select();
->order("FIELD(verify_status,0,1,-1,-2,2,3,4,5),id desc")
->page($page,$row)->select();
foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
@ -394,7 +395,24 @@ class CompanyStatementPoolController extends ThinkController
public function verifyRefuse(){
$this->setVerifyStatus(0,-1,"verify");
}
//线下打款
public function setUlPayment()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
//修改info
$ires = M("company_statement_info","tab_")->where("pool_id='{$ids}'")->save(['pay_type'=>3,'pay_status'=>1]);
if($ires !== false){
$this->setVerifyStatus(1,4,"payment");
}
$this->ajaxReturn(array(
'status' =>0,
"info"=>"线下打款失败"
));
}
protected function setVerifyStatus($old_status,$change_status,$op_pre)
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
@ -416,6 +434,28 @@ class CompanyStatementPoolController extends ThinkController
"info"=>$opname."成功"
));
}
//打款设置
public function setPayment(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$CompanyInfo = M("company_statement_info","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,p.statement_money all_money")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("pool_id='{$id}'")
->select();
foreach($CompanyInfo as $k=>&$v){
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
}
$this->assign("CompanyInfo",$CompanyInfo);
$this->display();
}
//保存备注
public function saveRemark(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
@ -659,7 +699,7 @@ class CompanyStatementPoolController extends ThinkController
M()->commit();
$this->ajaxReturn(array(
'status' => 1,
"info"=>"重算金额成功"
"info"=>"撤销汇总成功"
));
}
@ -694,6 +734,8 @@ class CompanyStatementPoolController extends ThinkController
"viewVoucher"=>"<a class='confirm viewVoucher' data-img='{$img}' data-id='{$id}'>查看凭证</a>",
"editVoucher"=>" <a class='confirm editVoucher' data-id='{$id}'>编辑凭证</a>",
"setUlPayment"=>"<a class='confirm setUlPayment' data-id='{$id}'>线下打款</a>",
"setPayment"=>"<a class='confirm setPayment' data-id='{$id}'>打款信息提交</a>",
"editPayment"=>"<a class='confirm setPayment' data-id='{$id}'>打款信息编辑</a>",
"viePayment"=>"<a class='confirm setPayment' data-id='{$id}'>打款详情</a>",
@ -711,7 +753,7 @@ class CompanyStatementPoolController extends ThinkController
$optist = ["viewPool","reCount","cancelPool"];
break;
case '1':
$optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","setPayment"];
$optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","setPayment","setUlPayment"];
break;
case '2':
$optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","editPayment"];
@ -755,6 +797,13 @@ class CompanyStatementPoolController extends ThinkController
}else{
$optist = array_diff($optist, ["uploadVoucher"]);
}
if($info['is_payment'] == 1){
$optist = array_diff($optist, ["setUlPayment"]);
}else{
$optist = array_diff($optist, ["setPayment","editPayment","viePayment"]);
}
if(empty($info['remark'])){
//未上传备注
$optist = array_diff($optist, ["editRemark", "viewRemark"]);

@ -818,7 +818,9 @@ class CompanyStatementSetController extends Controller {
"nickname"=>$v['nickname'],
"payee_name"=>$v['payee_name'],
"bank_account"=>$v['bank_account'],
"opening_bank"=>$v['opening_bank']
"opening_bank"=>$v['opening_bank'],
"ali_user"=>$v['ali_user'],
"ali_account"=>$v['ali_account']
];
if($v['statement_money'] < 300){
$lackcompany =[
@ -887,6 +889,11 @@ class CompanyStatementSetController extends Controller {
"statement_info"=>json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5)
];
if($v['is_payment'] == 1){
$company['verify_status'] = 0;
}else{
$company['verify_status'] = 2;
}
$companyid = $StatementInfo->add($company);
$countdata['info_ids'][] =$companyid;
$countdata['del_lack_ids'] =array_merge($countdata['del_lack_ids'],$del_lack_ids);

@ -398,11 +398,31 @@
})
//撤销汇总
$(".cancelPool").on("click",function(){
$(".cancelPool,.reCount").on("click",function(){
var id = $(this).data('id');
var url = "{:U('cancelPool')}";
cancelPoolAjax(url,{id:id});
})
//线下打款
$(".setUlPayment").on("click",function(){
var id = $(this).data('id');
var url = "{:U('setUlPayment')}";
cancelPoolAjax(url,{ids:id});
})
$(".setPayment").on("click",function(){
var id = $(this).data("id");
var url = "{:U('setPayment')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: url
});
})
function cancelPoolAjax(opurl,senddata){
//执行
$.ajax({

@ -0,0 +1,195 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
</head>
<style>
html {
min-width: 100%;
}
body {
padding: 0px 10px 150px;
/* width: 960px; */
margin: auto;
}
.tabcon1711 table {
width: 480px;
}
table {
margin: auto;
}
.hidebox {
display: none;
}
.r {
width: 300px;
}
.l {
width: 180px;
}
.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;
}
.input-list,
.i_list {
float: left;
margin: 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 20px;">
<div class="">
<table>
<thead>
<tr>
<th style="border-right: solid 1px #b6cad2;">序号</th>
<th style="border-right: solid 1px #b6cad2;">合作公司</th>
<th style="border-right: solid 1px #b6cad2;">支付宝真实名称</th>
<th style="border-right: solid 1px #b6cad2;">支付宝账号</th>
<th style="border-right: solid 1px #b6cad2;">关联结算汇总单订单号</th>
<th style="border-right: solid 1px #b6cad2;">金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">备注</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="CompanyInfo" item="vo" >
<tr>
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>
<td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td>
</tr>
</foreach>
<tr>
<td colspan="2">合计:</td>
<td colspan="5">打款总金额:{$CompanyInfo[0]['all_money']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="search_list" style="display:flex;justify-content:flex-end;width:100%;margin-top: 30px;">
<div class="input-list" style="margin-left: 30px;float: right;">
<a class="sch-btn" href="javascript:;" id="setPayment" style="width: 150px;">确认提交</a>
</div>
</div>
<script>
$("#setPayment").on("click",function(){
var sendObj = {};
$("input[name='ali_user']").map(function(index,elem) {
var id = $(elem).data("id");
var to = {
"ali_user":$(elem).val(),
"ali_account":'',
"remark":''
}
sendObj[id]=to;
});
$("input[name='ali_account']").map(function(index,elem) {
var id = $(elem).data("id");
if(id in sendObj){
sendObj[id]['ali_account']=$(elem).val();
}else{
var to = {
"ali_account":$(elem).val(),
"ali_user":'',
"remark":''
}
sendObj[id]=to;
}
});
$("input[name='remark']").map(function(index,elem) {
var id = $(elem).data("id");
if(id in sendObj){
sendObj[id]['remark']=$(elem).val();
}else{
var to = {
"remark":$(elem).val(),
"ali_user":'',
"ali_account":''
}
sendObj[id]=to;
}
});
layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){
// _doAgreeApply();
layer.close(index);
});
})
</script>
</body>
</html>

@ -1947,7 +1947,8 @@ CREATE TABLE `tab_company_statement_info` (
`statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间',
`statement_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '结算单号',
`statement_info` text NOT NULL DEFAULT '' COMMENT '订单相关信息json',
`pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '审核状态 -1:打款失败 0:未打款 1:打款成功',
`verify_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '验证状态 -1:配置信息不全 0:信息未确认 1:允许打款 2:线下无需打款',
`pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间',
`pay_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款类型 1提现 2线上打款 3线下打款',

Loading…
Cancel
Save