提交 7e452b24 authored 作者: chengye's avatar chengye

Merge branch 'test' of ssh://39.155.253.71:33222/PHP/Jz-Php into test

...@@ -159,26 +159,26 @@ class Payment extends Base ...@@ -159,26 +159,26 @@ class Payment extends Base
foreach ($invs as $inv){ foreach ($invs as $inv){
//未生成缴费或已挂起 //未生成缴费或已挂起
$amount += $inv->payment_balance; $amount += $inv->payment_balance;
if($inv->payment_amount >= $inv->payment_balance){ //是否已挂起
//是否已挂起 $epiModel = EmPaymentInvoice::field('payment_id')
$paymentField = EmPaymentInvoice::field('payment_id') ->where('invoice_id','=',$inv->invoice_id)
->where('invoice_id','=',$inv->invoice_id) ->order('create_time desc')->find();
->order('create_time desc')->find(); if($epiModel){
if($paymentField){ //找到关联的缴费单
//找到关联的缴费单 $payment = EmPayment::where('payment_id','=',$epiModel->payment_id)->find();
$payment = EmPayment::where('payment_id','=',$paymentField->payment_id)->find();
if(!$payment) return json(['status'=>0,'message'=>'单据:'.$epiModel->payment_id.'出现异常,单据与账单关系存在,但缴费单不存在!']);
//如果缴费单并未缴费 //如果缴费单并未缴费
if($payment->amount == 0){ if($payment->amount == 0){
$message = '账单号: '.$inv->invoice_id.' 已经挂起,无法生成缴费单'; $message = '账单号: '.$inv->invoice_id.' 已经挂起,无法生成缴费单';
return json(['status'=>0,'message'=>$message]); return json(['status'=>0,'message'=>$message]);
} else {
$idsArr[] = $inv->invoice_id;
}
} else { } else {
$idsArr[] = $inv->invoice_id; $idsArr[] = $inv->invoice_id;
} }
} else {
$idsArr[] = $inv->invoice_id;
} }
} }
$ids = $idsArr; $ids = $idsArr;
...@@ -198,13 +198,14 @@ class Payment extends Base ...@@ -198,13 +198,14 @@ class Payment extends Base
throw new Exception('保存账单与缴费关联数据失败'); throw new Exception('保存账单与缴费关联数据失败');
}; };
$account = (new EmAccount())->getIdByInvoiceID($paymentInvoiceArr[0]['invoice_id']);
//3.将账单数据汇总写入缴费表 //3.将账单数据汇总写入缴费表
$pData = []; $pData = [];
$pData['payment_id'] = $paymentId; $pData['payment_id'] = $paymentId;
$pData['status'] = 0; $pData['status'] = 1;
$pData['account_id'] = $account->account_id; $pData['account_id'] = '\\'; //占位符,表示空的无效的
$pData['em_id'] = '\\'; //占位符,表示空的无效的
$pData['payment_type'] = 1;
$pData['balance'] = $pData['amount'] = round($amount,2); $pData['balance'] = $pData['amount'] = round($amount,2);
if((new EmPayment())->save($pData)){ if((new EmPayment())->save($pData)){
......
...@@ -84,19 +84,7 @@ ...@@ -84,19 +84,7 @@
function () { function () {
$ = layui.jquery; $ = layui.jquery;
var form = layui.form, var form = layui.form,
layer = layui.layer, layer = layui.layer;
laydate = layui.laydate,
upload = layui.upload;
//消息提示
function layMsg(msg,type=6,time=1000){
layer.msg(msg,{
icon: type,
time: time,
});
}
//生成缴费单 //生成缴费单
form.on('submit(payment)', form.on('submit(payment)',
...@@ -108,14 +96,14 @@ ...@@ -108,14 +96,14 @@
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.status == 1) { if (data.status == 1) {
layer.msg(data.message,{icon: 6,time: 1000 },function(){ layer.msg(data.message,{icon: 6,time: 4000 },function(){
if(data.data){ if(data.data){
var url = "/payment" var url = "/payment"
window.location.href=url window.location.href=url
} }
}) })
} else { } else {
layer.msg(data.message,{icon: 5,time: 1000 }) layer.msg(data.message,{icon: 5,time: 4000 })
} }
} }
}); });
...@@ -132,11 +120,11 @@ ...@@ -132,11 +120,11 @@
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.status == 1) { if (data.status == 1) {
layer.msg(data.message,{icon: 6,time: 1000},function(){ layer.msg(data.message,{icon: 6,time: 4000},function(){
window.location.href='/settle'; window.location.href='/settle';
}) })
} else { } else {
layer.msg(data.message,{icon: 5,time: 1000 }) layer.msg(data.message,{icon: 5,time: 4000 })
} }
} }
}); });
......
...@@ -163,12 +163,11 @@ ...@@ -163,12 +163,11 @@
审核 审核
</button> </button>
{/if} {/if}
{if $fk.oafk_numb == '' && $payment.is_check == 1 && {if $fk.oafk_numb == '' && check_ele_permission('payment/payoa')}
check_ele_permission('payment/payoa')}
<button class="layui-btn" lay-filter="pay" lay-submit=""> <button class="layui-btn" lay-filter="pay" lay-submit="">
提交付款 提交付款
</button> </button>
{elseif check_ele_permission('payment/checkPayment')/} {elseif check_ele_permission('payment/checkPayment') && $payment.status == 0 /}
<button class="layui-btn" lay-filter="pass" lay-submit=""> <button class="layui-btn" lay-filter="pass" lay-submit="">
通过 通过
</button> </button>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论