工作量统计界面

dev
zhaocheng 5 years ago
parent c522e4a0f9
commit f0dc45f022
  1. 1
      frontend/views/layouts/blue-main.php
  2. 65
      frontend/views/statistics/work-info.bak.php
  3. 648
      frontend/views/statistics/work-info.php
  4. 108
      frontend/views/statistics/work.bak.php
  5. 301
      frontend/views/statistics/work.php
  6. 64
      frontend/web/assets/js/myfunc.js

@ -39,6 +39,7 @@ use yii\helpers\Html;
<!-- 自定义js --> <!-- 自定义js -->
<script src="/assets/js/content.js?v=1.0.0"></script> <script src="/assets/js/content.js?v=1.0.0"></script>
<!-- Bootstrap table --> <!-- Bootstrap table -->
<script src="/assets/js/myfunc.js"></script>
<?php if (isset($this->blocks['footer_js'])): ?> <?php if (isset($this->blocks['footer_js'])): ?>
<?= $this->blocks['footer_js'] ?> <?= $this->blocks['footer_js'] ?>
<?php endif; ?> <?php endif; ?>

@ -0,0 +1,65 @@
<?php
use \common\libs\MyLib;
?>
<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/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
$("#back-btn").click(function(){
window.location.href = "/statistics/work?date_begin=<?=$date_begin?>&date_end=<?=$date_end?>&date2_begin=<?=$date2_begin?>&date2_end=<?=$date2_end?>&username=<?=$username?>";
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
<input type="button" class="act_btn" id="back-btn" name="back-btn" value="返回">
提单日期: <?=$date_begin?><?=$date_end?>
正本日期: <?=$date2_begin?><?=$date2_end?>
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" class="bg_tr" nowrap>车主</td>
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td>
<td align="center" class="bg_tr" nowrap>商业总净保费</td>
<td align="center" class="bg_tr" nowrap>折扣后商业净保费</td>
<td align="center" class="bg_tr" nowrap>减免金额</td>
<td align="center" class="bg_tr" nowrap>商业折扣率</td>
<td align="center" class="bg_tr" nowrap>状态</td>
<td align="center" class="bg_tr" nowrap>详情</td>
</tr>
<?php
foreach($items as $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="left" class="td_bg" nowrap><?=$item->car_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_clear?></td>
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_real?></td>
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_dis?></td>
<td align="center" class="td_bg" nowrap><?=$item->total1_percent?></td>
<td align="center" class="td_bg" nowrap><?=$item->status->name?></td>
<td align="center" class="td_bg" nowrap>
[<a href="/insurer/info?id=<?=$item->id?>" target="_blank">详情</a>]
</td>
</tr>
<?php
}
?>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>汇总</td>
<td width="60" align="center" class="bg_tr" nowrap></td>
<td align="center" class="bg_tr" nowrap><?=$total[2]?'¥'.number_format($total[2],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$total[8]?'¥'.number_format($total[8],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$total[9]?'¥'.number_format($total[9],2):''?></td>
<td align="center" class="bg_tr" nowrap></td>
<td align="center" class="bg_tr" nowrap></td>
<td align="center" class="bg_tr" nowrap></td>
</tr>
</table>

@ -1,65 +1,591 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <style>
<script type="text/javascript" language="javascript" src="/js/func.js"></script> label.control-label {
<script type="text/javascript" language="javascript"> width: 120px;
$(function(){ }
$("#back-btn").click(function(){
window.location.href = "/statistics/work?date_begin=<?=$date_begin?>&date_end=<?=$date_end?>&date2_begin=<?=$date2_begin?>&date2_end=<?=$date2_end?>&username=<?=$username?>"; .form-inline .form-control {
width: 180px;
}
</style>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>保单信息</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')">
<i class="fa fa-plus"></i> 保单打印信息
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<div class="container">
<input type="hidden" name="id" value="" class="form-control car-info">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label>
<span class="car-info" data-name="car_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">厂牌型号</label>
<span class="car-info" data-name="factory_model"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label>
<span class="car-info" data-name="brand_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车系</label>
<span class="car-info" data-name="series_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">发动机号</label>
<span class="car-info" data-name="engine_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车架号</label>
<span class="car-info" data-name="car_frame_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">初登日期</label>
<span class="car-info" data-name="register_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">排量</label>
<span class="car-info" data-name="displacement_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车辆类型</label>
<span class="car-info" data-name="car_type_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">运营性质</label>
<span class="car-info" data-name="car_use_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">座位数</label>
<span class="car-info" data-name="seats"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">年份</label>
<span class="car-info" data-name="car_year"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车主</label>
<span class="car-info" data-name="car_man"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">联系电话</label>
<span class="car-info" data-name="phone"></span>
</div>
</div><hr>
<div class="container">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">业务分组</label>
<span class="order-info" data-name="business_group_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">被保险人</label>
<span class="order-info" data-name="id_man"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">证件号码</label>
<span class="order-info" data-name="id_man_number"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">联系人</label>
<span class="order-info" data-name="link_man"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">联系电话</label>
<span class="order-info" data-name="link_man_phone"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">送单日期</label>
<span class="order-info" data-name="send_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<span class="order-info" data-name="company_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">付款方式</label>
<span class="order-info" data-name="pay_type_txt"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">收款人</label>
<span class="order-info" data-name="payee_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业起保日期</label>
<span class="order-info" data-name="insurer1_begin_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强起保日期</label>
<span class="order-info" data-name="insurer2_begin_date"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">付款人</label>
<span class="order-info" data-name="payer_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">缴费单号</label>
<span class="order-info" data-name="pay_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业保单号</label>
<span class="order-info" data-name="insurer1_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强保单号</label>
<span class="order-info" data-name="insurer2_no"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">收款方式</label>
<span class="order-info" data-name="payment_name"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">送单地址</label>
<span class="order-info" data-name=""></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">备注</label>
<span class="order-info" data-name=""></span>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label class="control-label">正本送单地址</label>
<span class="order-info" data-name="receiver_addr_txt"></span>
</div>
</div><hr>
<div class="container">
<table id="insurer_type_table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="show_name">险种</th>
<th data-field="show_content">内容</th>
<th data-field="is_nopay_txt">不计免赔</th>
</tr>
</thead>
</table>
</div><hr>
<div class="container">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业总净保费</label>
<span class="order-info" data-name="total1_clear"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业含税总保费</label>
<span class="order-info" data-name="total1"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强总净保费</label>
<span class="order-info" data-name="total2_clear"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强含税总保费</label>
<span class="order-info" data-name="total2"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车船税</label>
<span class="order-info" data-name="total3"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">共计签单</label>
<span class="order-info" data-name="total_all"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">折扣后商业净保费</label>
<span class="order-info" data-name="total1_real"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">减免金额</label>
<span class="order-info" data-name="total1_dis"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业折扣率</label>
<span class="order-info" data-name="total1_percent"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">应收</label>
<span class="order-info" data-name="total_real"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">备注</label>
<span class="order-info" data-name="price_remark"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>保单文件信息</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" id="business_print_btn" href="javascript:void(0);" onclick="insurer_files_print('business')">
<i class="fa fa-search"></i> 查看商业保单并打印
</a>
<a class="btn btn-primary btn-xs edit-btn" id="compulsory_print_btn" href="javascript:void(0);" onclick="insurer_files_print('compulsory')">
<i class="fa fa-search"></i> 查看交强保单并打印
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<form method="get" class="form-horizontal">
<input type="hidden" name="id" class="form-control order-info">
<div class="form-group">
<label class="col-sm-4 control-label">商业保单文件</label>
<div class="col-sm-8">
<div class="input-group">
<input type="text" data-name="shangye_src" name="shangye_src" class="form-control order-info" value="">
<a href="javascript:void(0);" class="input-group-addon upload">
上传文件
</a>
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-4 control-label">交强保单文件</label>
<div class="col-sm-8">
<div class="input-group">
<input type="text" data-name="jiaoqiang_src" name="jiaoqiang_src" class="form-control order-info" value="">
<a href="javascript:void(0);" class="input-group-addon upload">
上传文件
</a>
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="text-center">
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="insurer_files_save()">
<i class="fa fa-save"></i> 保存
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>礼品信息</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-6">
<h4 class="title">免费礼品</h4>
<table id="free_gift_table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="group_name">组名</th>
<th data-field="gift_name">礼品名</th>
</tr>
</thead>
</table>
</div>
<div class="col-md-6">
<h4 class="title">自费礼品</h4>
<table id="private_gift_table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="group_name">组名</th>
<th data-field="gift_name">礼品名</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>财务信息</h5>
<div class="ibox-tools">
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">领款人</label>
<span class="order-insurer-info" data-name="money_man"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">开户行</label>
<span class="order-insurer-info" data-name="money_bank"></span>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label>
<span class="order-insurer-info" data-name="money_no"></span>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>操作记录</h5>
<div class="ibox-tools">
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="car_history_table">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="op_man">操作者</th>
<th data-field="op_time_txt">操作时间</th>
<th data-field="remark">操作内容</th>
</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<div class="ibox-tools">
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);"
onclick="reBack()">
<i class="fa fa-backward"></i> 退单
</a>
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-close"></i> 关闭
</a>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/assets/js/plugins/webuploader/webuploader.min.js"></script>
<script type="text/javascript" language="javascript">
var params = {};
$(function () {
layui.use(['upload'], function(){
var upload = layui.upload;
var uploadInst = upload.render({
elem: '.upload' /*绑定元素*/,
url: '/common/upload' /*上传接口*/,
accept: 'file',
done: function(res){
//上传完毕回调
if(res.status == 'SUCCESS') {
$('#file').val(res.fileUrl);
}
},
error: function(){
//请求异常回调
}
});
});
$('.input-date').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
// 获取数据,初始化
$.get('info-json' + window.location.search, function (obj) {
if (obj.code == 200) {
params = obj.data;
init();
} else {
alert('数据加载错误');
}
}, 'json');
$('#pdate').blur(function () {
var params = $("#appointmentFrm").serialize();
$.post('/appointment/count', params, function (obj) {
if (obj.success) {
$('#day_count').val(obj.count);
}
}, 'json');
});
$('#brand_info').change(function () {
var brand_id = $(this).val();
$('#series_info').html('<option value="0">---请选择---</option>');
$('#displacement_info').html('<option value="0">---请选择---</option>');
if (brand_id > 0) {
$.get('/car/series-fix', {brand_id: brand_id}, function (obj) {
if (obj.success) {
$('#series_info').html(obj.html);
}
}, 'json');
}
});
$('#series_info').change(function () {
var series_id = $(this).val();
$('#displacement_info').html('<option value="0">---请选择---</option>');
if (series_id > 0) {
$.get('/car/displacements-fix', {series_id: series_id}, function (obj) {
if (obj.success) {
$('#displacement_info').html(obj.html);
}
}, 'json');
}
});
}); });
});
</script> function init(){
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> console.log(params);
<form id="searchForm"> carInfoInit(params['car_info']);
<tr>
<td class="td_bg"> if(!params['order_info']['shangye_src']){
<input type="button" class="act_btn" id="back-btn" name="back-btn" value="返回"> $('#business_print_btn').hide();
提单日期: <?=$date_begin?><?=$date_end?> }
正本日期: <?=$date2_begin?><?=$date2_end?> if(!params['order_info']['jiaoqiang_src']){
</td> $('#compulsory_print_btn').hide();
</tr> }
</form> orderInfoInit(params['order_info']);
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> orderInsurerInfoInit(params['order_insurer_info']);
<tr>
<td width="50" align="center" class="bg_tr" nowrap>车主</td> var free_gift = [],
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td> private_gift = [];
<td align="center" class="bg_tr" nowrap>商业总净保费</td> $.each(params['gift_info'],function (i,d) {
<td align="center" class="bg_tr" nowrap>折扣后商业净保费</td> if(d['is_free'] == 1){
<td align="center" class="bg_tr" nowrap>减免金额</td> free_gift.push(d);
<td align="center" class="bg_tr" nowrap>商业折扣率</td> }else {
<td align="center" class="bg_tr" nowrap>状态</td> private_gift.push(d);
<td align="center" class="bg_tr" nowrap>详情</td> }
</tr> });
<?php var tables = {
foreach($items as $item) { 'insurer_type': params['insurer_type_info'],
?> 'free_gift': free_gift,
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> 'private_gift': private_gift,
<td align="left" class="td_bg" nowrap><?=$item->car_man?></td> 'car_history': {
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td> url: '/car/ajax-history-index-json',
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_clear?></td> queryParamsFunc: function (param) {
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_real?></td> param['car_id'] = params['car_info']['id'];
<td align="center" class="td_bg" nowrap><?='¥'.$item->total1_dis?></td> param['limit'] = param['limit'];
<td align="center" class="td_bg" nowrap><?=$item->total1_percent?></td> param['offset'] = param['offset'];
<td align="center" class="td_bg" nowrap><?=$item->status->name?></td> return param;
<td align="center" class="td_bg" nowrap> }
[<a href="/insurer/info?id=<?=$item->id?>" target="_blank">详情</a>] }
</td> };
</tr> tableInfoInit(tables, params);
<?php }
}
?> function insurer_files_print(type) {
<tr> if(type == 'compulsory' && params['order_info']['jiaoqiang_src']){
<td width="50" align="center" class="bg_tr" nowrap>汇总</td> window.open('/upload/files'+ params['order_info']['jiaoqiang_src'])
<td width="60" align="center" class="bg_tr" nowrap></td> }
<td align="center" class="bg_tr" nowrap><?=$total[2]?'¥'.number_format($total[2],2):''?></td> if(type == 'compulsory' && !params['order_info']['jiaoqiang_src']){
<td align="center" class="bg_tr" nowrap><?=$total[8]?'¥'.number_format($total[8],2):''?></td> alert('找不到文件,加载失败');
<td align="center" class="bg_tr" nowrap><?=$total[9]?'¥'.number_format($total[9],2):''?></td> }
<td align="center" class="bg_tr" nowrap></td> if(type == 'business' && params['order_info']['shangye_src']){
<td align="center" class="bg_tr" nowrap></td> window.open('/upload/files'+ params['order_info']['shangye_src'])
<td align="center" class="bg_tr" nowrap></td> }
</tr> if(type == 'business' && !params['order_info']['shangye_src']){
</table> alert('找不到文件,加载失败');
}
}
function insurer_files_save() {
var param = $(this).closest('form').serialize();
$.post('/insurer/pdf-save',param,function(obj){
console.log(obj);
if(obj.success) {
alert('保单上传成功');
window.location.reload();
}
},'json');
}
function reBack(){
if(confirm('请核对好出单日期,确认退回到正本?')) {
$.post('/insurer/tuidan-save',{id:params['order_info']['id']},function(obj){
if(obj.success) {
alert('退单成功');
}
},'json');
}
}
function goBack(){
window.close();
}
function tableInfoInit(tables){
$.each(tables,function(name,data){
var $table = $('#'+ name +'_table');
var options = {};
if(typeof data == 'String'){
options = {
url: data.url,
pagination: true,
sidePagination: 'server',
queryParams: data.queryParamsFunc
}
}else {
options = {
data: data
}
}
$table.bootstrapTable('destroy');
$table.bootstrapTable(options);
});
}
// 页面车辆数据初始化
function carInfoInit(data){
$('.car-info:not(input)').each(function(key,item) {
$(item).html(data[$(item).data('name')]);
});
$('.car-info:input').each(function(key,item) {
$(item).val(data[$(item).data('name')]);
});
}
function orderInfoInit(data){
$('.order-info:not(input)').each(function(key,item) {
$(item).html(data[$(item).data('name')]);
});
$('.order-info:input').each(function(key,item) {
$(item).val(data[$(item).data('name')]);
});
}
function orderInsurerInfoInit(data){
$('.order-insurer-info:not(input)').each(function(key,item) {
$(item).html(data[$(item).data('name')]);
});
$('.order-insurer-info:input').each(function(key,item) {
$(item).val(data[$(item).data('name')]);
});
}
function buttonInit(param) {
if(param){
$('#appointment_btn').prepend('<button type="button" class="btn btn-primary" onclick="cancelAppointment()">放弃</button>');
}
}
</script>
<?php $this->endBlock('footer_js'); ?>

@ -0,0 +1,108 @@
<?php
use \common\libs\MyLib;
?>
<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/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/statistics/work?" + params;
});
//导出
$("#output-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/statistics/work-output?" + params;
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
提单日期:从<input name="date_begin" type="text" value="<?=$date_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date_end" type="text" value="<?=$date_end?>" style="width:100px;" onclick="WdatePicker()">截止
正本日期:从<input name="date2_begin" type="text" value="<?=$date2_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date2_end" type="text" value="<?=$date2_end?>" style="width:100px;" onclick="WdatePicker()">截止
工号:<input name="username" type="text" value="<?=$username?>">
级别:<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="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>
<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="导出">
<a href="/statistics/work?date_begin=<?=date('Y-m-d')?>&date_end=<?=date('Y-m-d')?>">当天</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-7 day"))?>&date_end=<?=date('Y-m-d')?>">7天</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-1 month"))?>&date_end=<?=date('Y-m-d')?>">1个月</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-3 month"))?>&date_end=<?=date('Y-m-d')?>">3个月</a>&nbsp;&nbsp;
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" class="bg_tr" nowrap>工号</td>
<td width="60" align="center" class="bg_tr" nowrap>真实姓名</td>
<td width="80" align="center" class="bg_tr" nowrap>通时</td>
<td align="center" class="bg_tr" nowrap>提车总数</td>
<td align="center" class="bg_tr" nowrap>提单总数</td>
<td align="center" class="bg_tr" nowrap>商业总净保费</td>
<td align="center" class="bg_tr" nowrap>交强总净保费</td>
<td align="center" class="bg_tr" nowrap>商业已收净保费</td>
<td align="center" class="bg_tr" nowrap>交强已收净保费</td>
<td align="center" class="bg_tr" nowrap>总签单净保费</td>
<td align="center" class="bg_tr" nowrap>详情</td>
</tr>
<?php
foreach($user_rows as $row) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$row['username']?></td>
<td align="center" class="td_bg" nowrap><?=$row['truename']?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][0]!=''?$row['total'][0]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][7]>0?$row['total'][7]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][1]>0?$row['total'][1]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][2]>0?'¥'.number_format($row['total'][2],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][3]>0?'¥'.number_format($row['total'][3],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][4]>0?'¥'.number_format($row['total'][4],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][5]>0?'¥'.number_format($row['total'][5],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][6]>0?'¥'.number_format($row['total'][6],2):''?></td>
<td align="center" class="td_bg" nowrap>[<a href="/statistics/work-info?user_id=<?=$row['id']?>&date_begin=<?=$date_begin?>&date_end=<?=$date_end?>&date2_begin=<?=$date2_begin?>&date2_end=<?=$date2_end?>&username=<?=$username?>">详情</a>]</td>
</tr>
<?php
}
?>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>汇总</td>
<td width="60" align="center" class="bg_tr" nowrap></td>
<td width="60" align="center" class="bg_tr" nowrap></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[7]?$sum_total[7]:''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[1]?$sum_total[1]:''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[2]?'¥'.number_format($sum_total[2],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[3]?'¥'.number_format($sum_total[3],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[4]?'¥'.number_format($sum_total[4],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[5]?'¥'.number_format($sum_total[5],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[6]?'¥'.number_format($sum_total[6],2):''?></td>
<td align="center" class="bg_tr" nowrap></td>
</tr>
</table>

@ -1,108 +1,207 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <style>
<script type="text/javascript" language="javascript" src="/js/func.js"></script> .btn-group .btn-white.active{
<script type="text/javascript" language="javascript"> background: #1ab394;
$(function(){ color: #fff;
$("#search-btn").click(function(){ }
$('#page').val(0); </style>
var params = $('#searchForm').serialize(); <?php $this->endBlock(); ?>
window.location.href = "/statistics/work?" + params;
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>工作量统计</h5>
</div>
<div class="ibox-content">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker1">提单日期</label>
<div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="date_begin" name="date_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date_end" name="date_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker1">正本日期</label>
<div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="date2_begin" name="date2_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date2_end" name="date2_end" value="" autocomplete="off" />
</div>
</div>
<hr>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="username">工号</label>
<input type="text" id="username" name="username" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">级别</label>
<select name="group_id" id="group_info" class="form-control">
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<select name="company_id" id="company_info" class="form-control">
</select>
</div>
<hr>
<div class="form-group col-md-12 text-center" style="margin-bottom: 8px;">
<a class="btn btn-primary edit-btn m-r" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')">
<i class="fa fa-search"></i> 搜索
</a>
<a class="btn btn-primary edit-btn m-l" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')">
<i class="fa fa-outdent"></i> 导出
</a>
</div>
<div class="clearfix"></div>
</form>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>工作量统计</h5>
<div class="ibox-tools btn-group" id="date_ranges">
<button class="btn btn-white active" data-range="today" type="button">当天</button>
<button class="btn btn-white" data-range="week" type="button">近七天</button>
<button class="btn btn-white" data-range="month" type="button">近一月</button>
<button class="btn btn-white" data-range="third-month" type="button">近三月</button>
</div>
<div class="clearfix"></div>
</div>
<div class="ibox-content">
<div class="d-flex justify-content-between">
<div class="ibox">
<div class="ibox-content">
<h5>提车总数</h5>
<h1 class="no-margins summary-info" data-name="total_car">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>提单总数</h5>
<h1 class="no-margins summary-info" data-name="total_order">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>商业总净保费</h5>
<h1 class="no-margins summary-info" data-name="total_insurer_business">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>交强总净保费</h5>
<h1 class="no-margins summary-info" data-name="total_insurer_compulsory">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>商业已收净保费</h5>
<h1 class="no-margins summary-info" data-name="total_insurer_business_received">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>交强已收净保费</h5>
<h1 class="no-margins summary-info" data-name="total_insurer_compulsory_received">738,200</h1>
</div>
</div>
<div class="ibox">
<div class="ibox-content">
<h5>总签单净保费</h5>
<h1 class="no-margins summary-info" data-name="total_insurer">738,200</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="username">工号</th>
<th data-field="truename">真实姓名</th>
<th data-field="total_talk">通话时长</th>
<th data-field="total_car">提车总数</th>
<th data-field="total_order">提单总数</th>
<th data-field="total_insurer_business">商业总净保费</th>
<th data-field="total_insurer_compulsory">交强总净保费</th>
<th data-field="total_insurer_business_received">商业已收净保费</th>
<th data-field="total_insurer_compulsory_received">交强已收净保费</th>
<th data-field="total_insurer">总签单净保费</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>');
opStr.push('</a>');
return opStr.join(' ');
}
function info(id) {
layer_show('工作量信息','/insurer/info?id=' + id + '&' + $('#search').serialize(););
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/statistics/work-search-json",
pagination: true,
showFooter: true,
sidePagination: 'server',
queryParams: function(params) {
$('#search').find(':input:not(input[type=button],input[type=submit],button)').each(function(index,item){
params[$(item).attr('name')] = $(item).val();
});
params['range'] = $('#date_ranges.active').data('range');
return params;
},
responseHandler: function (res) {
console.log(res);
selectInfoInit('company',res['company_info']);
return res
}
}); });
//导出 return false;
$("#output-btn").click(function(){ }
$('#page').val(0);
var params = $('#searchForm').serialize(); // 品牌选项初始化
window.location.href = "/statistics/work-output?" + params; function selectInfoInit(selectName,options,default_val,data){
var html = '<option value="'+ (default_val?default_val:'') +'">---请选择---</option>';
$.each(options,function(i,item){
var val = item['code']?item['code']:item['id'];
var selected = data && data[selectName + '_id'] && data[selectName + '_id'] == val? 'selected': '';
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>'
}); });
$('#'+ selectName + '_info').html(html);
}
$(function() {
search();
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<tr>
<td class="td_bg">
提单日期:从<input name="date_begin" type="text" value="<?=$date_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date_end" type="text" value="<?=$date_end?>" style="width:100px;" onclick="WdatePicker()">截止
正本日期:从<input name="date2_begin" type="text" value="<?=$date2_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date2_end" type="text" value="<?=$date2_end?>" style="width:100px;" onclick="WdatePicker()">截止
工号:<input name="username" type="text" value="<?=$username?>">
级别:<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="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>
<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="导出">
<a href="/statistics/work?date_begin=<?=date('Y-m-d')?>&date_end=<?=date('Y-m-d')?>">当天</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-7 day"))?>&date_end=<?=date('Y-m-d')?>">7天</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-1 month"))?>&date_end=<?=date('Y-m-d')?>">1个月</a>&nbsp;&nbsp;
<a href="/statistics/work?date_begin=<?=date('Y-m-d',strtotime("-3 month"))?>&date_end=<?=date('Y-m-d')?>">3个月</a>&nbsp;&nbsp;
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" class="bg_tr" nowrap>工号</td>
<td width="60" align="center" class="bg_tr" nowrap>真实姓名</td>
<td width="80" align="center" class="bg_tr" nowrap>通时</td>
<td align="center" class="bg_tr" nowrap>提车总数</td>
<td align="center" class="bg_tr" nowrap>提单总数</td>
<td align="center" class="bg_tr" nowrap>商业总净保费</td>
<td align="center" class="bg_tr" nowrap>交强总净保费</td>
<td align="center" class="bg_tr" nowrap>商业已收净保费</td>
<td align="center" class="bg_tr" nowrap>交强已收净保费</td>
<td align="center" class="bg_tr" nowrap>总签单净保费</td>
<td align="center" class="bg_tr" nowrap>详情</td>
</tr>
<?php
foreach($user_rows as $row) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$row['username']?></td>
<td align="center" class="td_bg" nowrap><?=$row['truename']?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][0]!=''?$row['total'][0]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][7]>0?$row['total'][7]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][1]>0?$row['total'][1]:''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][2]>0?'¥'.number_format($row['total'][2],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][3]>0?'¥'.number_format($row['total'][3],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][4]>0?'¥'.number_format($row['total'][4],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][5]>0?'¥'.number_format($row['total'][5],2):''?></td>
<td align="center" class="td_bg" nowrap><?=$row['total'][6]>0?'¥'.number_format($row['total'][6],2):''?></td>
<td align="center" class="td_bg" nowrap>[<a href="/statistics/work-info?user_id=<?=$row['id']?>&date_begin=<?=$date_begin?>&date_end=<?=$date_end?>&date2_begin=<?=$date2_begin?>&date2_end=<?=$date2_end?>&username=<?=$username?>">详情</a>]</td>
</tr>
<?php
}
?>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>汇总</td>
<td width="60" align="center" class="bg_tr" nowrap></td>
<td width="60" align="center" class="bg_tr" nowrap></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[7]?$sum_total[7]:''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[1]?$sum_total[1]:''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[2]?'¥'.number_format($sum_total[2],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[3]?'¥'.number_format($sum_total[3],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[4]?'¥'.number_format($sum_total[4],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[5]?'¥'.number_format($sum_total[5],2):''?></td>
<td align="center" class="bg_tr" nowrap><?=$sum_total[6]?'¥'.number_format($sum_total[6],2):''?></td>
<td align="center" class="bg_tr" nowrap></td>
</tr>
</table>

@ -0,0 +1,64 @@
/**
* 选择框初始化
* @param selects
* @structure{
* name: {
* option_infos: [{
* id: id,
* name: name.
* }],
* selected: selected-id
* }
* @structure}
*/
function selectInfoInit(selects){
$.each(selects,function(name,data){
var html = '<option value="0">---请选择---</option>';
$.each(data['option_infos'],function(i,item){
var val = item['code']?item['code']:item['id'];
var selected = data['selected'] && data['selected'] == val? 'selected': '';
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>'
});
$('#'+ name + '_info').html(html);
});
}
/**
* 数据表格初始化
* @param tables
* @structure{
* name: {
* data: table-data,
* data: [
* url: url,
* queryPrams: function
* ]
* selected: selected-id
* }
* @structure}
*/
function tableInfoInit(tables){
$.each(tables,function(name,data){
var $table = $('#'+ name +'_table');
var options = {};
if(data['url']){
options = {
url: data.url,
pagination: true,
sidePagination: 'server',
queryParams: function (param) {
typeof data['queryParamsFunc'] == 'function' && data['queryParamsFunc'](param);
},
responseHandler: function (param) {
typeof data['responseFunc'] == 'function' && data['responseFunc'](param);
},
};
}else {
options = {
data: data
}
}
$table.bootstrapTable('destroy');
$table.bootstrapTable(options);
});
}
Loading…
Cancel
Save