完成返现管理功能开发

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

@ -2400,109 +2400,6 @@ class InsurerController extends BaseController
* 出纳办结-列表
* @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() {
return $this->render('finance-mng');
}
@ -2626,7 +2523,15 @@ class InsurerController extends BaseController
$data['rows'] = [];
foreach($items as $item) {
$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;
}
@ -2803,7 +2708,6 @@ class InsurerController extends BaseController
$order_info = OrderT::findOne(['id'=>$id]);
$car_info = $order_info->car;
$caiwu_info = $order_info->caiwu;
if($caiwu_info->lock_id == 0) {
$tran = OrderCaiwuT::getDb()->beginTransaction();
try {
@ -2864,10 +2768,12 @@ class InsurerController extends BaseController
$tmp_row = PriceT::find()
->where('order_id='.$order_id.' and type_id='.$v->id)
->one();
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]['neir'] = $tmp_row->val;
$new_array[$k]['bjmp'] = $tmp_row->is_nopay==1?'是':'';
if($tmp_row) {
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]['neir'] = $tmp_row->val;
$new_array[$k]['bjmp'] = $tmp_row->is_nopay == 1 ? '是' : '';
}
}
}
@ -3076,33 +2982,8 @@ class InsurerController extends BaseController
$transfer_money = $request->post('transfer_money');
$transfer_bank_id = $request->post('transfer_bank_id');
$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');
$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');
$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();
try {
@ -3120,213 +3001,36 @@ class InsurerController extends BaseController
$caiwu_info->transfer_money = $transfer_money;
$caiwu_info->transfer_bank_id = $transfer_bank_id;
$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;
$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) {
$result['success'] = false;
$result['msg'] = '请先保存成功后,再点提交按钮!';
return $result;
}
$caiwu_info->lock_id = 0;
$this->addLog($caiwu_info->order->car_id,'返现管理完成',1);
}
$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;
// $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);
}
//处理操作人员状态
$order_user_info = OrderUserT::findOne(['order_id'=>$caiwu_info->order_id,'user_id'=>$this->my->id,'type_id'=>$old_status_id,'status'=>0]);
if($order_user_info) {
$order_user_info->status = 1; //操作结束
$order_user_info->save();
}
if(!$caiwu_info->save()) {
throw new \Exception(print_r($caiwu_info->getErrors(), true));
}
$caiwu_info->save();
$tran->commit();
$result['success'] = true;
$result['msg'] = '保存成功';
$tran->commit();
} catch(\Throwable $e) {
$tran->rollBack();
file_put_contents('log.txt',$e->getMessage());
throw $e;
$result['msg'] = $e->getMessage();
}
}
return $result;
@ -4229,6 +3933,9 @@ class InsurerController extends BaseController
}
$tran->commit();
$result['success'] = true;
$result['msg'] = '放弃成功';
} catch (\Exception $e) {
$tran->rollBack();
throw $e;

@ -1,571 +1,382 @@
<?php
use \common\libs\MyLib;
use \common\models\PriceT;
use common\models\PriceT;
?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td height="22" colspan="2" class="td_bg">
<form id="orderFrm">
<table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable">
<tr>
<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?>">
<tr>
<td class="bg_tr">被保险人</td>
<td class="td_bg"><?=$order_info->id_man?></td>
<td class="bg_tr">证件号码</td>
<td class="td_bg"><?=$order_info->id_number?></td>
<td width="60" class="bg_tr">联系人</td>
<td class="td_bg"><?=$order_info->link_man?></td>
<td width="60" class="bg_tr">联系电话</td>
<td class="td_bg"><?=$order_info->link_phone?></td>
</tr>
<tr>
<td class="bg_tr">保险公司</td>
<td class="td_bg"><?=$order_info->company?$order_info->company->name:''?></td>
<td class="bg_tr">付款方式</td>
<td class="td_bg"><?=$order_info->shoufei_id?MyLib::zhifufs($order_info->shoufei_id).'-':''?><?=$order_info->payType?$order_info->payType->name:''?></td>
<td class="bg_tr">电子邮件</td>
<td class="td_bg"><?=$order_info->email?></td>
</tr>
<tr>
<td class="bg_tr">商业起保日期</td>
<td class="td_bg"><?=$order_info->insurer1_begin_date?></td>
<td class="bg_tr">交强起保日期</td>
<td class="td_bg"><?=$order_info->insurer2_begin_date?></td>
<td class="bg_tr">缴费单号</td>
<td colspan="3" class="td_bg"><?=$order_info->pay_no?></td>
</tr>
<tr>
<td class="bg_tr">商业保单号</td>
<td class="td_bg"><?=$order_info->insurer1_no?></td>
<td class="bg_tr">交强保单号</td>
<td class="td_bg"><?=$order_info->insurer2_no?></td>
<td rowspan="3" class="bg_tr" valign="center">备注</td>
<td colspan="3" rowspan="3" valign="top" class="td_bg"><?=$order_info->remark?></td>
</tr>
<tr>
<td class="bg_tr">送单地址</td>
<td colspan="3" class="td_bg">
<?=$order_info->send_address?>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-off id=navcell onclick=open_up(3) name="navcell">▼险种信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb3 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;">
<?php
$xianzhong = '<tr><td class="bg_tr">险种</td>';
$neirong = '<tr><td class="bg_tr">内容</td>';
$bujimianpei = '<tr><td class="bg_tr">不计免赔</td>';
foreach ($new_array as $k=>$v){
$xianzhong .= "<td align='center' class='bg_tr'>".$v['zl']."</td>";
$neirong .= "<td align='center' class='td_bg'>".$v['neir']."</td>";
$bujimianpei .= "<td align='center' class='td_bg'>".$v['bjmp']."</td>";
}
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>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="bg_tr">商业补点比例</td>
<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>
<td class="bg_tr">商业补点手续费</td>
<td class="td_bg"><input type="Text" name="budian_money" id="budian_money" value="<?=$caiwu_info->budian_money?>" readonly class="supplement_servicecharge" /></td>
<td class="bg_tr"></td>
<td class="td_bg"></td>
<td class="bg_tr"></td>
<td class="td_bg"></td>
</tr>
<tr>
<td class="bg_tr">商业退保保费</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>
<td class="bg_tr">退保手续费比例</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>
<td class="bg_tr">商业退保手续费</td>
<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>
<td class="bg_tr">商业退保日期</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>
</tr>
<tr>
<td class="bg_tr">交强退保保费</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>
<td class="bg_tr">退保手续费比例</td>
<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>
<td class="bg_tr">交强退保手续费</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>
<td class="bg_tr">交强退保日期</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>
</tr>
</table>
</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>
<td class="bg_tr">转账日期</td>
<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 class="bg_tr">转账金额</td>
<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 class="bg_tr">转账银行</td>
<td class="td_bg">
<select name="transfer_bank_id">
<?php
foreach($banks as $bank) {
echo '<option value="'.$bank->id.'"';
if($bank->id == $caiwu_info->transfer_bank_id)
echo ' selected ';
echo '>'.$bank->name.'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td class="bg_tr">银行流水号</td>
<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 class="bg_tr">转账状态</td>
<td class="td_bg">
<select name="caiwu_status_id">
<?php
echo '<option value="0">无操作</option>';
foreach($caiwu_status as $item){
echo '<option value="'.$item->id.'"';
echo $caiwu_info->caiwu_status_id == $item->id ? ' selected' : '';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="bg_tr" align="center">新保:<?=$car_info->op_user1?></td>
<?php
if($car_info->op_user3 != '') {
?>
<td class="bg_tr" align="center">跟踪:<?=$car_info->op_user2?></td>
<td class="bg_tr" align="center">续保:<?=$car_info->op_user3?></td>
<?php
}
?>
<td class="bg_tr" align="center">送单费:<?=$order_info->sendLog?$order_info->sendLog->user->getShowName():''?></td>
<?php
if($order_info->op1_id > 0) {
echo '<td class="bg_tr" align="center">核保:'.$order_info->op1->getShowName().'</td>';
}
if($order_info->op2_id > 0) {
echo '<td class="bg_tr" align="center">正本:'.$order_info->op2->getShowName().'</td>';
}
?>
</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="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>
</form>
</td>
</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>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<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" src="/js/common2.js"></script>
<script type="text/javascript" language="javascript">
//计算提成
function cal_money(obj1,val,obj2) {
var total = Number($('#' + obj1).val())/100 * Number(val);
$('#' + obj2).val(total.toFixed(2));
}
//计算
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) {
$('#' + obj3).val('0.00');
return;
<div class="wrapper wrapper-content animated fadeInRight">
<form class="form-horizontal" id="orderFrm">
<input type="hidden" name="car_id" value="<?=$order_info->car_id?>">
<input type="hidden" name="order_id" value="<?=$order_info->id?>">
<input type="hidden" name="celuo_id" value="<?=$order_info->celuo_id?>">
<input type="hidden" name="fanxian_id" value="<?=$order_info->fanxian_id?>">
<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->car_no?></td>
<th class="bg-warning" nowrap>初登日期</th>
<td><?=$car_info->register_date?></td>
<th class="bg-warning" nowrap>座位数</th>
<td><?=$order_info->seats?></td>
<th class="bg-warning" nowrap>电子邮件</th>
<td><?=$order_info->email?></td>
</tr>
<tr>
<th class="bg-warning">车型</th>
<td><?=$order_info->factory_model?></td>
<th class="bg-warning" nowrap>发动机号</th>
<td><?=$order_info->engine_no?></td>
<th class="bg-warning" nowrap>车架号</th>
<td><?=$order_info->car_frame_no?></td>
<th class="bg-warning" nowrap>新车购置价</th>
<td><?=$order_info->purchase_price?></td>
</tr>
<tr>
<th class="bg-warning">车主</th>
<td><?=$order_info->car_man?></td>
<th class="bg-warning">证件类型</th>
<td><?=$order_info->car_man_type?></td>
<th class="bg-warning">证件号码</th>
<td><?=$order_info->car_man_number?></td>
<th class="bg-warning">联系电话</th>
<td><?=$order_info->car_man_phone?></td>
</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>
</tr>
</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>
<?php
$len = count($insurer_type_items);
$index = 0;
for($i = 0; $i < $len; $i++) {
$item = $insurer_type_items[$i];
$order_id = $order_info->id;
if(!$order_id)
$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++;
}
?>
</tr>
</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_clear?></td>
<th class="bg-warning">商业含税总保费</th>
<td><?=$order_info->total1?></td>
<th class="bg-warning">车船税</th>
<td><?=$order_info->total3?></td>
</tr>
<tr>
<th class="bg-warning">交强总净保费</th>
<td><?=$order_info->total2_clear?></td>
<th class="bg-warning">交强含税总保费</th>
<td><?=$order_info->total2?></td>
<th class="bg-warning">业务自付金额</th>
<td><?=$order_info->yuangong_money?></td>
</tr>
<tr>
<th class="bg-warning">折扣后商业净保费</th>
<td><?=$order_info->total1_real?></td>
<th class="bg-warning">减免金额</th>
<td><?=$order_info->total1_dis?></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>
</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>
</tr>
<tr>
<th class="bg-warning">转账金额</th>
<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>
<th class="bg-warning">转账银行</th>
<td>
<select name="transfer_bank_id" class="form-control">
<?php
foreach($banks as $bank) {
echo '<option value="'.$bank->id.'"';
if($bank->id == $caiwu_info->transfer_bank_id)
echo ' selected ';
echo '>'.$bank->name.'</option>';
}
?>
</select>
</td>
<th class="bg-warning">银行流水号</th>
<td>
<input type="text" name="transfer_bank_no" value="<?=$caiwu_info->transfer_bank_no?>" class="form-control">
</td>
<th class="bg-warning">转账状态</th>
<td>
<select name="caiwu_status_id" class="form-control">
<?php
echo '<option value="0">无操作</option>';
foreach($caiwu_status as $item){
echo '<option value="'.$item->id.'"';
echo $caiwu_info->caiwu_status_id == $item->id ? ' selected' : '';
echo '>'.$item->name.'</option>';
}
?>
</select>
</td>
</tr>
</table>
<div>
<div class="row">
<div class="col-sm-12 text-center">
<button type="button" class="btn btn-primary btn-cancel" type="button">
<strong>放弃处理</strong>
</button>
<button type="button" class="btn btn-primary btn-save" type="button">
<strong>保 存</strong>
</button>
<button type="button" class="btn btn-primary btn-submit" type="button">
<strong>提 交</strong>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>操作记录</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#logTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<table id="logTable">
<thead>
<tr>
<th data-field="op_man">操作者</th>
<th data-field="op_time">操作时间</th>
<th data-field="remark">操作内容</th>
</tr>
</thead>
</table>
</div>
</div>
</form>
</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>
var o = {};
//判断是否填写了选项
function isNull(data){
if(data == "" || data == undefined || data == null){
return true;
}else{
return false;
}
var rate = (Number($('#' + obj1).val()))/Number(val) * 100 ;
$('#' + obj3).val(rate.toFixed(2));
}
//保单处理
function SaveOrder(status_id) {
var param = $('#orderFrm').serialize();
param = param + '&status_id=' + status_id;
$.post('/insurer/finance-mng-save',param,function(obj){
if(obj.success) {
if(status_id == 13)
$('#back-btn').click();
else
alert(obj.msg);
} else {
alert(obj.msg);
//保存订单
function saveOrder(status_id) {
var params = $('#orderFrm').serialize();
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();
}
},'json');
}
$(function(){
//操作历史
gotoPage('/car/ajax-history-index-xubao?car_id=<?=$car_info->id?>&page=1','car_history_list');
//放弃处理
$('#cancel-btn').click(function(){
if(confirm('是否确认放弃处理?')) {
//操作记录
function searchOps() {
$('#logTable').bootstrapTable('destroy');
$('#logTable').bootstrapTable({
url: "/car/history-json",
pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['car_id'] = '<?=$order_info->car_id?>';
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
});
}
$(function() {
searchOps();
$('#transfer_date').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
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){
parent.layer.msg(obj.msg);
if(obj.success) {
$('#back-btn').click();
} else {
alert(obj.msg);
parent.refreshList();
layer_close();
}
},'json');
}
}, function(){
//
});
});
//保存
$('#save-btn').click(function(){
SaveOrder(12);
$('.btn-save').click(function(){
saveOrder(12);
});
//提交
$('#submit-btn').click(function(){
if(confirm('是否提交此保单?')) {
SaveOrder(13);
}
});
//返回
$('#back-btn').click(function(){
window.location.href = '/insurer/finance-mng?<?=$back_params?>';
$('.btn-submit').click(function(){
saveOrder(10);
});
});
</script>
</script>
<?php $this->endBlock(); ?>

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

Loading…
Cancel
Save