新增线上转线下打款

master
chenzhi 4 years ago
parent 7617ee8a4c
commit 684ea81b6a

@ -317,6 +317,29 @@ class PaymentController extends BaseController
$companyInfo['ali_account'] = $newInfo['ali_account'];
return json_encode($companyInfo,JSON_UNESCAPED_UNICODE);
}
//线上转线下
public function setStatementPayTapy()
{
$id = I("post.id",0);
$PayStatementDB = M("pay_statement_info","tab_");
//判断线上打款
$sWhere = [
'company_id' => $oldInfo['company_id'],
'statement_info_id' => $id
];
$sCount = $PayStatementDB->where($sWhere)->where("pay_status = 1")->count();
if($sCount > 0) {
$this->ajaxReturn(['status' =>0 ,'msg'=>'已有付款成功的子单,无法转线下','data'=>[]]);
}
//删除打款
$PayStatementDB->where($sWhere)->delete();
//修改自身
$res = M("company_statement_info","tab_")->where("id = {$id}")->save(['verify_status' => 2, 'pay_check' => 0, 'pay_check_member_id' => 0, 'pay_check_time' => 0]);
if(empty($res)){
$this->ajaxReturn(['status' =>0 ,'msg'=>'转换失败','data'=>[]]);
}
$this->ajaxReturn(['status' =>1 ,'msg'=>'成功转为线下确认','data'=>[]]);
}
//导出
public function export() {

@ -281,7 +281,7 @@
</if>
<if condition="$data['pay_status'] neq 1">
<a class='confirm changeCompanyInfo' data-id="{$data['id']}">支付信息更新</a>
<a class='confirm changeCompanyInfo' data-id="{$data['id']}">转线下支付</a>
<a class='confirm changePayTapy' data-id="{$data['id']}">转线下支付</a>
</if>
<!-- <if condition="$data['pay_check'] eq 0">-->
<!-- <a class='confirm setPayment' data-id='{$data.id}'>打款信息确认</a>-->
@ -517,7 +517,6 @@
ChangePayInfo.remove();
layer.msg("<font style='color: white'>"+rep.msg+"</font>");
}
console.log(data);
})
}
,doChangeCompanyInfo(){
@ -581,10 +580,31 @@
$("body").append(iframeExcel);
}
});
//修改公司信息
$(".changeCompanyInfo").on("click",function() {
const id = $(this).data('id');
ChangePayInfo.dataInit(id);
})
//线上转线下
$(".changePayTapy").on("click",function() {
const id = $(this).data('id');
//执行
layer.confirm('是否确定直接转为线下打款?转为线下打款后,该打款单将从线上打款移出转入“管理后台>财务>线下打款确认”中。如需回退需要进行重算,请慎重操作,是否确定?', {}, function(index){
var url = "{:U('setStatementPayTapy')}";
$.post(url,{id:id},function(rep){
if(rep.status == 1){
layer.msg("<font style='color: white'>"+rep.msg+"</font>",{time:1000},function(){
window.location.reload();
});
}else{
layer.msg("<font style='color: white'>"+rep.msg+"</font>");
}
})
},function(index) {
layer.close(index);
});
})
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){

Loading…
Cancel
Save