完成返现管理功能开发

dev
曾超新 5 years ago
parent 88fd5731b3
commit baeb914545
  1. 347
      frontend/controllers/InsurerController.php
  2. 833
      frontend/views/insurer/finance-mng-edit.php
  3. 71
      frontend/views/insurer/finance-mng.php

@ -2400,109 +2400,6 @@ class InsurerController extends BaseController
* 出纳办结-列表 * 出纳办结-列表
* @return string * @return string
*/ */
// public function actionFinanceMng()
// {
// $request = Yii::$app->request;
// //新增正本日期
// $begin_date = $request->get('begin_date');
// $end_date = $request->get('end_date');
// //新增完成状态
// $status = $request->get('status');
//
// $car_man = $request->get('car_man');
// $phone = $request->get('phone');
// $car_no = $request->get('car_no');
// $send_date = $request->get('send_date');
// $insurer_no = $request->get('insurer_no');
// $caiwu_status_id = $request->get('caiwu_status_id');
// $page = $request->get('page',1);
// if($page < 1) $page = 1;
//
// $query = OrderT::find()
// ->leftJoin('order_caiwu_t','order_caiwu_t.order_id=order_t.id')
// ->where('order_caiwu_t.status_id>0')
// ->orderBy('order_t.print_date asc');
// if($car_man != '') {
// $query = $query->andWhere('id_man="'.$car_man.'"');
// }
// if($phone != '') {
// $query = $query->andWhere('link_phone="'.$phone.'"');
// }
// if($car_no != '') {
// $query = $query->andWhere('car_no="'.$car_no.'"');
// }
// if($send_date != '') {
// $query = $query->andWhere('send_date="'.$send_date.'"');
// }
// if($insurer_no != '') {
// $query = $query->andWhere('(insurer1_no="'.$insurer_no.'" or insurer2_no="'.$insurer_no.'")');
// }
// //添加正本日期
// if($begin_date != '') {
// $query = $query->andWhere('print_date>="'.$begin_date.'"');
// }
// if($end_date != '') {
// $query = $query->andWhere('print_date<="'.$end_date.'"');
// }
// //添加完成状态
// if($status == 2) {
// $query = $query->andWhere('order_caiwu_t.status_id=10 or order_caiwu_t.status_id=13');
// } else if($status == 1) {
// $query = $query->andWhere('order_caiwu_t.status_id=12');
// } else {
// $query = $query->andWhere('order_caiwu_t.status_id=13 or order_caiwu_t.status_id=10 or order_caiwu_t.status_id=12');
// }
// //转账状态
// if($caiwu_status_id > 0){
// switch($caiwu_status_id){
// case 1:
// $query = $query->andWhere('order_caiwu_t.caiwu_status_id=1');
// break;
// case 2:
// $query = $query->andWhere('order_caiwu_t.caiwu_status_id=2');
// break;
// case 3:
// $query = $query->andWhere('order_caiwu_t.caiwu_status_id=3');
// break;
// case 4:
// $query = $query->andWhere('order_caiwu_t.caiwu_status_id=4');
// break;
// default:
// break;
// }
// }
//// if($this->my->username == 'admin')
//// echo $query->createCommand()->rawSql;
//// echo $query->createCommand()->rawSql;
//// die;
// $total = $query->count();
//
// $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
// $pagination->setPage($page-1);
//
// $query = $query->offset($pagination->offset)->limit($pagination->limit);
// $items = $query->all();
//
// $page_info = MyLib::getPageInfo($pagination);
//
// $caiwu_status = CaiwuStatusT::find()->all();
//
// return $this->render('finance-mng',[
// 'items' => $items,
// 'car_man' => $car_man,
// 'phone' => $phone,
// 'car_no' => $car_no,
// 'send_date' => $send_date,
// 'page' => $page,
// 'page_info' => $page_info,
// 'insurer_no' => $insurer_no,
// 'status' => $status,
// 'caiwu_status_id' => $caiwu_status_id,
// 'caiwu_status' => $caiwu_status,
// 'begin_date' => $begin_date,
// 'end_date' => $end_date
// ]);
// }
public function actionFinanceMng() { public function actionFinanceMng() {
return $this->render('finance-mng'); return $this->render('finance-mng');
} }
@ -2626,7 +2523,15 @@ class InsurerController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['user'] = $item->user?$item->user->getShowName():''; $row['company_name'] = $item->company2->name;
$row['path'] = ($item->user && $item->user->group) ? $item->user->group->getPath():'';
$row['user_name'] = $item->user?$item->user->getShowName():'';
$row['total_user_real'] = number_format($item->total1_dis + $item->yuangong_money,2);
$row['transfer_date'] = $item->caiwu->transfer_date;
$row['caiwu_status_name'] = $item->caiwu->caiwuStatus->name;
$row['shoufei_name'] = MyLib::zhifufs($item->shoufei_id);
$row['status_name'] = $item->caiwu->status->name;
$row['lock_man'] = $item->caiwu->lock?$item->caiwu->lock->getShowName():'';
$data['rows'][] = $row; $data['rows'][] = $row;
} }
@ -2803,7 +2708,6 @@ class InsurerController extends BaseController
$order_info = OrderT::findOne(['id'=>$id]); $order_info = OrderT::findOne(['id'=>$id]);
$car_info = $order_info->car; $car_info = $order_info->car;
$caiwu_info = $order_info->caiwu; $caiwu_info = $order_info->caiwu;
if($caiwu_info->lock_id == 0) { if($caiwu_info->lock_id == 0) {
$tran = OrderCaiwuT::getDb()->beginTransaction(); $tran = OrderCaiwuT::getDb()->beginTransaction();
try { try {
@ -2864,12 +2768,14 @@ class InsurerController extends BaseController
$tmp_row = PriceT::find() $tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$v->id) ->where('order_id='.$order_id.' and type_id='.$v->id)
->one(); ->one();
if($tmp_row) {
if ($tmp_row->val != '' && $tmp_row->val != '0' && $tmp_row->val != '否' && $tmp_row->val != '无') { if ($tmp_row->val != '' && $tmp_row->val != '0' && $tmp_row->val != '否' && $tmp_row->val != '无') {
$new_array[$k]['zl'] = $v->name . '(' . $v->code . ')'; $new_array[$k]['zl'] = $v->name . '(' . $v->code . ')';
$new_array[$k]['neir'] = $tmp_row->val; $new_array[$k]['neir'] = $tmp_row->val;
$new_array[$k]['bjmp'] = $tmp_row->is_nopay == 1 ? '是' : ''; $new_array[$k]['bjmp'] = $tmp_row->is_nopay == 1 ? '是' : '';
} }
} }
}
//银行列表 //银行列表
$banks = BankT::find()->all(); $banks = BankT::find()->all();
@ -3076,33 +2982,8 @@ class InsurerController extends BaseController
$transfer_money = $request->post('transfer_money'); $transfer_money = $request->post('transfer_money');
$transfer_bank_id = $request->post('transfer_bank_id'); $transfer_bank_id = $request->post('transfer_bank_id');
$transfer_bank_no = $request->post('transfer_bank_no'); $transfer_bank_no = $request->post('transfer_bank_no');
$budian_rate = $request->post('budian_rate');
$budian_money = $request->post('budian_money');
$business_back_money = $request->post('business_back_money');
$business_back_rate = $request->post('business_back_rate');
$business_back_routine = $request->post('business_back_routine');
$business_back_date = $request->post('business_back_date');
$force_back_money = $request->post('force_back_money');
$force_back_rate = $request->post('force_back_rate');
$force_back_routine = $request->post('force_back_routine');
$force_back_date = $request->post('force_back_date');
$caiwu_no = $request->post('caiwu_no'); $caiwu_no = $request->post('caiwu_no');
$rate1 = $request->post('rate1');
$money1 = $request->post('money1');
$rate2 = $request->post('rate2');
$money2 = $request->post('money2');
$rate3 = $request->post('rate3');
$money3 = $request->post('money3');
$rate4 = $request->post('rate4');
$money4 = $request->post('money4');
$rate5 = $request->post('rate5');
$money5 = $request->post('money5');
$send_rate = $request->post('send_rate');
$send_money = $request->post('send_money');
$caiwu_status_id = $request->post('caiwu_status_id'); $caiwu_status_id = $request->post('caiwu_status_id');
$gift_ids = $request->post('gift_ids',array());
$gift_prices = $request->post('gift_prices',array());
$gift_rates = $request->post('gift_rates',array());
$tran = OrderCaiwuT::getDb()->beginTransaction(); $tran = OrderCaiwuT::getDb()->beginTransaction();
try { try {
@ -3120,213 +3001,36 @@ class InsurerController extends BaseController
$caiwu_info->transfer_money = $transfer_money; $caiwu_info->transfer_money = $transfer_money;
$caiwu_info->transfer_bank_id = $transfer_bank_id; $caiwu_info->transfer_bank_id = $transfer_bank_id;
$caiwu_info->transfer_bank_no = $transfer_bank_no; $caiwu_info->transfer_bank_no = $transfer_bank_no;
$caiwu_info->budian_rate = $budian_rate;
$caiwu_info->budian_money = $budian_money;
$caiwu_info->business_back_money = $business_back_money;
$caiwu_info->business_back_rate = $business_back_rate;
$caiwu_info->business_back_routine = $business_back_routine;
$caiwu_info->business_back_date = $business_back_date;
$caiwu_info->force_back_money = $force_back_money;
$caiwu_info->force_back_rate = $force_back_rate;
$caiwu_info->force_back_routine = $force_back_routine;
$caiwu_info->force_back_date = $force_back_date;
$caiwu_info->caiwu_no = $caiwu_no; $caiwu_info->caiwu_no = $caiwu_no;
$old_status_id = $caiwu_info->status_id; $old_status_id = $caiwu_info->status_id;
if($status_id > $old_status_id) { if($status_id == 10) {
if($caiwu_status_id == 0){
$result['success'] = false;
$result['msg'] = '请先确定转账状态后,再点提交按钮!';
return $result;
}
if($caiwu_info->caiwu_status_id != $caiwu_status_id) { if($caiwu_info->caiwu_status_id != $caiwu_status_id) {
$result['success'] = false; $result['success'] = false;
$result['msg'] = '请先保存成功后,再点提交按钮!'; $result['msg'] = '请先保存成功后,再点提交按钮!';
return $result; return $result;
} }
}
$caiwu_info->caiwu_status_id = $caiwu_status_id;
$caiwu_info->rate1 = $rate1;
$caiwu_info->money1 = $money1;
$caiwu_info->rate2 = $rate2;
$caiwu_info->money2 = $money2;
$caiwu_info->rate3 = $rate3;
$caiwu_info->money3 = $money3;
$caiwu_info->rate4 = $rate4;
$caiwu_info->money4 = $money4;
$caiwu_info->rate5 = $rate5;
$caiwu_info->money5 = $money5;
$caiwu_info->send_rate = $send_rate;
$caiwu_info->send_money = $send_money;
// $caiwu_info->send_price = $send_price;
$caiwu_info->status_id = $status_id;
$caiwu_info->save();
// echo $caiwu_info->lock_id."\r\n";
// echo $status_id;
// exit;
//保存礼品价格
foreach($gift_ids as $index => $id) {
$rate = $gift_rates[$index];
$price = $gift_prices[$index];
$order_gift = OrderGiftT::findOne(['id'=>$id]);
if($order_gift) {
$order_gift->rate = $rate;
$order_gift->price = $price;
$order_gift->save();
}
}
if($status_id > $old_status_id) {
//处理新保、跟踪、续保提成
$order_info = $caiwu_info->order;
$car_info = $order_info->car;
//删除相当记录
PayOrderUserT::deleteAll('order_id='.$order_info->id);
// echo $op_user1_id;
// die;
// var_dump($caiwu_info->pay_date);
//截取日期来进行判断
$year= (int)substr($caiwu_info->pay_date,0,4);
if($year>=2018){
$op11= substr($order_info->op1->getShowName(),0,strpos($order_info->op1->getShowName(),'('));
$op1_user = UserT::findOne(['username'=>$op11,'is_delete'=>0]);
if($op1_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $op1_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 5;
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$pay_order_user->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
$op22= substr($order_info->op2->getShowName(),0,strpos($order_info->op2->getShowName(),'('));
$op2_user = UserT::findOne(['username'=>$op22,'is_delete'=>0]);
if($op2_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $op2_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 6;
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$pay_order_user->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
}
$op_user1_id = substr($car_info->op_user1,0,strpos($car_info->op_user1,'('));
$pay1_user = UserT::findOne(['username'=>$op_user1_id,'is_delete'=>0]);
if($pay1_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $pay1_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 1;
$pay_order_user->is_own = $car_info->op_user3 != '' ? 0:1;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$pay_order_user->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
$op_user2_id = substr($car_info->op_user2,0,strpos($car_info->op_user2,'('));
$pay2_user = UserT::findOne(['username'=>$op_user2_id,'is_delete'=>0]);
if($pay2_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $pay2_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 2;
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$pay_order_user->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
$op_user3_id = substr($car_info->op_user3,0,strpos($car_info->op_user3,'('));
$pay3_user = UserT::findOne(['username'=>$op_user3_id,'is_delete'=>0]);
if($pay3_user) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $pay3_user->id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 3;
$pay_order_user->is_own = 1;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$pay_order_user->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
$send_info = $order_info->sendLog;
if($send_info) {
$pay_order_user = new PayOrderUserT();
$pay_order_user->user_id = $send_info->user_id;
$pay_order_user->order_id = $order_info->id;
$pay_order_user->type = 4;
$pay_order_user->is_own = 0;
$pay_order_user->pay_date = $caiwu_info->pay_date;
$pay_order_user->save();
$pay_order_user->calPay();
$pay_info = PayT::findOne(['user_id'=>$send_info->user_id,'pay_date'=>$pay_order_user->pay_date]);
if($pay_info) {
$pay_info->calPay();
}
}
$caiwu_info->lock_id = 0; $caiwu_info->lock_id = 0;
// $this->addLog($caiwu_info->order->car_id,'出纳办结完成,提交财务处理',1); $this->addLog($caiwu_info->order->car_id,'返现管理完成',1);
if($year>=2018){
$this->addLog($caiwu_info->order->car_id,'出纳办结完成,提交财务处理',1);
}else{
$this->addLog1($caiwu_info->order->car_id,'出纳办结完成,提交财务处理',1);
} }
$caiwu_info->caiwu_status_id = $caiwu_status_id;
//处理操作人员状态 $caiwu_info->status_id = $status_id;
$order_user_info = OrderUserT::findOne(['order_id'=>$caiwu_info->order_id,'user_id'=>$this->my->id,'type_id'=>$old_status_id,'status'=>0]); if(!$caiwu_info->save()) {
if($order_user_info) { throw new \Exception(print_r($caiwu_info->getErrors(), true));
$order_user_info->status = 1; //操作结束
$order_user_info->save();
}
} }
$caiwu_info->save(); $tran->commit();
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功'; $result['msg'] = '保存成功';
$tran->commit();
} catch(\Throwable $e) { } catch(\Throwable $e) {
$tran->rollBack(); $tran->rollBack();
file_put_contents('log.txt',$e->getMessage()); $result['msg'] = $e->getMessage();
throw $e;
} }
} }
return $result; return $result;
@ -4229,6 +3933,9 @@ class InsurerController extends BaseController
} }
$tran->commit(); $tran->commit();
$result['success'] = true;
$result['msg'] = '放弃成功';
} catch (\Exception $e) { } catch (\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; throw $e;

@ -1,268 +1,235 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
use \common\models\PriceT; use common\models\PriceT;
?> ?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css"> <?php $this->beginBlock('header_css'); ?>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<tr> <?php $this->endBlock(); ?>
<td height="22" colspan="2" class="td_bg">
<form id="orderFrm"> <div class="wrapper wrapper-content animated fadeInRight">
<table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable"> <form class="form-horizontal" id="orderFrm">
<tr> <input type="hidden" name="car_id" value="<?=$order_info->car_id?>">
<td height="120" valign="top" class="td_bg">
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(1) name="navcell">▼车辆信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb1 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="car_id" value="<?=$car_info->id?>">
<tr>
<td width="100" height="25" class="bg_tr">车牌号</td>
<td height="25" class="td_bg"><?=$car_info->car_no?></td>
<td width="100" height="25" class="bg_tr">厂牌型号</td>
<td height="25" class="td_bg"><?=$car_info->factory_model?></td>
<td width="60" height="25" class="bg_tr">品牌</td>
<td width="120" height="25" class="td_bg"><?=$car_info->brand?$car_info->brand->name:''?></td>
<td width="60" height="25" class="bg_tr">车系</td>
<td height="25" class="td_bg"><?=$car_info->series?$car_info->series->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">发动机号</td>
<td height="25" class="td_bg"><?=$car_info->engine_no?></td>
<td width="100" height="25" class="bg_tr">车架号</td>
<td height="25" class="td_bg"><?=$car_info->car_frame_no?></td>
<td width="60" height="25" class="bg_tr">初登日期</td>
<td height="25" class="td_bg"><?=$car_info->register_date?></td>
<td width="60" height="25" class="bg_tr">排量</td>
<td height="25" class="td_bg"><?=$car_info->displacement?$car_info->displacement->name:''?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车辆类型</td>
<td height="25" class="td_bg"><?=$car_info->carType?$car_info->carType->name:''?></td>
<td width="100" height="25" class="bg_tr">运营性质</td>
<td height="25" class="td_bg"><?=$car_info->carUse?$car_info->carUse->name:''?></td>
<td width="60" height="25" class="bg_tr">座位数</td>
<td height="25" class="td_bg"><?=$car_info->seats?></td>
<td width="60" height="25" class="bg_tr">年份</td>
<td height="25" class="td_bg"><?=$car_info->car_year?></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">车主</td>
<td height="25" class="td_bg"><?=$car_info->car_man?></td>
<td width="100" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg"><?=$car_info->phone?></td>
<td width="60" height="25" class="bg_tr">证件号码</td>
<td colspan="3" height="25" class="td_bg"><?=$car_info->car_man_number?></td>
</tr>
<tr>
<td width="60" height="25" class="bg_tr">备注</td>
<td colspan="3" height="25" class="td_bg"><?=$car_info->remark?></td>
<td width="100" height="25" class="bg_tr">业务员</td>
<td height="25" class="td_bg"><?=$order_info->user?$order_info->user->getShowName():''?></td>
<td width="60" height="25" class="bg_tr">联系电话</td>
<td height="25" class="td_bg"><?=$order_info->user?$order_info->user->phone:''?></td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<!--保单信息-->
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(2) name="navcell">▼保单信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb2 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="order_id" value="<?=$order_info->id?>"> <input type="hidden" name="order_id" value="<?=$order_info->id?>">
<tr> <input type="hidden" name="celuo_id" value="<?=$order_info->celuo_id?>">
<td class="bg_tr">被保险人</td> <input type="hidden" name="fanxian_id" value="<?=$order_info->fanxian_id?>">
<td class="td_bg"><?=$order_info->id_man?></td> <div class="ibox float-e-margins">
<td class="bg_tr">证件号码</td> <div class="ibox-title">
<td class="td_bg"><?=$order_info->id_number?></td> <h5>保单信息</h5>
<td width="60" class="bg_tr">联系人</td> </div>
<td class="td_bg"><?=$order_info->link_man?></td> <div class="ibox-content">
<td width="60" class="bg_tr">联系电话</td> <table class="table table-bordered">
<td class="td_bg"><?=$order_info->link_phone?></td> <tr>
</tr> <th class="bg-warning">车牌号</th>
<tr> <td><?=$order_info->car_no?></td>
<td class="bg_tr">保险公司</td> <th class="bg-warning" nowrap>初登日期</th>
<td class="td_bg"><?=$order_info->company?$order_info->company->name:''?></td> <td><?=$car_info->register_date?></td>
<td class="bg_tr">付款方式</td> <th class="bg-warning" nowrap>座位数</th>
<td class="td_bg"><?=$order_info->shoufei_id?MyLib::zhifufs($order_info->shoufei_id).'-':''?><?=$order_info->payType?$order_info->payType->name:''?></td> <td><?=$order_info->seats?></td>
<td class="bg_tr">电子邮件</td> <th class="bg-warning" nowrap>电子邮件</th>
<td class="td_bg"><?=$order_info->email?></td> <td><?=$order_info->email?></td>
</tr> </tr>
<tr> <tr>
<td class="bg_tr">商业起保日期</td> <th class="bg-warning">车型</th>
<td class="td_bg"><?=$order_info->insurer1_begin_date?></td> <td><?=$order_info->factory_model?></td>
<td class="bg_tr">交强起保日期</td> <th class="bg-warning" nowrap>发动机号</th>
<td class="td_bg"><?=$order_info->insurer2_begin_date?></td> <td><?=$order_info->engine_no?></td>
<td class="bg_tr">缴费单号</td> <th class="bg-warning" nowrap>车架号</th>
<td colspan="3" class="td_bg"><?=$order_info->pay_no?></td> <td><?=$order_info->car_frame_no?></td>
</tr> <th class="bg-warning" nowrap>新车购置价</th>
<tr> <td><?=$order_info->purchase_price?></td>
<td class="bg_tr">商业保单号</td> </tr>
<td class="td_bg"><?=$order_info->insurer1_no?></td> <tr>
<td class="bg_tr">交强保单号</td> <th class="bg-warning">车主</th>
<td class="td_bg"><?=$order_info->insurer2_no?></td> <td><?=$order_info->car_man?></td>
<td rowspan="3" class="bg_tr" valign="center">备注</td> <th class="bg-warning">证件类型</th>
<td colspan="3" rowspan="3" valign="top" class="td_bg"><?=$order_info->remark?></td> <td><?=$order_info->car_man_type?></td>
</tr> <th class="bg-warning">证件号码</th>
<tr> <td><?=$order_info->car_man_number?></td>
<td class="bg_tr">送单地址</td> <th class="bg-warning">联系电话</th>
<td colspan="3" class="td_bg"> <td><?=$order_info->car_man_phone?></td>
<?=$order_info->send_address?> </tr>
<tr>
<th class="bg-warning">被投保人</th>
<td><?=$order_info->id_man?></td>
<th class="bg-warning">证件类型</th>
<td><?=$order_info->id_man_type?></td>
<th class="bg-warning">证件号码</th>
<td><?=$order_info->id_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$order_info->id_man_phone?></td>
</tr>
<tr>
<th class="bg-warning">投保人</th>
<td><?=$order_info->link_man?></td>
<th class="bg-warning">证件类型</th>
<td><?=$order_info->link_man_type?></td>
<th class="bg-warning">证件号码</th>
<td><?=$order_info->link_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$order_info->link_man_phone?></td>
</tr>
<tr>
<th class="bg-warning" nowrap>商业起保日期</th>
<td><?=$order_info->insurer1_begin_date?></td>
<th class="bg-warning" nowrap>交强起保日期</th>
<td><?=$order_info->insurer2_begin_date?></td>
<th class="bg-warning">保险公司</th>
<td><?=$order_info->company->name?></td>
<th class="bg-warning">车辆使用性质</th>
<td><?=$order_info->car->carUse->name?></td>
</tr>
<tr>
<th class="bg-warning" nowrap>商业保单号</th>
<td><?=$order_info->insurer1_no?></td>
<th class="bg-warning" nowrap>商业PDF文件</th>
<td>
<?php if($order_info->shangye_src != '') { ?>
<a href="<?=$order_info->shangye_src?>"><i class="fa fa-image">保单</i></a>
<?php } ?>
<?php if($order_info->fapiao_src != '') { ?>
<a href="<?=$order_info->fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<?php } ?>
</td>
<th class="bg-warning">交强保单号</th>
<td><?=$order_info->insurer2_no?></td>
<th class="bg-warning">交强PDF文件</th>
<td>
<?php if($order_info->jiaoqiang_src != '') { ?>
<a href="<?=$order_info->jiaoqiang_src?>"><i class="fa fa-image">保单</i></a>
<?php } ?>
<?php if($order_info->jq_fapiao_src != '') { ?>
<a href="<?=$order_info->jq_fapiao_src?>"><i class="fa fa-file-pdf-o">发票</i></a>
<?php } ?>
</td> </td>
</tr> </tr>
</table> </table>
</TD> </div>
</TR> </div>
</TABLE> <div class="ibox float-e-margins">
<table> <div class="ibox-title">
<tbody> <h5>险种</h5>
<tr> </div>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(3) name="navcell">▼险种信息</TD> <div class="ibox-content">
</tr> <table class="table table-bordered">
</tbody>
</table>
<TABLE id=tb3 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<tr> <tr>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;">
<?php <?php
$xianzhong = '<tr><td class="bg_tr">险种</td>'; $len = count($insurer_type_items);
$neirong = '<tr><td class="bg_tr">内容</td>'; $index = 0;
$bujimianpei = '<tr><td class="bg_tr">不计免赔</td>'; for($i = 0; $i < $len; $i++) {
foreach ($new_array as $k=>$v){ $item = $insurer_type_items[$i];
$xianzhong .= "<td align='center' class='bg_tr'>".$v['zl']."</td>"; $order_id = $order_info->id;
$neirong .= "<td align='center' class='td_bg'>".$v['neir']."</td>"; if(!$order_id)
$bujimianpei .= "<td align='center' class='td_bg'>".$v['bjmp']."</td>"; $order_id = 0;
$tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$item->id)
->one();
if(!$tmp_row || $tmp_row->val == '' || $tmp_row->val == '否') continue;
?>
<th class="bg-warning">
<?=$item->name?>(<?=$item->code?>)
</th>
<td><?=$tmp_row->val?></td>
<td><?=($tmp_row->is_nopay == 1)?'不计免赔':''?></td>
<?php
if(($index+1)%3==0) {
echo '</tr>';
echo '<tr>';
}
$index++;
} }
echo $xianzhong.'</tr>'.$neirong.'</tr>'.$bujimianpei.'</tr>';
?> ?>
</table>
</td>
</tr>
</TABLE>
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(4) name="navcell">▼保费信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb4 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<tr>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;">
<tr>
<td class="bg_tr">商业总净保费</td>
<td class="td_bg"><?=$order_info->total1_clear?></td>
<td class="bg_tr">商业含税总保费</td>
<td class="td_bg"><?=$order_info->total1?></td>
<td class="bg_tr">交强总净保费</td>
<td class="td_bg"><?=$order_info->total2_clear?></td>
<td class="bg_tr">交强含税总保费</td>
<td class="td_bg"><?=$order_info->total2?></td>
</tr>
<tr>
<td class="bg_tr">车船税</td>
<td class="td_bg"><?=$order_info->total3?></td>
<td class="bg_tr">共计签单</td>
<td class="td_bg"><?=$order_info->total_all?></td>
<td class="bg_tr">折扣后商业净保费</td>
<td class="td_bg"><?=$order_info->total1_real?></td>
<td class="bg_tr">减免金额</td>
<td class="td_bg"><?=$order_info->total1_dis?></td>
</tr>
<tr>
<td class="bg_tr">商业折扣率</td>
<td class="td_bg"><?=$order_info->total1_percent?></td>
<td class="bg_tr">应收</td>
<td class="td_bg"><?=$order_info->total_real?></td>
<td class="bg_tr">商业手续费</td>
<td class="td_bg"><?=$order_info->total1_rate?></td>
<td class="bg_tr">交强手续费</td>
<td class="td_bg"><?=$order_info->total2_rate?></td>
</tr>
<tr>
<td class="bg_tr">备注</td>
<td colspan="7" class="td_bg"><?=$order_info->price_remark?></td>
</tr> </tr>
</table> </table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> </div>
<tr> </div>
<td class="bg_tr">商业补点比例</td> <div class="ibox float-e-margins">
<td class="td_bg"><input type="Text" name="budian_rate" id="budian_rate" value="<?=$caiwu_info->budian_rate?>" class="supplement_proportion" onblur="cal_money('budian_rate','<?=$order_info->total1_clear?>','budian_money');"/>%</td> <div class="ibox-title">
<td class="bg_tr">商业补点手续费</td> <h5>保费信息</h5>
<td class="td_bg"><input type="Text" name="budian_money" id="budian_money" value="<?=$caiwu_info->budian_money?>" readonly class="supplement_servicecharge" /></td> </div>
<td class="bg_tr"></td> <div class="ibox-content">
<td class="td_bg"></td> <table class="table table-bordered">
<td class="bg_tr"></td> <tr>
<td class="td_bg"></td> <th class="bg-warning">商业总净保费</th>
</tr> <td><?=$order_info->total1_clear?></td>
<tr> <th class="bg-warning">商业含税总保费</th>
<td class="bg_tr">商业退保保费</td> <td><?=$order_info->total1?></td>
<td class="td_bg"><input type="Text" name="business_back_money" id="business_back_money" value="<?=$caiwu_info->business_back_money?>" class="sy_tb_retreat" onblur="cal_money2('business_back_money','business_back_rate','business_back_routine');"/></td> <th class="bg-warning">车船税</th>
<td class="bg_tr">退保手续费比例</td> <td><?=$order_info->total3?></td>
<td class="td_bg"><input type="Text" name="business_back_rate" id="business_back_rate" value="<?=$caiwu_info->business_back_rate?>" class="sy_tb_bili" onblur="cal_money2('business_back_money','business_back_rate','business_back_routine');"/>%</td> </tr>
<td class="bg_tr">商业退保手续费</td> <tr>
<td class="td_bg"><input type="Text" name="business_back_routine" id="business_back_routine" value="<?=$caiwu_info->business_back_routine?>" class="jq_tb_routine" readonly /></td> <th class="bg-warning">交强总净保费</th>
<td class="bg_tr">商业退保日期</td> <td><?=$order_info->total2_clear?></td>
<td class="td_bg"><input type="Text" name="business_back_date" id="business_back_date" value="<?=$caiwu_info->business_back_date?>" class="Wdate" onClick="WdatePicker()" /></td> <th class="bg-warning">交强含税总保费</th>
</tr> <td><?=$order_info->total2?></td>
<tr> <th class="bg-warning">业务自付金额</th>
<td class="bg_tr">交强退保保费</td> <td><?=$order_info->yuangong_money?></td>
<td class="td_bg"><input type="Text" name="force_back_money" id="force_back_money" value="<?=$caiwu_info->force_back_money?>" class="jq_tb_retreat" onblur="cal_money2('force_back_money','force_back_rate','force_back_routine');"/></td> </tr>
<td class="bg_tr">退保手续费比例</td> <tr>
<td class="td_bg"><input type="Text" name="force_back_rate" id="force_back_rate" value="<?=$caiwu_info->force_back_rate?>" class="jq_tb_bili" onblur="cal_money2('force_back_money','force_back_rate','force_back_routine');"/>%</td> <th class="bg-warning">折扣后商业净保费</th>
<td class="bg_tr">交强退保手续费</td> <td><?=$order_info->total1_real?></td>
<td class="td_bg"><input type="Text" name="force_back_routine" id="force_back_routine" value="<?=$caiwu_info->force_back_routine?>" class="jq_tb_routine" readonly /></td> <th class="bg-warning">减免金额</th>
<td class="bg_tr">交强退保日期</td> <td><?=$order_info->total1_dis?></td>
<td class="td_bg"><input type="Text" name="force_back_date" id="force_back_date" value="<?=$caiwu_info->force_back_date?>" class="Wdate" onClick="WdatePicker()" /></td> <th class="bg-warning">商业折扣率</th>
<td><?=$order_info->total1_percent?></td>
</tr>
<tr>
<th class="bg-warning">共计签单</th>
<td><?=$order_info->total_all?></td>
<th class="bg-warning">应收</th>
<td><?=$order_info->total_real?></td>
<th class="bg-warning">支付方式</th>
<td><?=$order_info->payType ? $order_info->payType->name : ''?></td>
</tr>
<tr>
<th class="bg-warning">备注</th>
<td colspan="5"><?=$order_info->price_remark?></td>
</tr> </tr>
</table> </table>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>返现信息</h5>
</div>
<div class="ibox-content">
<table class="table table-bordered">
<tr>
<th class="bg-warning">应免金额</th>
<td><?=$order_info->total1_dis?></td>
<th class="bg-warning">业务自付金额</th>
<td><?=$order_info->yuangong_money?></td>
<th class="bg-warning">实返金额</th>
<td><?=number_format($order_info->total1_dis + $order_info->yuangong_money,2)?></td>
<th class="bg-warning"></th>
<td></td>
</tr>
<tr>
<th class="bg-warning">领款人</th>
<td>
<input type="text" name="money_man" value="<?=$caiwu_info->money_man?>" class="form-control">
</td>
<th class="bg-warning">开户行</th>
<td>
<input type="text" name="money_bank" value="<?=$caiwu_info->money_bank?>" class="form-control">
</td>
<th class="bg-warning">银行账号</th>
<td>
<input type="text" name="money_no" value="<?=$caiwu_info->money_no?>" class="form-control">
</td>
<th class="bg-warning">转账日期</th>
<td>
<input type="text" name="transfer_date" id="transfer_date" value="<?=$caiwu_info->transfer_date?>" class="form-control">
</td> </td>
</tr>
</TABLE>
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-on id=navcell onclick=open_up(5) name="navcell">▼财务信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb5 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<tr>
<td valign="top">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout:fixed;">
<tr>
<td class="bg_tr"><span style="color:#ff0000">*</span>领款人</td>
<td class="td_bg"><input name="money_man" id="money_man" type="text" value="<?=$caiwu_info->money_man?>" style="width:120px;"></td>
<td class="bg_tr"><span style="color:#ff0000">*</span>银行账号</td>
<td class="td_bg"><input name="money_no" id="money_no" type="text" value="<?=$caiwu_info->money_no?>" style="width:120px;"></td>
<td class="bg_tr"><span style="color:#ff0000">*</span>开户行</td>
<td class="td_bg"><input name="money_bank" id="money_bank" type="text" value="<?=$caiwu_info->money_bank?>" style="width:120px;"></td>
</tr> </tr>
<tr> <tr>
<td class="bg_tr">转账日期</td> <th class="bg-warning">转账金额</th>
<td class="td_bg"><input class="Wdate" name="transfer_date" id="transfer_date" type="text" value="<?=$caiwu_info->transfer_date?>" style="width:120px;" onClick="WdatePicker()"></td> <td>
<td class="bg_tr">转账金额</td> <input type="text" name="transfer_money" value="<?=$caiwu_info->transfer_money>0?$caiwu_info->transfer_money:round($order_info->total1_dis+$order_info->yuangong_money,2)?>" class="form-control">
<td class="td_bg"><input name="transfer_money" id="transfer_money" type="text" value="<?=$caiwu_info->transfer_money>0?$caiwu_info->transfer_money:$order_info->total1_dis?>" style="width:120px;"></td> </td>
<td class="bg_tr">转账银行</td> <th class="bg-warning">转账银行</th>
<td class="td_bg"> <td>
<select name="transfer_bank_id"> <select name="transfer_bank_id" class="form-control">
<?php <?php
foreach($banks as $bank) { foreach($banks as $bank) {
echo '<option value="'.$bank->id.'"'; echo '<option value="'.$bank->id.'"';
@ -273,13 +240,13 @@ use \common\models\PriceT;
?> ?>
</select> </select>
</td> </td>
</tr> <th class="bg-warning">银行流水号</th>
<tr> <td>
<td class="bg_tr">银行流水号</td> <input type="text" name="transfer_bank_no" value="<?=$caiwu_info->transfer_bank_no?>" class="form-control">
<td colspan="3" class="td_bg"><input name="transfer_bank_no" id="transfer_bank_no" type="text" value="<?=$caiwu_info->transfer_bank_no?>" style="width:200px;"></td> </td>
<td class="bg_tr">转账状态</td> <th class="bg-warning">转账状态</th>
<td class="td_bg"> <td>
<select name="caiwu_status_id"> <select name="caiwu_status_id" class="form-control">
<?php <?php
echo '<option value="0">无操作</option>'; echo '<option value="0">无操作</option>';
foreach($caiwu_status as $item){ foreach($caiwu_status as $item){
@ -292,280 +259,124 @@ use \common\models\PriceT;
</td> </td>
</tr> </tr>
</table> </table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <div>
<tr> <div class="row">
<td class="bg_tr" align="center">新保:<?=$car_info->op_user1?></td> <div class="col-sm-12 text-center">
<?php <button type="button" class="btn btn-primary btn-cancel" type="button">
if($car_info->op_user3 != '') { <strong>放弃处理</strong>
?> </button>
<td class="bg_tr" align="center">跟踪:<?=$car_info->op_user2?></td> <button type="button" class="btn btn-primary btn-save" type="button">
<td class="bg_tr" align="center">续保:<?=$car_info->op_user3?></td> <strong>保 存</strong>
<?php </button>
} <button type="button" class="btn btn-primary btn-submit" type="button">
?> <strong>提 交</strong>
<td class="bg_tr" align="center">送单费:<?=$order_info->sendLog?$order_info->sendLog->user->getShowName():''?></td> </button>
<?php </div>
if($order_info->op1_id > 0) { </div>
echo '<td class="bg_tr" align="center">核保:'.$order_info->op1->getShowName().'</td>'; </div>
} </div>
if($order_info->op2_id > 0) { </div>
echo '<td class="bg_tr" align="center">正本:'.$order_info->op2->getShowName().'</td>'; <div class="ibox float-e-margins">
} <div class="ibox-title">
?> <h5>操作记录</h5>
</tr> <div class="ibox-tools">
<tr> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#logTable').bootstrapTable('refresh');">
<td class="bg_tr" align="center">新保比例</td> <i class="fa fa-refresh"></i> 刷新
<?php </a>
if($car_info->op_user3 != '') { </div>
?> </div>
<td class="bg_tr" align="center">跟踪比例</td> <div class="ibox-content">
<td class="bg_tr" align="center">续保比例</td> <table id="logTable">
<?php <thead>
} <tr>
?> <th data-field="op_man">操作者</th>
<td class="bg_tr" align="center">送单比例</td> <th data-field="op_time">操作时间</th>
<?php if($order_info->op1_id > 0) { ?> <th data-field="remark">操作内容</th>
<td class="bg_tr" align="center">核保比例</td> </tr>
<?php } ?> </thead>
<?php if($order_info->op2_id > 0) { ?>
<td class="bg_tr" align="center">正本比例</td>
<?php } ?>
</tr>
<tr>
<?php
if($car_info->op_user3 != '') {
?>
<td class="td_bg" align="center"><input name="rate1" id="rate1" type="text" value="<?=$caiwu_info->rate1?>" style="width:50px;" onblur="cal_money('rate1','<?=$order_info->total1_clear?>','money1','0')">%</td>
<td class="td_bg" align="center"><input name="rate2" id="rate2" type="text" value="<?=$caiwu_info->rate2?>" style="width:50px;" onblur="cal_money('rate2','<?=$order_info->total1_clear?>','money2','0')">%</td>
<td class="td_bg" align="center"><input name="rate3" id="rate3" type="text" value="<?=$caiwu_info->rate3?>" style="width:50px;" onblur="cal_money('rate3','<?=$order_info->total1_clear?>','money3','<?=$order_info->total1_dis?>')">%</td>
<?php
} else {
?>
<td class="td_bg" align="center"><input name="rate1" id="rate1" type="text" value="<?=$caiwu_info->rate1?>" style="width:50px;" onblur="cal_money('rate1','<?=$order_info->total1_clear?>','money1','<?=$order_info->total1_dis?>')">%</td>
<?php
}
?>
<td class="td_bg" align="center"><input name="send_rate" id="send_rate" type="text" value="<?=$caiwu_info->send_rate?>" style="width:100px;" readonly>%</td>
<?php if($order_info->op1_id > 0) { ?>
<td class="td_bg" align="center"><input name="rate4" id="rate4" type="text" value="<?=$caiwu_info->rate4?>" style="width:100px;" onblur="cal_money('rate4','<?=$order_info->total1_clear?>','money4','0')">%</td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="td_bg" align="center"><input name="rate5" id="rate5" type="text" value="<?=$caiwu_info->rate5?>" style="width:100px;" onblur="cal_money('rate5','<?=$order_info->total1_clear?>','money5','0')">%</td>
<?php } ?>
</tr>
<tr>
<td class="bg_tr" align="center">新保提成</td>
<?php
if($car_info->op_user3 != '') {
?>
<td class="bg_tr" align="center">跟踪提成</td>
<td class="bg_tr" align="center">续保提成</td>
<?php
}
?>
<td class="bg_tr" align="center">送单提成</td>
<?php if($order_info->op1_id > 0) { ?>
<td class="bg_tr" align="center">核保提成</td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="bg_tr" align="center">正本提成</td>
<?php } ?>
</tr>
<tr>
<?php
if($car_info->op_user3 != '') {
?>
<td class="td_bg" align="center"><input name="money1" id="money1" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate1)?>" style="width:100px;" readonly></td>
<td class="td_bg" align="center"><input name="money2" id="money2" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate2)?>" style="width:100px;" readonly></td>
<td class="td_bg" align="center"><input name="money3" id="money3" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate3)?>" style="width:100px;" readonly></td>
<?php
} else {
?>
<td class="td_bg" align="center"><input name="money1" id="money1" type="text" value="<?=$caiwu_info->getPay($caiwu_info->rate1)?>" style="width:100px;" readonly></td>
<?php
}
?>
<td class="td_bg" align="center"><input name="send_money" id="send_money" type="text" value="<?=$caiwu_info->send_money?>" style="width:100px;" onblur="cal_rate('send_money','<?=$order_info->total1_clear?>','send_rate','0')"></td>
<?php if($order_info->op1_id > 0) { ?>
<td class="td_bg" align="center"><input name="money4" id="money4" type="text" value="<?=$caiwu_info->money4?>" style="width:100px;" onblur="cal_rate('money4','<?=$order_info->total1_clear?>','rate4','0')"></td>
<?php } ?>
<?php if($order_info->op2_id > 0) { ?>
<td class="td_bg" align="center"><input name="money5" id="money5" type="text" value="<?=$caiwu_info->money5?>" style="width:100px;" onblur="cal_rate('money5','<?=$order_info->total1_clear?>','rate5','0')"></td>
<?php } ?>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="6" class="bg_tr">实物</td>
</tr>
<tr>
<?php
$index = 0;
foreach($sel_gifts as $order_gift) {
if($order_gift->gift->type == 1) continue;
if($index > 0 && $index%3 == 0) {
echo '</tr><tr>';
}
?>
<td width="250" class="bg_tr"><?=$order_gift->gift->name?></td>
<td class="td_bg">
<input type="hidden" name="gift_ids[]" value="<?=$order_gift->id?>">
<input type="hidden" name="gift_rates[]" value="0">
<input name="gift_prices[]" type="text" value="<?=$order_gift->price?>" style="width:60px;">
</td>
<?php
$index++;
}
if($index>0) {
while($index%3!=0) {
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
$index++;
}
}
?>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="9" class="bg_tr">礼券</td>
</tr>
<tr>
<?php
$index = 0;
foreach($sel_gifts as $order_gift) {
if($order_gift->gift->type == 0) continue;
if($index > 0 && $index%3 == 0) {
echo '</tr><tr>';
}
$index++;
?>
<td width="150" class="bg_tr"><?=$order_gift->gift->name?></td>
<td class="td_bg">
<input type="hidden" name="gift_ids[]" value="<?=$order_gift->id?>">
<input name="gift_rates[]" id="gift_rates_<?=$order_gift->id?>" type="text" value="<?=$order_gift->rate?>" style="width:60px;" onblur="cal_money('gift_rates_<?=$order_gift->id?>','<?=$order_info->total1_clear?>','gift_prices_<?=$order_gift->id?>','0')">%
</td>
<td class="td_bg">
<input name="gift_prices[]" id="gift_prices_<?=$order_gift->id?>" type="text" value="<?=$order_gift->price?>" style="width:60px;" readonly>
</td>
<?php
}
if($index>0) {
while($index%3!=0) {
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
echo '<td class="td_bg"></td>';
$index++;
}
}
?>
</tr>
</table>
</td>
</tr>
</TABLE>
<!--操作记录-->
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(6) name="navcell">▲操作记录</TD>
</tr>
</tbody>
</table>
<TABLE id=tb6 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<div id="car_history_list"></div>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table> </table>
</div>
</div>
</form> </form>
</td> </div>
</tr>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="cancel-btn" type=button class="ACT_btn" name=Submit4 value=" 放弃处理 "/>
&nbsp;&nbsp;
<input id="save-btn" type=button class="ACT_btn" name=Submit1 value=" 保存 "/>
&nbsp;&nbsp;
<input id="submit-btn" type=button class="ACT_btn" name=Submit2 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit3" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" language="javascript" src="/js/common2.js"></script> <script>
<script type="text/javascript" language="javascript"> var o = {};
//计算提成 //判断是否填写了选项
function cal_money(obj1,val,obj2) { function isNull(data){
var total = Number($('#' + obj1).val())/100 * Number(val); if(data == "" || data == undefined || data == null){
$('#' + obj2).val(total.toFixed(2)); return true;
}else{
return false;
} }
//计算
function cal_money2(obj1,obj2,obj3,dis) {
var total = Number($('#'+obj2).val())/100 * Number($('#' + obj1).val());
$('#' + obj3).val(total.toFixed(2));
} }
function cal_rate(obj1,val,obj3,dis) { //保存订单
if(Number(val) == 0) { function saveOrder(status_id) {
$('#' + obj3).val('0.00'); var params = $('#orderFrm').serialize();
return; params = params + '&status_id=' + status_id;
$.post('/insurer/finance-mng-save',params,function(obj){
parent.layer.msg(obj.msg);
if(obj.success && status_id==10) {
parent.refreshList();
layer_close();
} }
var rate = (Number($('#' + obj1).val()))/Number(val) * 100 ; },'json');
$('#' + obj3).val(rate.toFixed(2));
} }
//保单处理 //操作记录
function SaveOrder(status_id) { function searchOps() {
var param = $('#orderFrm').serialize(); $('#logTable').bootstrapTable('destroy');
param = param + '&status_id=' + status_id; $('#logTable').bootstrapTable({
$.post('/insurer/finance-mng-save',param,function(obj){ url: "/car/history-json",
if(obj.success) { pagination: true,
if(status_id == 13) sidePagination: 'server',
$('#back-btn').click(); multipleSelectRow: true,
else queryParams: function(params) {
alert(obj.msg); o['car_id'] = '<?=$order_info->car_id?>';
} else { o['limit'] = params['limit'];
alert(obj.msg); o['offset'] = params['offset'];
return o;
} }
},'json'); });
} }
$(function() { $(function() {
//操作历史 searchOps();
gotoPage('/car/ajax-history-index-xubao?car_id=<?=$car_info->id?>&page=1','car_history_list'); $('#transfer_date').datepicker({
//放弃处理 todayBtn: "linked",
$('#cancel-btn').click(function(){ keyboardNavigation: false,
if(confirm('是否确认放弃处理?')) { forceParse: false,
calendarWeeks: true,
autoclose: true
});
$('.btn-cancel').click(function(){
parent.layer.confirm('是否确认放弃处理?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/insurer/finance-cancel-save',{order_id:<?=$order_info->id?>},function(obj){ $.post('/insurer/finance-cancel-save',{order_id:<?=$order_info->id?>},function(obj){
parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); parent.refreshList();
} else { layer_close();
alert(obj.msg);
} }
},'json'); },'json');
} }, function(){
//
}); });
//保存
$('#save-btn').click(function(){
SaveOrder(12);
}); });
//提交 $('.btn-save').click(function(){
$('#submit-btn').click(function(){ saveOrder(12);
if(confirm('是否提交此保单?')) {
SaveOrder(13);
}
}); });
$('.btn-submit').click(function(){
//返回 saveOrder(10);
$('#back-btn').click(function(){
window.location.href = '/insurer/finance-mng?<?=$back_params?>';
}); });
}); });
</script> </script>
<?php $this->endBlock(); ?>

@ -34,50 +34,23 @@ use \common\libs\MyLib;
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th width="50" data-field="username1">ID</th> <th data-width="50" data-field="id">ID</th>
<th data-field="usernamae2">被保险人</th> <th data-field="id_man">被保险人</th>
<th data-field="usernamae3">联系电话</th> <th data-field="id_man_phone">联系电话</th>
<th data-field="usernamae4">保险公司</th> <th data-field="company_name">保险公司</th>
<th data-field="usernamae5">车牌号</th> <th data-field="car_no">车牌号</th>
<th data-field="usernamae6">正本日期</th> <th data-field="print_date">正本日期</th>
<th data-field="usernamae7">级别</th> <th data-field="path">级别</th>
<th data-field="usernamae8">销售座席</th> <th data-field="user_name">销售座席</th>
<th data-field="usernamae9">商业净保费</th> <th data-field="total1_clear">商业净保费</th>
<th data-field="usernamae18">公司返金额</th> <th data-field="total1_dis">公司返金额</th>
<th data-field="usernamaed">业务自付</th> <th data-field="yuangong_money">业务自付</th>
<th data-field="usernamaew">实返现金额</th> <th data-field="total_user_real">实返现金额</th>
<th data-field="usernamaee">转账时间</th> <th data-field="transfer_date">转账时间</th>
<th data-field="usernamaei">转账状态</th> <th data-field="caiwu_status_name">转账状态</th>
<th data-field="usernamaex">支付方式</th> <th data-field="status_name">状态</th>
<th data-field="usernamaeo">状态</th> <th data-field="lock_man">当前操作</th>
<th data-field="usernamae11">当前操作</th> <th data-formatter="opFormatter" data-width="150">操作</th>
<th data-formatter="opFormatter">操作</th>
</tr>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><?=$start_index+1?></td>
<td class="td_bg" nowrap><?=MyLib::substr_cut($item->id_man,20)?></td>
<td class="td_bg" nowrap><?=$item->link_phone?></td>
<td class="td_bg" nowrap><?=$item->company?$item->company->name:''?></td>
<td class="td_bg" nowrap><?=$item->car_no?></td>
<td class="td_bg" nowrap><?=$item->print_date?></td>
<td align="center" class="td_bg" nowrap><?=$nams?></td>
<td class="td_bg" ><?=$item->user?$item->user->getShowName():''?>&nbsp;</td>
<td class="td_bg" ><?=$item->total1_clear?></td>
<td class="td_bg" ><?=$item->total1_dis?></td>
<td class="td_bg" ><?=$item->yuangong_money?></td>
<td class="td_bg" ><?=$item->non_total1_dis?></td>
<td class="td_bg" ><?=$item->total1_dis + $item->yuangong_money?></td>
<td class="td_bg" ><?=$caiwu->transfer_date?></td>
<td class="td_bg" ><?=$caiwu->caiwuStatus ? $caiwu->caiwuStatus->name : ''?></td>
<td class="td_bg" align="center" nowrap><?=$item->shoufei_id?MyLib::zhifufs($item->shoufei_id).'-':''?><?=$item->payType?$item->payType->name:''?></td>
<td class="td_bg" ><?=$caiwu->status->name?></td>
<td class="td_bg" ><?=$caiwu->lock?$caiwu->lock->getShowName():''?></td>
<td align="center" class="td_bg" nowrap>
<!-- //if($caiwu->status_id == 12){ ?>-->
[<a href="javascript:void(0);" onclick="unlock(<?=$item->id?>)">解锁</a>]
[<a href="javascript:void(0);" onclick="info(<?=$item->id?>)">详情</a>]
<!-- - //} ?>-->
</td>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -96,9 +69,11 @@ use \common\libs\MyLib;
var o = {}; var o = {};
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
if(row.lock_man != '') {
opStr.push('<a href="javascript:void(0);" onclick="unlock(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="unlock(' + row.id + ')">');
opStr.push('<i class="fa fa-unlock" title="解锁"></i>'); opStr.push('<i class="fa fa-unlock" title="解锁"></i>');
opStr.push('</a>'); opStr.push('</a>');
}
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-file-o" title="详情"></i>'); opStr.push('<i class="fa fa-file-o" title="详情"></i>');
opStr.push('</a>'); opStr.push('</a>');
@ -107,14 +82,14 @@ use \common\libs\MyLib;
} }
function info(id) { function info(id) {
title = '详情'; title = '详情';
layer_show(title, '/car-type/edit?id=0'); layer_show(title, '/insurer/finance-mng-edit?id='+id);
} }
function unlock(id) { function unlock(id) {
parent.layer.confirm('是否确认删除?', { parent.layer.confirm('是否确认解锁?', {
btn: ['删除','取消'], //按钮 btn: ['解锁','取消'], //按钮
shade: false //不显示遮罩 shade: false //不显示遮罩
}, function(){ }, function(){
$.post('/car-type/delete',{id:id},function(data) { $.post('/insurer/unlocked',{id:id},function(data) {
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
refreshList(); refreshList();
}, 'json'); }, 'json');

Loading…
Cancel
Save