|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
<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="__STATIC__/jquery.form.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>
|
|
|
|
@ -95,7 +96,7 @@
|
|
|
|
|
|
|
|
|
|
<div class="data_list box_mt" style="margin-top: 10px;">
|
|
|
|
|
<div class="">
|
|
|
|
|
<form id="form" action="{:U('editCompanyStatementPool')}" method="post" class="form-horizontal">
|
|
|
|
|
<form id="form" method="post" class="form-horizontal" action="{:U('editCompanyStatementPool')}" enctype="multipart/form-data" target="rfFrame">
|
|
|
|
|
<table id="exporttable">
|
|
|
|
|
<!-- 表头 -->
|
|
|
|
|
<thead>
|
|
|
|
@ -144,7 +145,7 @@
|
|
|
|
|
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.account}</td> -->
|
|
|
|
|
|
|
|
|
|
<notempty name="com['statement_info']">
|
|
|
|
|
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['account']}</td>
|
|
|
|
|
<td rowspan="{$com['statement_info'][0]['row']}" >{$com['statement_info'][0]['account']}</td>
|
|
|
|
|
<else />
|
|
|
|
|
<td>-</td>
|
|
|
|
|
</notempty>
|
|
|
|
@ -160,14 +161,15 @@
|
|
|
|
|
<td>{$com['statement_info'][0]['game_list'][0]['game_type_name']}</td>
|
|
|
|
|
<td>{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}-{$com['statement_info'][0]['game_list'][0]['statement_end_time']}</td>
|
|
|
|
|
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
|
|
|
|
|
<td><input class="refund" value="0" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" name="ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><span class="sum_money_span">{$com['statement_info'][0]['game_list'][0]['sum_money']}</span>
|
|
|
|
|
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['sum_money']}" style="width: 20px;display: none"></td>
|
|
|
|
|
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['sum_money']}" style="width: 20px;display: none">
|
|
|
|
|
<input class="st" name="st[{$com['id']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
|
|
|
|
|
<td rowspan="{$com.row}">{$com['reward']}</td>
|
|
|
|
|
<td rowspan="{$com.row}">{$com['fine']}</td>
|
|
|
|
|
<td rowspan="{$com.row}">{$com['statement_money']}</td>
|
|
|
|
|
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
|
|
|
|
|
|
|
|
|
|
<else />
|
|
|
|
|
<td>-</td>
|
|
|
|
@ -196,7 +198,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<td rowspan="{$com.row}"><if condition="$com['is_payment'] eq 1">是 <else /> 否 </if></td>
|
|
|
|
|
<td rowspan="{$com.row}"><if condition="$com['st'] eq 0">否 <else /> 是 </if></td>
|
|
|
|
|
<td rowspan="{$com.row}">{$com.remark}</td>
|
|
|
|
|
<td rowspan="{$com.row}"><textarea name="remark[{$com['id']}]">{$com.remark}</textarea></td>
|
|
|
|
|
|
|
|
|
|
<if condition="!$is_export">
|
|
|
|
|
<td rowspan="{$com.row}">
|
|
|
|
@ -216,9 +218,9 @@
|
|
|
|
|
<td>{$game['game_type_name']}</td>
|
|
|
|
|
<td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>
|
|
|
|
|
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
|
|
|
|
|
<td><input class="refund" value="0" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" name="ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="0" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none"></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
@ -232,7 +234,7 @@
|
|
|
|
|
<foreach name="com['statement_info']" item="account" key="akey">
|
|
|
|
|
<if condition="$akey gt 0">
|
|
|
|
|
<tr>
|
|
|
|
|
<td rowspan="{$account['row']}">{$account['account']}</td>
|
|
|
|
|
<td rowspan="{$account['row']}" class="accounts">{$account['account']}</td>
|
|
|
|
|
|
|
|
|
|
<notempty name="account['game_list']">
|
|
|
|
|
<td>{$account['game_list'][0]['game_name']}</td>
|
|
|
|
@ -241,9 +243,9 @@
|
|
|
|
|
<td><span class="pay_amount">{$account['game_list'][0]['pay_amount']}</span></td>
|
|
|
|
|
<!-- <td>{$account['game_list'][0]['ratio']|showNumPercent}</td>-->
|
|
|
|
|
<!-- <td>{$account['game_list'][0]['increment_ratio']|showNumPercent}</td>-->
|
|
|
|
|
<td><input class="refund" value="0" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" name="ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="0" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['sum_money']}" style="width: 20px;display: none"></td>
|
|
|
|
|
|
|
|
|
|
<else />
|
|
|
|
@ -267,9 +269,9 @@
|
|
|
|
|
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
|
|
|
|
|
<!-- <td>{$game['ratio']|showNumPercent}</td>-->
|
|
|
|
|
<!-- <td>{$game['increment_ratio']|showNumPercent}</td>-->
|
|
|
|
|
<td><input class="refund" value="0" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" name="ratio[{$com['id']}][{$account['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="0" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
|
|
|
|
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
|
|
|
|
|
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none"></td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
@ -284,14 +286,14 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan=10 >合计:</td>
|
|
|
|
|
<td>{$count.platform_amount}</td>
|
|
|
|
|
<td >{$count.platform_amount}</td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td>{$count.sum_money}</td>
|
|
|
|
|
<td class="count_sum_money">{$count.sum_money}</td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
<td></td>
|
|
|
|
@ -304,13 +306,16 @@
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<div class="form-item cf" style="float: right;margin-top: 30px;margin-right: 30px;">
|
|
|
|
|
<input type="hidden" name="id" value="{$_GET['id']}">
|
|
|
|
|
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="hidden" name="id" value="{$_GET['id']}">
|
|
|
|
|
</form>
|
|
|
|
|
<div class="form-item cf" style="float: right;margin-top: 30px;margin-right: 30px;">
|
|
|
|
|
|
|
|
|
|
<button class="submit_btn" id="submit" style="margin-left:210px;">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<iframe id="rfFrame" name="rfFrame" src="about:blank" style="display:none;"></iframe>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
@ -344,25 +349,64 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
var return_data = "";
|
|
|
|
|
$("#submit").click(function(){
|
|
|
|
|
var options = {
|
|
|
|
|
url:"{:U('editCompanyStatementPool')}", //同action
|
|
|
|
|
type:'post',
|
|
|
|
|
beforeSend:function(xhr){
|
|
|
|
|
},
|
|
|
|
|
success:function(data)
|
|
|
|
|
{
|
|
|
|
|
return_data = data;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
complete:function(data){
|
|
|
|
|
|
|
|
|
|
if(return_data.status==1){
|
|
|
|
|
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
parent.location.reload();
|
|
|
|
|
},1500);
|
|
|
|
|
}else{
|
|
|
|
|
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error: function(xhr,status,msg){
|
|
|
|
|
//alert("状态码"+status+"; "+msg)
|
|
|
|
|
layer.msg('玩命加载中..');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$("#form").ajaxSubmit(options);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".refund").on("blur",function () {
|
|
|
|
|
caculate_sum_money(this);
|
|
|
|
|
changeStatementAmount(this);
|
|
|
|
|
changeSumAmount();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".ratio").on("blur",function () {
|
|
|
|
|
caculate_sum_money(this);
|
|
|
|
|
changeStatementAmount(this);
|
|
|
|
|
changeSumAmount();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".increment_ratio").on("blur",function () {
|
|
|
|
|
caculate_sum_money(this);
|
|
|
|
|
changeStatementAmount(this);
|
|
|
|
|
changeSumAmount();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 分成结算金额重算
|
|
|
|
|
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);
|
|
|
|
@ -370,13 +414,13 @@
|
|
|
|
|
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;
|
|
|
|
@ -386,13 +430,56 @@
|
|
|
|
|
$(_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));
|
|
|
|
|
}
|
|
|
|
|
//结算金额重算
|
|
|
|
|
function changeStatementAmount(_this) {
|
|
|
|
|
|
|
|
|
|
var _parent = $(_this).parent().parent();
|
|
|
|
|
var statement_amount = '';
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
statement_amount = _parent.find(".statement_money").text();
|
|
|
|
|
if (!statement_amount ) {
|
|
|
|
|
_parent = _parent.prev();
|
|
|
|
|
} else {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var row = _parent.find(".statement_money").attr("rowspan");
|
|
|
|
|
var get_item = _parent;
|
|
|
|
|
var sum_amount = 0;
|
|
|
|
|
|
|
|
|
|
for (var i =0;i<parseInt(row);i++) {
|
|
|
|
|
|
|
|
|
|
var amount = get_item.find(".sum_money_span").text();
|
|
|
|
|
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
|
|
|
|
|
get_item = get_item.next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_parent.find(".statement_money").text(sum_amount);
|
|
|
|
|
}
|
|
|
|
|
//结算金额合计重算
|
|
|
|
|
function changeSumAmount() {
|
|
|
|
|
|
|
|
|
|
var sum_amount = 0;
|
|
|
|
|
var st = 0;
|
|
|
|
|
|
|
|
|
|
$("#statementShow").find(".statement_money").each(function (key,val) {
|
|
|
|
|
st = $(val).data('st')
|
|
|
|
|
|
|
|
|
|
sum_amount = parseFloat(sum_amount) + parseFloat($(val).text());
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".count_sum_money").text(sum_amount.toFixed(2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</html>
|
|
|
|
|