Merge branch 'master' of 47.111.118.107:wmtx/platform into feature/game_change_statement_20201125
commit
9803de1edb
@ -0,0 +1,563 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<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>
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
|
||||
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
<script src="__STATIC__/table2excel.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 10px 150px 10px;
|
||||
/* width: 960px; */
|
||||
margin: auto;
|
||||
}
|
||||
/* .tabcon1711 table{
|
||||
width: 480px;
|
||||
} */
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
tr{
|
||||
border-bottom: dotted 1px #c7c7c7;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;
|
||||
height: 35px;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 35px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.select2-results__option[aria-selected] {
|
||||
font-size: 12px;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
#statementShow td{
|
||||
line-height: 1.5;
|
||||
padding: 8px 0;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
海南万盟天下科技有限公司
|
||||
</div> -->
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div class="">
|
||||
<form id="form" method="post" class="form-horizontal" action="{:U('editCompanyStatementPool')}" enctype="multipart/form-data" target="rfFrame">
|
||||
<table id="exporttable">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>下游名称</th>
|
||||
<!-- <th>结算时间</th>-->
|
||||
<th>会长账号</th>
|
||||
|
||||
<th>内外团</th>
|
||||
<th>开发类型</th>
|
||||
|
||||
<th>市场专员</th>
|
||||
<th>下游性质</th>
|
||||
<th>产品</th>
|
||||
<th>产品类型</th>
|
||||
<th>结算时间</th>
|
||||
<th>推广流水</th>
|
||||
<th>退款</th>
|
||||
<th>分成比例</th>
|
||||
<th>补点</th>
|
||||
<th>分成结算金额</th>
|
||||
<th>奖励</th>
|
||||
<th>罚款</th>
|
||||
<th>其他扣款</th>
|
||||
<th>周结算金额</th>
|
||||
<th>结算金额</th>
|
||||
|
||||
<th>户名</th>
|
||||
<th>帐号</th>
|
||||
<th>开户行</th>
|
||||
<th>是否支付宝打款</th>
|
||||
<th>是否结算</th>
|
||||
<th>备注</th>
|
||||
|
||||
<if condition="!$is_export">
|
||||
<th>操作</th>
|
||||
</if>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="statementShow">
|
||||
|
||||
<foreach name="data" item="com">
|
||||
<tr>
|
||||
<td rowspan="{$com.row}">{$key-0+1}</td>
|
||||
<td rowspan="{$com.row}">{$com.company_name}</td>
|
||||
|
||||
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.account}</td> -->
|
||||
|
||||
<notempty name="com['statement_info']">
|
||||
<!-- <td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['time']}</td>-->
|
||||
<td rowspan="{$com['statement_info'][0]['row']}" >{$com['statement_info'][0]['account']}</td>
|
||||
<else />
|
||||
<td>-</td>
|
||||
</notempty>
|
||||
|
||||
<td rowspan="{$com.row}">{$com.company_info.company_belong_str}</td>
|
||||
<td rowspan="{$com.row}">{$com.company_info.company_relation_str}</td>
|
||||
|
||||
<td rowspan="{$com.row}">{$com.company_info.nickname}</td>
|
||||
<td rowspan="{$com.row}">{$com.company_info.company_type_str}</td>
|
||||
|
||||
<notempty name="com['statement_info'][0]['game_list']">
|
||||
<td>{$com['statement_info'][0]['game_list'][0]['game_name']}</td>
|
||||
<td>{$com['statement_info'][0]['game_list'][0]['game_type_name']}</td>
|
||||
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['time']}</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>
|
||||
{$com['statement_info'][0]['game_list'][0]['refund']|default=0}
|
||||
<!-- <input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]">-->
|
||||
</td>
|
||||
<td>{$com['statement_info'][0]['game_list'][0]['ratio']}%</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">
|
||||
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['account']}]" 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['statement_info'][0]['time_row']}">
|
||||
{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}
|
||||
<!-- <input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][]">-->
|
||||
</td>
|
||||
<td rowspan="{$com['statement_info'][0]['time_row']}" class="week_amount">{$com['statement_info'][0]['week_amount']}</td>
|
||||
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
|
||||
|
||||
<else />
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td rowspan="{$com.row}">-</td>
|
||||
<td rowspan="{$com.row}">-</td>
|
||||
<td rowspan="{$com.row}">-</td>
|
||||
|
||||
</notempty>
|
||||
|
||||
<if condition="$com['is_payment'] eq 2">
|
||||
<td rowspan="{$com.row}">{$com.company_info.payee_name}</td>
|
||||
<td rowspan="{$com.row}"> {$com.company_info.bank_account}</td>
|
||||
<td rowspan="{$com.row}">{$com.company_info.opening_bank}</td>
|
||||
</if>
|
||||
|
||||
<if condition="$com['is_payment'] eq 1">
|
||||
<td rowspan="{$com.row}">{$com.company_info.ali_user}</td>
|
||||
<td rowspan="{$com.row}">{$com.company_info.ali_account}</td>
|
||||
<td rowspan="{$com.row}"></td>
|
||||
</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}"><textarea name="remark[{$com['id']}]">{$com.remark}</textarea></td>
|
||||
|
||||
<if condition="!$is_export">
|
||||
<td rowspan="{$com.row}">
|
||||
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
|
||||
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
|
||||
</if>
|
||||
</td>
|
||||
</if>
|
||||
|
||||
</tr>
|
||||
|
||||
<if condition="$com['statement_info'][0]['row'] gt 1">
|
||||
<foreach name="com['statement_info'][0]['game_list']" item="game" key="gamekey">
|
||||
<if condition="$gamekey gt 0">
|
||||
<tr>
|
||||
<td>{$game['game_name']}</td>
|
||||
<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" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
|
||||
<td>{$game['ratio']}%</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>
|
||||
<!-- <td><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>-->
|
||||
|
||||
</tr>
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<notempty name="com['statement_info'][1]">
|
||||
|
||||
<foreach name="com['statement_info']" item="account" key="akey">
|
||||
<if condition="$akey gt 0">
|
||||
<tr>
|
||||
|
||||
<td rowspan="{$account['row']}" class="accounts">{$account['account']}</td>
|
||||
|
||||
<notempty name="account['game_list']">
|
||||
<td>{$account['game_list'][0]['game_name']}</td>
|
||||
<td>{$account['game_list'][0]['game_type_name']}</td>
|
||||
<notempty name="account['time']">
|
||||
<td rowspan="{$account['time_row']}">{$account['time']}</td>
|
||||
</notempty>
|
||||
<!-- <td>{$account['game_list'][0]['statement_begin_time']}-{$account['game_list'][0]['statement_end_time']}</td>-->
|
||||
<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" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
||||
<td>{$account['game_list'][0]['ratio']}%</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>
|
||||
<notempty name="account['time']">
|
||||
<td rowspan="{$account['time_row']}"><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]"></td>
|
||||
<td rowspan="{$account['time_row']}" class="week_amount">{$account['week_amount']}</td>
|
||||
</notempty>
|
||||
<else />
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</notempty>
|
||||
</tr>
|
||||
|
||||
<if condition="$account['row'] gt 1">
|
||||
<foreach name="account['game_list']" item="game" key="gamekey">
|
||||
<if condition="$gamekey gt 0">
|
||||
<tr>
|
||||
<td>{$game['game_name']}</td>
|
||||
<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>{$game['ratio']|showNumPercent}</td>-->
|
||||
<!-- <td>{$game['increment_ratio']|showNumPercent}</td>-->
|
||||
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
|
||||
<td>{$game['ratio']}%</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>
|
||||
<!-- <td><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][]"></td>-->
|
||||
|
||||
</tr>
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</if>
|
||||
</foreach>
|
||||
|
||||
</notempty>
|
||||
</foreach>
|
||||
<tr>
|
||||
<td colspan=10 >合计:</td>
|
||||
<td >{$count.platform_amount}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="count_sum_money">{$count.sum_money}</td>
|
||||
<td class="count_sum_money">{$count.sum_money}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<if condition="!$is_export">
|
||||
<td></td>
|
||||
</if>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
<script>
|
||||
<if condition="$is_export">
|
||||
$(function(){
|
||||
$("#exporttable").table2excel({
|
||||
filename: "{$title}.xls", // do include extension
|
||||
preserveColors: false // set to true if you want background colors and font colors preserved
|
||||
});
|
||||
});
|
||||
</if>
|
||||
$(".no_statement").on("click",function(){
|
||||
var id = $(this).data('id');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('cancelStatement')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg("<font style='color:white'>" + data.info + "</font>");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}else{
|
||||
layer.msg("<font style='color:white'>" + data.info + "</font>");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
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();
|
||||
});
|
||||
|
||||
$(".withhold").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);
|
||||
} 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);
|
||||
} else if(parseFloat(refund) > parseFloat(pay_money)) {
|
||||
refund = pay_money;
|
||||
$(_this).parent().parent().find(".refund").val(refund);
|
||||
}
|
||||
|
||||
//退款
|
||||
var withhold = $(_this).parent().parent().find(".withhold").val();
|
||||
if (!withhold || withhold < 0) {
|
||||
withhold = 0;
|
||||
$(_this).parent().parent().find(".withhold").val(withhold);
|
||||
} else if(parseFloat(withhold) > parseFloat(pay_money)) {
|
||||
withhold = pay_money;
|
||||
$(_this).parent().parent().find(".withhold").val(withhold);
|
||||
}
|
||||
|
||||
//补点
|
||||
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);
|
||||
}
|
||||
|
||||
var week_amount_find = $(_this).parent().parent();
|
||||
var old_amount = week_amount_find.find(".sum_money_span").text();
|
||||
|
||||
//扣款
|
||||
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));
|
||||
|
||||
var this_amount = week_amount_find.find(".sum_money_span").text();
|
||||
|
||||
var week_amount = 0;
|
||||
for (;;) {
|
||||
week_amount = week_amount_find.find(".week_amount").text();
|
||||
|
||||
if (week_amount) {
|
||||
break;
|
||||
} else {
|
||||
week_amount_find = week_amount_find.prev();
|
||||
}
|
||||
}
|
||||
|
||||
var D_value = parseFloat(old_amount)-parseFloat(this_amount) - parseFloat(withhold);
|
||||
|
||||
week_amount_find.find(".week_amount").text((parseFloat(week_amount)-D_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();
|
||||
}
|
||||
|
||||
// week_amount_find.find(".week_amount").text();
|
||||
|
||||
_parent.find(".statement_money").text(sum_amount.toFixed(2));
|
||||
|
||||
}
|
||||
//结算金额合计重算
|
||||
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>
|
@ -0,0 +1,129 @@
|
||||
function WmUploader(options) {
|
||||
this.randomNum = function(min, max){
|
||||
var range = max - min;
|
||||
var rand = Math.random();
|
||||
var num = min + Math.round(rand * range);
|
||||
return num;
|
||||
}
|
||||
|
||||
this.accept = options.accept == undefined ? {
|
||||
title: '图片',
|
||||
extensions: 'png,gif,jpg,jpeg,bmp',
|
||||
mimeTypes: 'image/*',
|
||||
} : options.accept
|
||||
|
||||
// fileType: img file
|
||||
this.fileType = options.fileType == undefined ? 'img' : options.fileType
|
||||
this.uploadKey = options.uniqueCode == undefined ? this.randomNum(10000, 99999) : options.uniqueCode
|
||||
this.uploadSelector = options.selector
|
||||
this.uploadUrl = options.url
|
||||
this.uploadWrapper = $(this.uploadSelector).parents('.upload-wrapper').eq(0);
|
||||
this.uploadList = this.uploadWrapper.find('.uploader-list');
|
||||
this.afterSuccess = options.afterSuccess
|
||||
this.afterDelete = options.afterDelete
|
||||
|
||||
var that = this
|
||||
|
||||
this.getFileId = function(file) {
|
||||
return file.id + '-' + that.uploadKey
|
||||
}
|
||||
|
||||
this.getFileTag = function(file) {
|
||||
return $('#' + that.getFileId(file))
|
||||
}
|
||||
|
||||
this.uploader = WebUploader.create({
|
||||
auto: true,
|
||||
swf: '/Public/static/webuploader/Uploader.swf',
|
||||
server: that.uploadUrl,
|
||||
pick: {
|
||||
id: that.uploadSelector,
|
||||
multiple: false
|
||||
},
|
||||
accept: that.accept,
|
||||
resize: false,
|
||||
disableGlobalDnd: true,
|
||||
fileNumLimit: 1,
|
||||
threads: 5,
|
||||
thumb: true,
|
||||
compress: false,
|
||||
prepareNextFile: true,
|
||||
formData: function(){ return $.extend(true, {}, {}); },
|
||||
chunked: false,
|
||||
duplicate: true
|
||||
});
|
||||
|
||||
this.uploader.on('fileQueued', function(file) {
|
||||
if (that.fileType == 'img') {
|
||||
var html = '';
|
||||
html += '<div id="' + that.getFileId(file) + '" class="item" style="margin-right: 10px;">';
|
||||
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
|
||||
html += '<h4 class="info">' + file.name + '</h4>';
|
||||
html += '<p class="state">等待上传...</p>';
|
||||
html += '</div>';
|
||||
|
||||
that.uploadList.append(html);
|
||||
that.uploadList.css('margin-top','10px');
|
||||
|
||||
var imgNode = that.uploadList.children(that.getFileTag(file)).find('img');
|
||||
that.uploader.makeThumb(file, function (error, src) {
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
imgNode.attr('src', src);
|
||||
}, 300, 300);
|
||||
} else {
|
||||
that.uploadList.append(
|
||||
'<div id="' + that.getFileId(file) + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
this.uploader.on('uploadProgress', function(file, percentage) {
|
||||
var $li = that.getFileTag(file),
|
||||
$percent = $li.find('.progress .progress-bar');
|
||||
// 避免重复创建
|
||||
if ( !$percent.length ) {
|
||||
$percent = $('<div class="progress progress-striped active">' +
|
||||
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
|
||||
'</div>' +
|
||||
'</div>').appendTo( $li ).find('.progress-bar');
|
||||
}
|
||||
$li.find('p.state').text('上传中');
|
||||
$percent.css('width', percentage * 100 + '%');
|
||||
$percent.text((percentage * 100).toFixed(0) + '%');
|
||||
});
|
||||
|
||||
this.uploader.on('uploadSuccess', function(file, response) {
|
||||
var fileTag = that.getFileTag(file)
|
||||
fileTag.find('p.state').text('已上传').fadeOut(800);
|
||||
fileTag.find('h4.info').append('<a href="javascript:;" class="file-delete table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
|
||||
fileTag.find('.file-delete').on('click', function() {
|
||||
$('#file_url').val('');
|
||||
that.uploader.removeFile(file.id);
|
||||
fileTag.remove();
|
||||
if (that.afterDelete != undefined) {
|
||||
that.afterDelete(file)
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if(!response.chunk) {
|
||||
var url = response.path + '/' + response.name;
|
||||
$('#file_url').val(url);
|
||||
}
|
||||
if (that.afterSuccess != undefined) {
|
||||
that.afterSuccess(file, response)
|
||||
}
|
||||
});
|
||||
|
||||
this.uploader.on('uploadError', function(file) {
|
||||
that.getFileTag(file).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
this.uploader.on('uploadComplete', function(file) {
|
||||
that.getFileTag(file).find('.progress').fadeOut();
|
||||
});
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace Think\Session\Driver;
|
||||
|
||||
use think\Exception;
|
||||
|
||||
class Redis implements \SessionHandlerInterface
|
||||
{
|
||||
/** @var \Redis */
|
||||
protected $handler = null;
|
||||
protected $config = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'password' => null,
|
||||
'select' => 1,
|
||||
'expire' => 3600,
|
||||
'timeout' => 0,
|
||||
'persistent' => true,
|
||||
'session_name' => 'session_',
|
||||
];
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$this->config['host'] = C("SESSION_REDIS_HOST") ? C("SESSION_REDIS_HOST") : $this->config['host'];
|
||||
$this->config['port'] = C("SESSION_REDIS_POST") ? C("SESSION_REDIS_POST") : $this->config['port'];
|
||||
$this->config['password'] = C("SESSION_REDIS_AUTH") ? C("SESSION_REDIS_AUTH") : $this->config['password'];
|
||||
$this->config['select'] = C("SESSION_REDIS_SELECT") ? C("SESSION_REDIS_SELECT") : $this->config['select'];
|
||||
$this->config['expire'] = C("SESSION_REDIS_EXPIRE") ? C("SESSION_REDIS_EXPIRE") : $this->config['expire'];
|
||||
$this->config['session_name'] = C('SESSION_PREFIX') ? C('SESSION_PREFIX') : $this->config['session_name'];
|
||||
$this->config['timeout'] = C('SESSION_CACHE_TIMEOUT') ? C('SESSION_CACHE_TIMEOUT') : $this->config['timeout'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开Session
|
||||
* @access public
|
||||
* @param string $savePath
|
||||
* @param mixed $sessName
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function open($savePath, $sessName)
|
||||
{
|
||||
// 检测php环境
|
||||
if (!extension_loaded('redis')) {
|
||||
throw new Exception('not support:redis');
|
||||
}
|
||||
$this->handler = new \Redis;
|
||||
// 建立连接
|
||||
$func = $this->config['persistent'] ? 'pconnect' : 'connect';
|
||||
$this->handler->$func($this->config['host'], $this->config['port'], $this->config['timeout']);
|
||||
if ('' != $this->config['password']) {
|
||||
$this->handler->auth($this->config['password']);
|
||||
}
|
||||
if (0 != $this->config['select']) {
|
||||
$this->handler->select($this->config['select']);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭Session
|
||||
* @access public
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
$this->gc(ini_get('session.gc_maxlifetime'));
|
||||
$this->handler->close();
|
||||
$this->handler = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取Session
|
||||
* @access public
|
||||
* @param string $sessID
|
||||
* @return string
|
||||
*/
|
||||
public function read($sessID)
|
||||
{
|
||||
return (string)$this->handler->get($this->config['session_name'] . $sessID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入Session
|
||||
* @access public
|
||||
* @param string $sessID
|
||||
* @param String $sessData
|
||||
* @return bool
|
||||
*/
|
||||
public function write($sessID, $sessData)
|
||||
{
|
||||
if ($this->config['expire'] > 0) {
|
||||
return $this->handler->setex($this->config['session_name'] . $sessID, $this->config['expire'], $sessData);
|
||||
} else {
|
||||
return $this->handler->set($this->config['session_name'] . $sessID, $sessData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Session
|
||||
* @access public
|
||||
* @param string $sessID
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy($sessID)
|
||||
{
|
||||
return $this->handler->delete($this->config['session_name'] . $sessID) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Session 垃圾回收
|
||||
* @access public
|
||||
* @param string $sessMaxLifeTime
|
||||
* @return bool
|
||||
*/
|
||||
public function gc($sessMaxLifeTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue