From 4e9bde9c1080548d2b25cabd34a69eb99da36b2e Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 23 Sep 2020 09:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB=E7=BC=96=E8=BE=91=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementPoolController.class.php | 6 +- .../View/CompanyStatementPool/viewPuPool.html | 92 ++++++++++++++----- 2 files changed, 74 insertions(+), 24 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index a86fd9225..2fb1152c9 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -1108,7 +1108,7 @@ class CompanyStatementPoolController extends ThinkController $statement_data = M("company_statement_info","tab_")->where(['id'=>$key])->find(); $statement_info = json_decode($statement_data['statement_info'],true); - + dump($statement_info); foreach ($statement_info as $k => $v) { $game_list = $v['game_list']; @@ -1123,10 +1123,10 @@ class CompanyStatementPoolController extends ThinkController } } - +// dump($statement_info); $statement_info = json_encode($statement_info); -// M("company_statement_info","tab_")->where(['id'=>$key])->save(['statement_info'=>$statement_info]); + M("company_statement_info","tab_")->where(['id'=>$key])->save(['statement_info'=>$statement_info]); } diff --git a/Application/Admin/View/CompanyStatementPool/viewPuPool.html b/Application/Admin/View/CompanyStatementPool/viewPuPool.html index 04faee396..593a2aef1 100644 --- a/Application/Admin/View/CompanyStatementPool/viewPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewPuPool.html @@ -159,11 +159,11 @@ {$com['statement_info'][0]['game_list'][0]['game_name']} {$com['statement_info'][0]['game_list'][0]['game_type_name']} {$com['statement_info'][0]['game_list'][0]['statement_begin_time']}-{$com['statement_info'][0]['game_list'][0]['statement_end_time']} - {$com['statement_info'][0]['game_list'][0]['pay_amount']} - - % - % - {$com['statement_info'][0]['game_list'][0]['sum_money']} + {$com['statement_info'][0]['game_list'][0]['pay_amount']} + + % + % + {$com['statement_info'][0]['game_list'][0]['sum_money']} {$com['reward']} {$com['fine']} @@ -215,11 +215,11 @@ {$game['game_name']} {$game['game_type_name']} {$game['statement_begin_time']}-{$game['statement_end_time']} - {$game['pay_amount']} - - % - % - {$game['sum_money']} + {$game['pay_amount']} + + % + % + {$game['sum_money']} @@ -238,13 +238,13 @@ {$account['game_list'][0]['game_name']} {$account['game_list'][0]['game_type_name']} {$account['game_list'][0]['statement_begin_time']}-{$account['game_list'][0]['statement_end_time']} - {$account['game_list'][0]['pay_amount']} + {$account['game_list'][0]['pay_amount']} - - % - % - {$account['game_list'][0]['sum_money']} + + % + % + {$account['game_list'][0]['sum_money']} - @@ -264,13 +264,13 @@ {$game['game_name']} {$game['game_type_name']} {$game['statement_begin_time']}-{$game['statement_end_time']} - {$game['pay_amount']} + {$game['pay_amount']} - - % - % - {$game['sum_money']} + + % + % + {$game['sum_money']} @@ -343,6 +343,56 @@ } } }); - }) + }); + + $(".refund").on("blur",function () { + caculate_sum_money(this); + }); + + $(".ratio").on("blur",function () { + caculate_sum_money(this); + }); + + $(".increment_ratio").on("blur",function () { + caculate_sum_money(this); + }); + + function caculate_sum_money(_this) { + + var pay_money = $(_this).parent().parent().find(".pay_amount").text(); + + var ratio = $(_this).parent().parent().find(".ratio").val(); + + if (!ratio || ratio < 0) { + ratio = 0; + $(_this).parent().parent().find(".ratio").val(ratio); + } else if (ratio > 100) { + ratio = 100; + $(_this).parent().parent().find(".ratio").val(ratio); + } + + var refund = $(_this).parent().parent().find(".refund").val(); + if (!refund || refund < 0) { + refund = 0; + $(_this).parent().parent().find(".refund").val(refund); + } + + var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val(); + if (!increment_ratio || increment_ratio < 0) { + increment_ratio = 0; + $(_this).parent().parent().find(".increment_ratio").val(increment_ratio); + } else if(increment_ratio > 100) { + increment_ratio = 100; + $(_this).parent().parent().find(".increment_ratio").val(increment_ratio); + } + + pay_money = parseFloat(pay_money) - parseFloat(refund); + + var value = parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100); + + $(_this).parent().parent().find(".sum_money_span").text(value.toFixed(2)); + $(_this).parent().parent().find(".sum_money").val(value.toFixed(2)); + + }