完成利润统计界面更换

dev
曾超新 5 years ago
parent 6264d23980
commit dd7172af88
  1. 5
      common/models/CaiwuT.php
  2. 167
      frontend/controllers/FinanceController.php
  3. 391
      frontend/views/finance/receipt-lirun.php

@ -125,4 +125,9 @@ class CaiwuT extends \common\models\Base
{ {
return $this->hasOne(OrderCaiwuT::className(),['order_id'=>'order_id']); return $this->hasOne(OrderCaiwuT::className(),['order_id'=>'order_id']);
} }
public function getPayOrderUser()
{
return $this->hasMany(PayOrderUserT::className(),['order_id'=>'order_id']);
}
} }

@ -7611,10 +7611,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$group_items = GroupT::getTree();
$data = []; $data = [];
$data['total'] = $total; $data['total'] = $total;
$data['rows'] = []; $data['rows'] = [];
@ -7759,12 +7755,26 @@ class FinanceController extends \frontend\controllers\UserBaseController
]); ]);
} }
public function actionReceiptLirun() public function actionReceiptLirun() {
$company_items = InsurerCompany2T::find()->all();
$group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1)
$group_items = GroupT::getTree();
return $this->render('receipt-lirun',[
'company_items' => $company_items,
'group_items' => $group_items
]);
}
public function actionReceiptLirunJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON;
set_time_limit(0); set_time_limit(0);
ini_set('memory_limit', '3072M'); ini_set('memory_limit', '3072M');
$request = Yii::$app->request; $request = Yii::$app->request;
$page = $request->get('page', 1); $offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$insurer_type = $request->get('insurer_type', 0); $insurer_type = $request->get('insurer_type', 0);
$begin_date = $request->get('begin_date',date('Y-m-d')); $begin_date = $request->get('begin_date',date('Y-m-d'));
$end_date = $request->get('end_date',date('Y-m-d')); $end_date = $request->get('end_date',date('Y-m-d'));
@ -7782,7 +7792,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
//级别 //级别
$group_id = $request->get('group_id'); $group_id = $request->get('group_id');
$group_items = GroupT::getTree((int)$this->my->group_id); $group_items = GroupT::getTree((int)$this->my->group_id);
if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053') if($this->my->id == 1)
$group_items = GroupT::getTree(); $group_items = GroupT::getTree();
$group_ids[] = $group_id; $group_ids[] = $group_id;
@ -7793,14 +7803,10 @@ class FinanceController extends \frontend\controllers\UserBaseController
$group_ids[] = $group_info->id; $group_ids[] = $group_info->id;
} }
} }
// var_dump($group_ids);
if ($page < 1) $page = 1;
$query = CaiwuT::find() $query = CaiwuT::find()
->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id") ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
->where('order_t.status_id>1'); ->where('order_t.status_id>1');
// ->orderBy('order_t.print_date DESC');
switch ($sort_key) { switch ($sort_key) {
case 'total': case 'total':
@ -7828,20 +7834,20 @@ class FinanceController extends \frontend\controllers\UserBaseController
break; break;
} }
$query = $query->orderBy($sort); $query->orderBy($sort);
if( $insurer_type != 0) { if( $insurer_type != 0) {
$query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type); $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
} }
if( $company_id > 0) { if( $company_id > 0) {
$query = $query->andWhere('order_t.company_id='.$company_id); $query->andWhere('order_t.company2_id='.$company_id);
} }
if ($username != "") { if ($username != "") {
// $userdata = UserT::findOne(['username'=>$username]); // $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('caiwu_t.user_id = ' . $userdata->id . ''); $query->andWhere('caiwu_t.user_id = ' . $userdata->id . '');
} }
} }
@ -7849,7 +7855,7 @@ class FinanceController extends \frontend\controllers\UserBaseController
// $userdata = UserT::findOne(['username'=>$username]); // $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('order_t.op1_id = ' . $userdata->id . ''); $query->andWhere('order_t.op1_id = ' . $userdata->id . '');
} }
} }
@ -7857,57 +7863,49 @@ class FinanceController extends \frontend\controllers\UserBaseController
// $userdata = UserT::findOne(['username'=>$username]); // $userdata = UserT::findOne(['username'=>$username]);
$userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one(); $userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one();
if($userdata){ if($userdata){
$query = $query->andWhere('order_t.op2_id = ' . $userdata->id . ''); $query->andWhere('order_t.op2_id = ' . $userdata->id . '');
} }
} }
if ($car_no != "") { if ($car_no != "") {
$query = $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"'); $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"');
} }
if ($insurer_no != "") { if ($insurer_no != "") {
$query = $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"'); $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"');
} }
if ($status > 0) { if ($status > 0) {
if ($status == 1) { if ($status == 1) {
$query = $query->andWhere('r_date="" or r_date is null'); $query->andWhere('r_date="" or r_date is null');
} }
if ($status == 2) { if ($status == 2) {
$query = $query->andWhere('r_date<>"" and total_dis=0'); $query->andWhere('r_date<>"" and total_dis=0');
} }
if($status == 3) { if($status == 3) {
$query = $query->andWhere('r_date<>"" and total_dis<>0'); $query->andWhere('r_date<>"" and total_dis<>0');
} }
} }
if ($begin_date != "") { if ($begin_date != "") {
$query = $query->andWhere('order_t.print_date>="' . $begin_date . '"'); $query->andWhere('order_t.print_date>="' . $begin_date . '"');
} }
if ($end_date != "") { if ($end_date != "") {
$query = $query->andWhere('order_t.print_date<="' . $end_date . '"'); $query->andWhere('order_t.print_date<="' . $end_date . '"');
} }
if ($r_begin_date != "") { if ($r_begin_date != "") {
$query = $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"'); $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"');
} }
if ($r_end_date != "") { if ($r_end_date != "") {
$query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"'); $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"');
} }
//找出$group_id 有多少在职的user_ids //找出$group_id 有多少在职的user_ids
// 现在的搜索条件 // 现在的搜索条件
$userSql = ''; $userSql = '';
// if($username != '') {
// $userSql = ' username like "'.$username.'" and ';
// }
//$userSql .= 'is_locked=0 and is_login=1';
$user_items = $this->my->getChildren($userSql); $user_items = $this->my->getChildren($userSql);
if($this->my->username == '6002' || $this->my->username == '7053')
$user_items = $this->my->getChildren($userSql,1);
$user_items[] = $this->my; $user_items[] = $this->my;
$row = array(); $row = array();
foreach($user_items as $user_info) { foreach($user_items as $user_info) {
// if ($user_info->is_leave == 1) continue;
// var_dump($user_info);
if ($group_id > 0) { if ($group_id > 0) {
if (!in_array($user_info->group_id, $group_ids)) { if (!in_array($user_info->group_id, $group_ids)) {
continue; continue;
@ -7918,17 +7916,13 @@ class FinanceController extends \frontend\controllers\UserBaseController
} }
// var_dump($row);
//加上级别筛选 //加上级别筛选
if($group_id > 0){ if($group_id > 0){
// $query = $query->andWhere('order_t.company_id='.$company_id); $query->andWhere(['in','caiwu_t.user_id',$row]);
$query = $query->andWhere(['in','caiwu_t.user_id',$row]);
// $query = $query->andWhere('caiwu_t.user_id ="' . $group_id . '"');
} }
$query1 = clone $query; $query1 = clone $query;
$item1s = $query1->all(); $item1s = $query1->all();
// echo $query->createCommand()->rawSql; // echo $query->createCommand()->rawSql;
@ -7943,83 +7937,44 @@ class FinanceController extends \frontend\controllers\UserBaseController
$sum_total_dis = $query->sum('total_dis'); $sum_total_dis = $query->sum('total_dis');
$pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); $query = $query->offset($offset)->limit($limit);
$pagination->setPage($page - 1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all(); $items = $query->all();
$lirun_all = 0; // var_dump($items);
$gongzi_all = 0; $data = [];
$liwu_all = 0; $data['total'] = $total;
$total1_dis_all = 0; $data['rows'] = [];
$bu_dian_all = 0; foreach($items as $item) {
$r_bu_dian_all = 0;
foreach($item1s as $item){
$order_info = $item->order; $order_info = $item->order;
$user_info = $item->user;
$total_clear_real = $item->total_clear * $item->total_rate/100; $row = $item->toArray();
$total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0; $row['username'] = $user_info->username;
$row['company_name'] = $order_info ? $order_info->company2->name : '';
$gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0; $row['group_name'] = $user_info->group ? $user_info->group->path : '';
$row['submit_date'] = $order_info ? $order_info->submit_date : '';
$row['print_date'] = $order_info ? $order_info->print_date : '';
if($item->insurer_type == 1) {
$row['insurer_type'] = '商业';
} else {
$row['insurer_type'] = '交强';
}
$row['total_real'] = round($item->total * $item->total_rate/100,2);
$row['total_clear_real'] = round($item->total_clear * $item->total_rate/100,2);
$row['bu_dian'] = $item->budian_rate?round($item->budian_rate * $item->total_clear,2) / 100:0;
$row['r_bu_dian'] = $item->insurer_type == 1?round($item->b1_total+$item->b2_total+$item->b3_total,2):0;
$row['total1_dis'] = $item->insurer_type == 1?round($order_info->total1_dis + $order_info->yuangong_money,2):0;
$ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0; $ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0;
$gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0; $gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0;
$r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0; $row['liwu'] = round($ticket + $gift,2);
$bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0; $row['gongzi'] = $item->insurer_type == 1?round($item->getPayOrderUser()->sum('real_pay'),2):0;
$liwu = $ticket + $gift; $row['lirun'] = round($row['total_clear_real'] + $row['bu_dian'] - $row['total1_dis'] - $row['gongzi'] - $row['liwu'],2);
$data['rows'][] = $row;
$lirun_all += $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu;
$gongzi_all += $gongzi;
$liwu_all += $liwu;
$total1_dis_all += $total1_dis;
$bu_dian_all += $bu_dian;
$r_bu_dian_all += $r_bu_dian;
} }
// var_dump($items); return $data;
$page_info = MyLib::getPageInfo($pagination);
$company_items = InsurerCompanyT::find()->all();
return $this->render('receipt-lirun', [
'items' => $items,
'username' => $username,
'hebaoname' => $hebaoname,
'zbname' => $zbname,
'page' => $page,
'car_no' => $car_no,
'insurer_no' => $insurer_no,
'status' => $status,
'begin_date' => $begin_date,
'end_date' => $end_date,
'r_begin_date' => $r_begin_date,
'r_end_date' => $r_end_date,
'page_info' => $page_info,
'sort_key' => $sort_key,
'sort_value' => $sort_value,
'sum_r_total' => $sum_r_total,
'sum_total_clear' => $sum_total_clear,
'sum_total' => $sum_total,
'sum_total_dis' => $sum_total_dis,
'company_items' => $company_items,
'group_id' => $group_id,
'group_items' => $group_items,
'company_id' => $company_id,
'insurer_type' => $insurer_type,
'lirun_all'=>$lirun_all,
'gongzi_all'=>$gongzi_all,
'liwu_all'=>$liwu_all,
'total1_dis_all'=>$total1_dis_all,
'bu_dian_all'=>$bu_dian_all,
'r_bu_dian_all'=>$r_bu_dian_all
]);
} }
public function actionGongziAllReturnSave() public function actionGongziAllReturnSave()

@ -1,289 +1,162 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script src="/Myfile/lib/layui/layui.js"></script> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link rel="stylesheet" href="/js/fileupload/css/jquery.fileupload.css"> <?php $this->endBlock(); ?>
<table lay-size="sm" class="layui-table ">
<div class="wrapper wrapper-content animated fadeInRight">
<form id="searchForm"> <div class="ibox float-e-margins">
<input type="hidden" id="page" name="page" value="<?=$page?>"> <div class="ibox-title">
<tr> <h5>利润统计</h5>
<td class="td_bg"> <div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
保险类型 <i class="fa fa-refresh"></i> 刷新
<select name="insurer_type" class="insurer_type"> </a>
</div>
</div>
<div class="ibox-content">
<form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="car_no">保险类型</label>
<select name="insurer_type" class="form-control">
<option value=0>全部</option> <option value=0>全部</option>
<option value=1 <?= $insurer_type==1?'selected':'' ?>>商业</option> <option value=1>商业</option>
<option value=2 <?= $insurer_type==2?'selected':'' ?>>交强</option> <option value=2>交强</option>
</select> </select>
保单号:<input name="insurer_no" type="text" value="<?=$insurer_no?>"> </div>
车牌:<input name="car_no" type="text" value="<?=$car_no?>"> <div class="form-group" style="margin-bottom: 8px;">
工号:<input name="username" type="text" value="<?=$username?>">&nbsp;&nbsp; <label for="engine_no">保单号</label>
<!--日期--> <input type="text" id="insurer_no" name="insurer_no" class="form-control">
出单日期: </div>
<input type="Text" class="Wdate" name="begin_date" onclick="WdatePicker()" value="<?= $begin_date ?>" /> <div class="form-group" style="margin-bottom: 8px;">
-- <label for="engine_no">车牌</label>
<input type="Text" class="Wdate" name="end_date" onclick="WdatePicker()" value="<?= $end_date ?>" /> <input type="text" id="car_no" name="car_no" class="form-control">
<br> </div>
<br> <div class="form-group" style="margin-bottom: 8px;">
回单日期: <label for="engine_no">工号</label>
<input type="Text" class="Wdate" name="r_begin_date" onclick="WdatePicker()" value="<?= $r_begin_date ?>" /> <input type="text" id="username" name="username" class="form-control">
-- </div>
<input type="Text" class="Wdate" name="r_end_date" onclick="WdatePicker()" value="<?= $r_end_date ?>" /> <div class="form-group" style="margin-bottom: 8px;">
<br>保险公司:<select name="company_id"> <label for="datepicker1">出单日期</label>
<option value="0">所有模型</option> <div class="input-group input-daterange" id="datepicker1">
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" id="end_date" name="end_date" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">回单日期</label>
<div class="input-group input-daterange" id="datepicker1">
<input type="text" class="input-sm form-control" id="r_begin_date" name="r_begin_date" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" id="r_end_date" name="r_end_date" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">联系电话</label>
<input type="text" id="phone" name="phone" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">保险公司</label>
<select name="company_id" class="form-control">
<option value="0">全部</option>
<?php <?php
foreach($company_items as $item) { foreach($company_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'">'.$item->name.'</option>';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
} }
?> ?>
</select> </select>
级别:<select name="group_id"> </div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="engine_no">级别</label>
<select name="group_id">
<option value="0">全部</option> <option value="0">全部</option>
<?php <?php
foreach($group_items as $item) { foreach($group_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'">'.$item->name.'</option>';
if($item->id == $group_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
} }
?> ?>
</select> </select>
排序: </div>
<select name="sort_key"> <button type="submit" class="btn btn-primary mb-8">搜索</button>
<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> </form>
</table> <div class="row">
<div class="col-md-12">
<table width="100%" class="layui-elip layui-table" lay-filter="demo"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th width="24" align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username1',width:30}">序号</th> <th data-field="state" data-checkbox="true"></th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username2'}">车牌号</th> <th width="50" data-field="id">ID</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username4'}">保险公司</th> <th data-field="car_no">车牌</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username5'}">工号</th> <th data-field="company_name">保险公司</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username6'}">级别</th> <th data-field="username">工号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username10',width:110}">保单号</th> <th data-field="group_name">级别</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username11'}">提单日期</th> <th data-field="insurer_no">保单号</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username12'}">出单日期</th> <th data-field="submit_date">提单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username13'}">保险类型</th> <th data-field="print_date">出单日期</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username14'}">商业总保费</th> <th data-field="insurer_type">保险类型</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username15'}">商业净保费</th> <th data-field="total">商业总保费</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username16'}">手续费比例</th> <th data-field="total_clear">商业净保费</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username17'}">补点比例</th> <th data-field="total_rate">手续费比例</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username18'}">应得金额</th> <th data-field="budian_rate">补点比例</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username19'}">实得金额</th> <th data-field="total_real">应得金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username20'}">回款金额</th> <th data-field="total_clear_real">实得金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username22'}">补点金额</th> <th data-field="r_total">回款金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username23'}">回款补点</th> <th data-field="bu_dian">补点金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username24'}">减免金额</th> <th data-field="r_bu_dian">回款补点</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username25'}">礼品礼券</th> <th data-field="total1_dis">减免金额</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username26'}">工资</th> <th data-field="liwu">礼品礼券</th>
<th align="center" class="bg_tr" style="font-size:12px;" lay-data="{field:'username28'}">利润</th> <th data-field="gongzi">工资</th>
<th data-field="lirun">利润</th>
</tr> </tr>
</thead> </thead>
<tbody> </table>
</div>
<?php </div>
foreach($items as $index => $item) { </div>
$start_index = ($page-1)*20+$index; </div>
$order = $item->order; </div>
$users=$item->user->group;
$username=$item->user;
$uname=$username['name']; <?php $this->beginBlock('footer_js'); ?>
$nams=$users['name']; <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>
$total_real = $item->total * $item->total_rate/100; <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
$total_clear_real = $item->total_clear * $item->total_rate/100; <script>
$total_dis = round($total_clear_real - $item->r_total,2); var o = {};
function refreshList() {
$order_info = $item->order; $('#listTable').bootstrapTable('refresh');
$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){ function search() {
alert(obj.msg); o = {};
if(obj.success){ var params = $("#searchFrm").serializeArray();
$('#theFrm')[0].reset(); $.each(params, function(index) {
window.location.reload(); o[this['name']] = this['value'];
}
},'json');
}
});
//搜索
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/finance/receipt-lirun?" + params;
}); });
//导出 $('#listTable').bootstrapTable('destroy');
$("#output-btn").click(function(){ $('#listTable').bootstrapTable({
$('#page').val(0); url: "/finance/receipt-lirun-json",
var params = $('#searchForm').serialize(); pagination: true,
//window.location.href = "/finance/receipt-output?" + params; sidePagination: 'server',
var url = "/finance/receipt-output"; multipleSelectRow: true,
queryParams: function(params) {
$.get(url,params,function(obj){ o['offset'] = params['offset'];
alert(obj.msg); o['limit'] = params['limit'];
if(obj.success) { return o;
window.location.href = obj.files[0].src;
} }
},'json');
}); });
}) return false;
</script>
<style>
input[type="text"] {
width: 134px;
} }
</style> $(function() {
<script> search();
console.log(layui) $('.input-daterange').datepicker({
layui.use('table',function(){ keyboardNavigation: false,
var table = layui.table; forceParse: false,
var $ = layui.$; autoclose: true
//转换静态表格 });
table.init('demo', {
limit: 100
}); });
$('.layui-table-cell').css('padding','0')
$('td').css('padding','0')
})
</script> </script>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save