You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/finance/receipt-lirun.php

289 lines
15 KiB

<?php
use \common\libs\MyLib;
?>
<script src="/Myfile/lib/layui/layui.js"></script>
<link rel="stylesheet" href="/js/fileupload/css/jquery.fileupload.css">
<table lay-size="sm" class="layui-table ">
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
保险类型
<select name="insurer_type" class="insurer_type">
<option value=0>全部</option>
<option value=1 <?= $insurer_type==1?'selected':'' ?>>商业</option>
<option value=2 <?= $insurer_type==2?'selected':'' ?>>交强</option>
</select>
保单号:<input name="insurer_no" type="text" value="<?=$insurer_no?>">
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
工号:<input name="username" type="text" value="<?=$username?>">&nbsp;&nbsp;
<!--日期-->
出单日期:
<input type="Text" class="Wdate" name="begin_date" onclick="WdatePicker()" value="<?= $begin_date ?>" />
--
<input type="Text" class="Wdate" name="end_date" onclick="WdatePicker()" value="<?= $end_date ?>" />
<br>
<br>
回单日期:
<input type="Text" class="Wdate" name="r_begin_date" onclick="WdatePicker()" value="<?= $r_begin_date ?>" />
--
<input type="Text" class="Wdate" name="r_end_date" onclick="WdatePicker()" value="<?= $r_end_date ?>" />
<br>保险公司:<select name="company_id">
<option value="0">所有模型</option>
<?php
foreach($company_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
级别:<select name="group_id">
<option value="0">全部</option>
<?php
foreach($group_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $group_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
排序:
<select name="sort_key">
<option value="0">请选择</option>
<option value="print_date" <?= $sort_key == 'print_date' ? 'selected' : ''?>>出单日期</option>
<option value="total" <?= $sort_key == 'total' ? 'selected' : ''?>>商业总保费</option>
<option value="total_clear" <?= $sort_key == 'total_clear' ? 'selected' : ''?>>商业净保费</option>
<option value="total_rate" <?= $sort_key == 'total_rate' ? 'selected' : ''?>>手续费比例</option>
</select>
<select name="sort_value">
<option value="0">请选择</option>
<option value="ASC" <?= $sort_value == 'ASC' ? 'selected' : ''?>>正序</option>
<option value="DESC" <?= $sort_value == 'DESC' ? 'selected' : ''?>>倒序</option>
</select>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
<!-- <input type="button" class="act_btn" id="output-btn" name="output-btn" value="导出">-->
</td>
</tr>
</form>
</table>
<table width="100%" class="layui-elip layui-table" lay-filter="demo">
<thead>
<tr>
<th width="24" align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username1',width:30}">序号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username2'}">车牌号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username4'}">保险公司</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username5'}">工号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username6'}">级别</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username10',width:110}">保单号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username11'}">提单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username12'}">出单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username13'}">保险类型</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username14'}">商业总保费</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username15'}">商业净保费</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username16'}">手续费比例</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username17'}">补点比例</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username18'}">应得金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username19'}">实得金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username20'}">回款金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username22'}">补点金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username23'}">回款补点</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username24'}">减免金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username25'}">礼品礼券</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username26'}">工资</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username28'}">利润</th>
</tr>
</thead>
<tbody>
<?php
foreach($items as $index => $item) {
$start_index = ($page-1)*20+$index;
$order = $item->order;
$users=$item->user->group;
$username=$item->user;
$uname=$username['name'];
$nams=$users['name'];
$total_real = $item->total * $item->total_rate/100;
$total_clear_real = $item->total_clear * $item->total_rate/100;
$total_dis = round($total_clear_real - $item->r_total,2);
$order_info = $item->order;
$total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0;
$gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0;
$ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0;
$gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0;
// $bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0;
$bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0;
$r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0;
$liwu = $ticket + $gift;
$lirun = $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu;
?>
<tr style="height:24px;" onMouseOver="overColor(this)" onMouseOut="outColor(this)">
<td align="center" class="td_bg" style="font-size:12px;" ><?=$start_index+1?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->car_no?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order && $order->company ? $order->company->name:''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->user->username?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$uname?>-<?=$nams?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->insurer_no?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order ? $order->submit_date : ''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$order ? $order->print_date : ''?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->insurer_type==1?'商业':'交强'?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total_clear?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->total_rate?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->budian_rate?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$total_real)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$total_clear_real)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$item->r_total?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$bu_dian)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=sprintf("%.2f",$r_bu_dian)?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$total1_dis?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$liwu?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$gongzi?></td>
<td align="center" class="td_bg" style="font-size:12px;" ><?=$lirun?></td>
</tr>
<?php
}
?>
<tr>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_total,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_total_clear,2)?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=number_format($sum_r_total,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($bu_dian_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($r_bu_dian_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($total1_dis_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($liwu_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($gongzi_all,2)?></td>
<td align="center" class="td_bg" nowrap><?=number_format($lirun_all,2)?></td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td height="25" colspan="20" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</tbody>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" language="javascript" src="/js/fileupload/js/jquery.fileupload.js"></script>
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611">
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605">
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605">
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script>
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js?v=2019"></script><script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
var params = $('#searchForm').serialize();
window.location.href = '/finance/receipt-info?id=' + id + '&back_params=' + encodeURIComponent(params);
}
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var urlfile = $("#urlfile").val();
var import_type = $(".import_type").val();
if(urlfile == ''){
alert('请先选择文件!');
return false;
}
var last_url = '/finance/receipt-process';
var params = $("#theFrm").serialize();
$.post(last_url,params,function(obj){
alert(obj.msg);
if(obj.success){
$('#theFrm')[0].reset();
window.location.reload();
}
},'json');
}
});
//搜索
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/finance/receipt-lirun?" + params;
});
//导出
$("#output-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
//window.location.href = "/finance/receipt-output?" + params;
var url = "/finance/receipt-output";
$.get(url,params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.href = obj.files[0].src;
}
},'json');
});
})
</script>
<style>
input[type="text"] {
width: 134px;
}
</style>
<script>
console.log(layui)
layui.use('table',function(){
var table = layui.table;
var $ = layui.$;
//转换静态表格
table.init('demo', {
limit: 100
});
$('.layui-table-cell').css('padding','0')
$('td').css('padding','0')
})
</script>