提交 dc56a389 authored 作者: chengye's avatar chengye

兼容普通表与峰谷表单价

上级 a250b350
......@@ -29,7 +29,6 @@ class Payment
Log::record(date('Y-m-d H:i:s').' OA单号:'.$data['numb'].' 接口操作:单据状态更新');
return $this->update($data['numb'],$data['status'],$data['mes']);
} else {
Log::record(date('Y-m-d H:i:s').' OA单号:'.$data['numb'].' 接口操作:单据状态作废');
return $this->dropNumb($data['numb']);
}
}
......@@ -47,14 +46,9 @@ class Payment
$payment->status = $status;
$payment->pay_date = time();
$payment->save();
$res = (new WriteOff())->writeOffFromPayment($payment->account_id, $payment->payment_id);
Log::record(date('Y-m-d H:i:s').' OA单号:'.$numb . $res);
return json([
'code' => 200,
'message' => $mes ?: '已成功付款',
'data' => $res
]);
}
//作废单据
......@@ -78,12 +72,8 @@ class Payment
//删除payment_invoice表
$delNum = (new EmPaymentInvoice())->where('payment_id', '=', $payment->payment_id)->delete();
Log::record(date('Y-m-d H:i:s').' OA单号:'.$numb. '缴费单已作废');
return json([
'code' => 200,
'message' => '缴费单已作废',
'data' => $delNum
]);
}
private function checkKey($key)
......
......@@ -76,7 +76,7 @@
<form class="layui-form">
<input type="hidden" name="em_id" value="{$em.id}">
<input type="hidden" name="charge_type" value="{$em.rule.charge_type}">
<input type="hidden" name="pricing_type" value="{$em.rule.pricing_type}">
<input type="hidden" name="pricing_type" id="pricing_type" value="{$em.rule.pricing_type}">
<div class="layui-form-box">
<div class="layui-form-head">
<div class="layui-form-item">
......@@ -318,29 +318,35 @@
var $baseNum = $level*$rate;
var $rNum = $(this).val()*$baseNum - $('#last_numb').val()*$baseNum;
var $amount = $('#amount').val();
if($rNum < 0){
layMsg('本次抄表必须大于上次抄表读数',5);
$('#current_numb').focus();
} else{
var $num = $rNum/$level;
$('#repo_numb').val( $num )
return;
}
var $num = $rNum/$level;
$('#repo_numb').val($num);
if($('#pricing_type').val() == 2){
var $amount = $('#amount').val();
if($amount != '' || $amount != 0){
var $price = $amount / $num;
$('#price').val($price.toFixed(4))
}
}
})
});
$('#amount').change(function(){
if($('#repo_numb').val() == '') {
$('#amount').val('');
layMsg('请先填写本次度数',5);
return;
if($('#pricing_type').val() == 2){
if($('#repo_numb').val() == '') {
$('#amount').val('');
layMsg('请先填写本次度数',5);
return;
}
var $price = $('#amount').val() / $('#repo_numb').val();
$('#price').val($price.toFixed(4))
}
var $price = $('#amount').val() / $('#repo_numb').val();
$('#price').val($price.toFixed(4))
})
});
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论