客户查询详情页

dev
zhaocheng 5 years ago
parent c1ed07b736
commit 3366f57c9f
  1. 74
      frontend/controllers/InsurerController.php
  2. 901
      frontend/views/car/info-track.php
  3. 3
      frontend/views/car/search.php
  4. 1035
      frontend/views/insurer/info.php
  5. 296
      frontend/views/insurer/search.php

@ -176,8 +176,14 @@ class InsurerController extends BaseController
// 'nonitems' => $nonitems
// ]);
// }
public function actionInfo()
public function actionInfo() {
return $this->render('info');
}
public function actionInfJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('id',0);
$order_info = OrderT::findOne(['id'=>$id]);
@ -4095,14 +4101,18 @@ class InsurerController extends BaseController
return $this->render('original-ems-edit1',[]);
}
public function actionSearch()
public function actionSearch() {
return $this->render('search');
}
public function actionSearchJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_man = $request->get('car_man');
$id_man = $request->get('id_man');
$phone = $request->get('phone');
$car_no = $request->get('car_no');
$page = $request->get('page',1);
$date_begin = $request->get('date_begin');
$date_end = $request->get('date_end');
$date2_begin = $request->get('date2_begin');
@ -4112,8 +4122,9 @@ class InsurerController extends BaseController
$group_id = $request->get('group_id');
$company_id = $request->get('company_id');
$insurance_status= $request->get('insurance_status');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
if($page < 1) $page = 1;
$group_items = GroupT::getTree();
$group_ids[] = $group_id;
@ -4137,7 +4148,7 @@ class InsurerController extends BaseController
$query = OrderT::find()
->where('status_id>1')
// ->orderBy('submit_date DESC, id DESC');
->orderBy('car_no desc,submit_date asc');
->orderBy('car_no desc,submit_date asc');
if($id_man != '') {
$query = $query->andWhere(['like','id_man',$id_man]);
}
@ -4175,12 +4186,9 @@ class InsurerController extends BaseController
if($insurance_status != '') {
$query = $query->andWhere('insurance_status ="'.$insurance_status.'"');
}
$total = $query->count();
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
$pagination->setPage($page-1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$total = $query->count();
$query = $query->offset($offset)->limit($limit);
$items = $query->all();
// echo $query->createCommand()->rawSql;
@ -4188,31 +4196,27 @@ class InsurerController extends BaseController
$sum = $query->sum('total1_clear');
$sum1 = $query->sum('total2_clear');
// var_dump($sum1) ;
$page_info = MyLib::getPageInfo($pagination);
$company_items = InsurerCompanyT::find()->all();
return $this->render('search',[
'items' => $items,
'company_items' => $company_items,
'insurance_status' => $insurance_status,
'company_id' => $company_id,
'car_man' => $car_man,
'id_man' => $id_man,
'phone' => $phone,
'car_no' => $car_no,
'date_begin' => $date_begin,
'date_end' => $date_end,
'date2_begin' => $date2_begin,
'date2_end' => $date2_end,
'date3_begin' => $date3_begin,
'date3_end' => $date3_end,
'page' => $page,
'page_info' => $page_info,
'group_items'=>$group_items,
'group_id'=>$group_id,
'sum' => $sum
]);
$data = [];
$data['total'] = $total;
$data['rows'] = [];
$data['sum'] = $sum;
$data['sum1'] = $sum1;
$data['company_info'] = $company_items;
foreach($items as $item) {
$row = $item->toArray();
$row['car_factory_model'] = $item->car?MyLib::substr_cut($item->car->factory_model,15):'';
$row['show_name'] = $item->user?$item->user->getShowName():'';
$row['status_txt'] = $item->status?$item->status->name:'';
$row['company_name'] = $item->company&&$item->company->name?$item->company->name:'';
$row['upload_status_txt'] = $item->shangye_src || $item->jiaoqiang_src?'保单已上传': '未上传';
$row['lock_show_name'] = $item->lock?$item->lock->getShowName():'';
$data['rows'][] = $row;
}
return $data;
}
public function actionSearch1()
{
$request = Yii::$app->request;
@ -4319,10 +4323,6 @@ class InsurerController extends BaseController
$order_weizhi_info->num=1;
$order_weizhi_info->save();
}
}
$sum = $query->sum('total1_clear');

@ -1,901 +0,0 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<style>
label.control-label {
width: 70px;
}
.form-inline .form-control {
width: 180px;
}
</style>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>车辆信息</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs btn-save" data-id="0" href="javascript:void(0);"
onclick="saveCarInfo()">
<i class="fa fa-save"></i> 保存
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="nextInfo()">
<i class="fa fa-backward"></i> 下一个
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-backward"></i> 返回
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<form role="form" class="form-inline" id="carFrm">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label>
<input type="text" name="car_no" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">厂牌型号</label>
<input type="text" name="car_no" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">品牌</label>
<select name="brand_id" id="brand_info" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($brand_items as $item) {
echo '<option value="' . $item->id . '"';
if ($info->brand_id == $item->id)
echo ' selected ';
echo '>' . $item->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车系</label>
<select name="series_id" id="series_info" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($series_items as $item) {
echo '<option value="' . $item->id . '"';
if ($info->series_id == $item->id)
echo ' selected ';
echo '>' . $item->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">发动机号</label>
<input type="text" name="engine_no" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车架号</label>
<input type="text" name="car_frame_no" value=""
class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">初登日期</label>
<input type="text" class="input-date form-control" id="register_date" name="register_date"
autocomplete="off" value=""/>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">排量</label>
<select name="displacement_id" id="displacement_info" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($displacement_items as $item) {
echo '<option value="' . $item->id . '"';
if ($info->displacement_id == $item->id)
echo ' selected ';
echo '>' . $item->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车辆类型</label>
<select name="car_type_id" id="car_type_info" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($car_type_items as $item) {
echo '<option value="' . $item->id . '"';
if ($car_info->car_type_id == $item->id)
echo ' selected ';
echo '>' . $item->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">运营性质</label>
<select name="car_use_id" id="car_use_info" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($car_use_items as $item) {
echo '<option value="' . $item->id . '"';
if ($car_info->car_use_id == $item->id)
echo ' selected ';
echo '>' . $item->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">座位数</label>
<input type="text" name="seats" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">年份</label>
<input type="text" name="car_year" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车主</label>
<input type="text" name="car_man" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">联系电话</label>
<input type="text" name="phone" value="" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">证件号码</label>
<input type="text" name="car_man_number" value=""
class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业止保日期</label>
<input type="text" class="input-date form-control" id="insurer1_date" name="insurer1_date"
autocomplete="off" value=""/>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">交强止保日期</label>
<input type="text" class="input-date form-control" id="insurer2_date" name="insurer2_date"
autocomplete="off" value=""/>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<input type="text" name="company" value="" class="form-control">
</div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<label class="control-label">备注</label>
<textarea class="form-control" name="car_remark"
id="car_remark"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>预约信息</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>车牌号:</dt>
<dd></dd>
<dt>厂牌型号:</dt>
<dd></dd>
<dt>品牌:</dt>
<dd></dd>
</dl>
</div>
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>发动机号:</dt>
<dd></dd>
<dt>车架号:</dt>
<dd></dd>
<dt>初登日期:</dt>
<dd></dd>
</dl>
</div>
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>车辆类型:</dt>
<dd></dd>
<dt>运营性质:</dt>
<dd></dd>
<dt>座位数:</dt>
<dd></dd>
</dl>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>车系:</dt>
<dd></dd>
<dt>排量:</dt>
<dd></dd>
<dt>年份:</dt>
<dd></dd>
</dl>
</div>
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>车主:</dt>
<dd></dd>
<dt>车主证件号码:</dt>
<dd></dd>
<dt>联系电话:</dt>
<dd>
<button type="button" class="btn btn-primary" onclick="strCall('')">
拨号
</button>
<button type="button" class="btn btn-primary" onclick="strHook()">挂断</button>
</dd>
</dl>
</div>
<div class="col-sm-4">
<form id="insurerFm">
<dl class="dl-horizontal">
<dt>商业止保日期:</dt>
<dd><input type="text" class="input-date form-control" name="insurer1_date"
autocomplete="off"
value=""/></dd>
<dt>交强止保日期:</dt>
<dd><input type="text" class="input-date form-control" name="insurer2_date"
autocomplete="off"
value=""/></dd>
<dt>保险公司:</dt>
<dd><input type="text" name="company" value="" class="form-control">
</dd>
</dl>
<button type="button" class="btn btn-primary" onclick="saveInsurerInfo()">拨号</button>
</form>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<dl class="dl-horizontal">
<dt>新保座席:</dt>
<dd></dd>
<dt>客服代表:</dt>
<dd></dd>
<dt>续保座席:</dt>
<dd></dd>
</dl>
</div>
<div class="col-sm-8">
<dl class="dl-horizontal">
<dt>区域:</dt>
<dd></dd>
<dt>备注:</dt>
<dd><?= $car_info->remark ?></dd>
</dl>
</div>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<form role="form" class="form-inline" id="appointmentFrm">
<input type="hidden" name="car_id" value="<?= $car_info->id ?>">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">预约日期</label>
<input type="text" class="input-date form-control" id="pdate" name="pdate" autocomplete="off"
value=""/>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">预约时间</label>
<select name="ptime" class="form-control">
<option>08:00</option>
<option>08:30</option>
<option>09:00</option>
<option>09:30</option>
<option>10:00</option>
<option>10:30</option>
<option>11:00</option>
<option>11:30</option>
<option>12:00</option>
<option>13:00</option>
<option>13:30</option>
<option>14:00</option>
<option>14:30</option>
<option>15:00</option>
<option>15:30</option>
<option>16:00</option>
<option>16:30</option>
<option>17:00</option>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">预约类型</label>
<select name="ptype" class="form-control">
<option value="0">---选择类型---</option>
<?php foreach ($list as $k => $v) { ?>
<option value='<?= $v->code; ?>'><?= $v->name; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">当天预约人数</label>
<input type="text" id="day_count" value="0" disabled class="form-control">
</div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<label class="control-label">预约备注</label>
<textarea class="form-control" name="remark"></textarea>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">业务分组</label>
<select name="business_group_id" class="form-control">
<option value="0">---请选择---</option>
<?php
foreach ($business_group as $k => $v) {
echo '<option value="' . $v->id . '"';
echo $v->id == $business_group_id ? 'selected' : '';
echo '>' . $v->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<?php
$insurer_date = $car_info->insurer1_date;
if ($insurer_date == '') {
$insurer_date = $car_info->insurer2_date;
}
$begin_zhi_date = date('Y-m-d', strtotime('-3 month', strtotime($insurer_date . ' 00:00:00')));
$cur_date = date('Y-m-d');
//echo '该提示放弃时间'.$begin_zhi_date.'当前'.$cur_date;
$d1 = strtotime($cur_date);
$d2 = strtotime($begin_zhi_date);
$Days = round(($d2 - $d1) / 3600 / 24);
$day = (int)$Days;
if ($day <= 0) {
echo '<button type="button" class="btn btn-primary" onclick="cancelAppointment()">放弃</button>';
}
//$cur_year = date('Y');
//$cur_date = date('m-d');
//$year_date = date('Y',strtotime($insurer_date.' 00:00:00'));
//$begin_date = date('m-d',strtotime('-3 month',strtotime($insurer_date.' 00:00:00')));
//$end_date = date('m-d',strtotime($insurer_date.' 00:00:00'));
//echo '今年:'.$cur_year.'<br>结束年份:'.$year_date.'<br>今天日期'.$cur_date.'<br>到期前三个月日期'.$begin_date.'<br>最后真正到期日期'.$end_date.'<br>';
//if((date('m') < 10) && ($cur_year >= $year_date && $cur_date >= $begin_date && $cur_date <= $end_date)){
// echo '<input type=button class="act_btn2 cancel-btn" name="cancel-btn" value=" 放弃 "/>';
//}else if((date('m') >= 10) && ($cur_date >= $begin_date)){
// echo '<input type=button class="act_btn2 cancel-btn" name="cancel-btn" value=" 放弃 "/>';
//}
?>
<button type="button" class="btn btn-primary" onclick="appointmentSave()">预约保存</button>
<button type="button" class="btn btn-primary" onclick="nextInfo()">下一个</button>
<button type="button" class="btn btn-primary" onclick="goBack()">返回</button>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">无效数据</label>
<select name="business_group_id" class="form-control">
<option value="0">---请选择无效理由---</option>
<?php
foreach ($failure_items as $item) {
echo '<option value="' . $item->id . '">' . $item->name . '</option>';
}
?>
</select>
<button type="button" class="btn btn-primary" onclick="appointmentInvalid()">无效数据</button>
</div>
</form>
<table id="appointmentTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="pdate">预约日期</th>
<th data-field="ptime">预约时间</th>
<th data-field="ptype">预约类型</th>
<th data-field="remark">预约备注</th>
<th data-field="show_name">业务员</th>
<th data-field="business_group_txt">业务分组</th>
<th data-formatter="opFormatter">操作时间</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>保单信息</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-backward"></i> 返回
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="insurerTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="id_man">被保险人</th>
<th data-field="insurer2_begin_date">商业起保日期</th>
<th data-field="insurer2_begin_date">交强起保日期</th>
<th data-field="print_date">出单日期</th>
<th data-field="total_all">共计签单</th>
<th data-field="show_name">业务员</th>
<th data-field="status_txt">状态</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>礼品列表</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-backward"></i> 返回
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="gift1Frm">
<thead>
<tr>
<th data-field="code">礼品编号</th>
<th data-field="type_txt">礼品名称</th>
<th data-field="use_date">操作时间</th>
<th data-field="show_name">操作员</th>
<th data-field="status_txt">状态</th>
</tr>
</thead>
</table>
</div>
<div class="col-md-12">
<table id="gift2Frm">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">礼品名称</th>
<th data-field="type_txt">类型</th>
<th data-field="remark">描述</th>
<th data-field="strategy_txt">分类</
</th>
<th data-field="show_name">添加者</th>
<th data-field="submit_time_txt">操作时间</th>
<th data-field="status_txt">状态</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title fixed">
<h5>操作记录</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);"
onclick="goBack()">
<i class="fa fa-backward"></i> 返回
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="histtoryTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="op_man">姓名</th>
<th data-field="op_time_txt">操作时间</th>
<th data-field="info">意见</th>
<th data-field="remark">意见说明</
</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
$('.input-date').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
// 获取数据,初始化
$.get(window.location.href, function (obj) {
if (obj.code == 200) {
init(obj.data);
} else {
alert('数据加载错误');
}
}
}, 'json');
$('#pdate').blur(function () {
var params = $("#appointmentFrm").serialize();
$.post('/appointment/count', params, function (obj) {
if (obj.success) {
$('#day_count').val(obj.count);
}
}, 'json');
});
$('#brand_id').change(function () {
var brand_id = $(this).val();
$('#series_id').html('<option value="0">---请选择---</option>');
$('#displacement_id').html('<option value="0">---请选择---</option>');
if (brand_id > 0) {
$.get('/car/series-fix', {brand_id: brand_id}, function (obj) {
if (obj.success) {
$('#series_id').html(obj.html);
}
}, 'json');
}
});
$('#series_id').change(function () {
var series_id = $(this).val();
$('#displacement_id').html('<option value="0">---请选择---</option>');
if (series_id > 0) {
$.get('/car/displacements-fix', {series_id: series_id}, function (obj) {
if (obj.success) {
$('#displacement_id').html(obj.html);
}
}, 'json');
}
});
myListGift();
myListLog();
})
function init(data){
carInfoInit(data['car_info']);
selectInfoInit(data);
}
// 品牌选项初始化
function selectInfoInit(data){
var keys = [
'brand',
'series',
'displacement',
'car_type',
'car_use',
];
$.each(keys,function(index,key){
var html = '<option value="0">---请选择---</option>';
$.each(data[key + '_info'],function(key,item){
html += '<option value="'+ item.id +'" selected="'+ (data[key + '_id'] == item['id']) +'">'+ item.name +'</option>'
});
$('#'+ key + '_info').html(html);
});
}
// 页面车辆数据初始化
function carInfoInit(data){
// 页面车辆数据初始化
$('#carFrm').children('.form-control').each(function(key,item){
$(item).val(data['car_info'][$(item).attr('name')]);
});
}
//拨号
function strCall(phone) {
parent.drtCall(phone);
}
//挂断
function strHook() {
parent.drtHook();
}
// 保存车辆信息
function saveCarInfo() {
var params = $('#carFrm').serialize();
$.post('/car/save',params,function(obj){
alert(obj.msg);
window.location.reload();
},'json');
}
// 下一条信息
function nextInfo(){
var params = 'index=' + next_index + '&type=<?=$type?>';
$.get('/track/ajax-next', params, function (obj) {
if (obj.success) {
if (obj.car_id > 0) {
window.location.href = '/car/info-track?id=' + obj.car_id + '&type=<?=$type?>&next_index=<?=$next_index?>' + '&back_params=' + encodeURIComponent('<?=$back_params?>');
} else {
alert('没有记录');
}
}
}, 'json');
}
// 返回
function goBack(){
<?php
$url = '';
if ($type == 1)
$url = '/track/first?' . $back_params;
if ($type == 2)
$url = '/track/today?' . $back_params;
if ($type == 3)
$url = '/track/all?' . $back_params;
echo 'window.location.href = "' . $url . '"';
?>
}
// 保险信息保存
function saveInsurerInfo(){
var params = $('#insurerFm').serialize();
$.post('/car/baocun', params, function (obj) {
alert(obj.msg);
}, 'json');
}
// 取消预约
function cancelAppointment(){
//这里是后来需求改了,暂时注释
//if(location == 6){
// var url = '/track/car-cancel-e';
//}else if(location == 3 || ptype == 3){
// var url = '/track/car-cancel';
//}
var location = '<?= $car_info->location; ?>';
var ptype = $('#appointment_list').children("table").children("tbody").children("tr").eq(1).children(".ptyp").attr('data');
if (location == 3) {
//C库数据
//放d
var url = '/track/car-cancel';
} else if (location == 6 && ptype == 5) {
var url = '/track/car-cancel-e';
} else {
//无效
alert('不是目标客户,请点击无效数据按钮!');
return false;
}
if (confirm('是否确认放弃?')) {
$.post(url, {id:<?=$car_info->id?>}, function (obj) {
alert(obj.msg);
if (obj.success) {
$('.back-btn').click();
}
}, 'json');
}
}
// 预约保存
function appointmentSave(){
if (confirm('是否确认提交?')) {
var params = $("#appointmentFrm").serialize();
$.post('/appointment/save', params, function (obj) {
alert(obj.msg);
if (obj.success) {
$('#appointmentFrm')[0].reset();
gotoPage('/appointment/ajax-index?car_id=<?=$car_info->id?>&page=1', 'appointment_list');
}
}, 'json');
}
}
// 无效保存
function appointmentInvalid(){
var car_id = $('#car_id').val();
var invalid_id = $('#invalid_id').val();
if (invalid_id == 0) {
alert('必须选择无效理由!');
return;
}
if (confirm('是否无效这条数据?')) {
$.post('/car/invalid', {car_id: car_id, invalid_id: invalid_id}, function (obj) {
alert(obj.msg);
if (obj.success) {
$('#appointment-save-btn').attr('disabled', true);
$('.save-btn').attr('disabled', true);
$('.invalid-btn').attr('disabled', true);
}
}, 'json');
}
}
// 礼品信息
function myListGift() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
data: <?=json_encode($gift_items)?>,
pagination: true,
sidePagination: 'server',
queryParams: function (params) {
console.log(params);
return params;
}
});
return false;
}
function myListGiftSave() {
var id = $('#id').val();
if (id > 0) {
var params = $("#giftFrm").serialize();
params = params + '&id=' + id;
$.post('/fix-car/gift-save', params, function (obj) {
alert(obj.msg);
}, 'json');
} else {
alert('请先保存维修信息');
}
}
// 操作记录
function myListLog() {
$('#listTable2').bootstrapTable('destroy');
$('#listTable2').bootstrapTable({
data: <?=json_encode($log_items)?>,
pagination: true,
sidePagination: 'server',
queryParams: function (params) {
return params;
}
});
return false;
}
// 审核意见
function saveSysInfo() {
var id = $('#id').val();
var sys_remark = $('#sys_remark').val();
if (sys_remark == '') {
alert('请先输入审核意见');
return;
}
if (id > 0) {
if (confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
params = params + '&status=<?=$info->status + 1?>' + '&sys_remark=' + sys_remark;
$.post('/fix-car/my-list-save', params, function (obj) {
alert(obj.msg);
if (obj.success) {
$('#back-btn').click();
}
}, 'json');
}
} else {
alert('请先保存维修信息');
}
}
// 退回
function returnBack() {
var r = prompt('退回原因', '');
if (r != null && r != '') {
$.post('/fix-car/return-op', {
id:<?=$info->id > 0 ? $info->id : 0?>,
return_remark: r,
return_status_id:<?=$info->status?>
}, function (obj) {
alert(obj.msg);
if (obj.success) {
$('#back-btn').click();
}
}, 'json');
} else {
alert('不填写原因,无法退回');
}
}
// 维修明细
function addInfo() {
var id = $('#id').val();
if (id > 0) {
layer_show('维修明细', '/fix-car/add-item?fix_id=' + id);
} else {
alert('请先保存维修信息');
}
}
// 打印接车单
function printInfo() {
window.open('/fix-car/print-receive?id=<?=$info->id?>');
}
//返回
function goBack() {
<?php
$url = '';
switch ($type) {
case 1:
$url = '/fix-car/step1-list';
break;
case 2:
$url = '/fix-car/step2-list';
break;
case 3:
$url = '/fix-car/step3-list';
break;
case 4:
$url = '/fix-car/step4-list';
break;
case 5:
$url = '/fix-car/step5-list';
break;
case 6:
$url = '/fix-car/step6-list';
break;
case 7:
$url = '/fix-car/step7-list';
break;
default:
$url = '/fix-car/my-list';
break;
}
echo 'window.location.href="' . $url . '"';
?>
}
function showNameFormatter(value) {
return value.username + '(' + value.name + ')';
}
function typeFormatter(value) {
switch (+value) {
case 1:
return '实名礼品';
case 2:
return '礼券';
}
}
function strategyFormatter(value) {
return value == 0 ? '公司礼品' : '自费礼品';
}
function dateFormatter(value) {
var datetime = new Date(value * 1000);
var year = datetime.getFullYear(),
month = ("0" + (datetime.getMonth() + 1)).slice(-2),
date = ("0" + datetime.getDate()).slice(-2),
hour = ("0" + datetime.getHours()).slice(-2),
minute = ("0" + datetime.getMinutes()).slice(-2),
second = ("0" + datetime.getSeconds()).slice(-2);
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
}
function statusFormatter(value) {
var statusTxt = '';
switch (+value) {
case 0:
statusTxt = "未出库";
break;
case 1:
statusTxt = "已出库";
break;
case 2:
statusTxt = "正在退换";
break;
case 3:
statusTxt = "已使用";
break;
default:
statusTxt = "未知状态";
break;
}
return statusTxt;
}
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,6 +1,3 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>

File diff suppressed because it is too large Load Diff

@ -1,136 +1,180 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//详情
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<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="refreshList();">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="username">车主</label>
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="phone">被保险人</label>
<input type="text" id="id_man" name="id_man" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" id="phone" name="phone" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker1">提单日期</label>
<div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="date_begin" name="date_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date_end" name="date_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker2">正本日期</label>
<div class="input-group" id="datepicker2">
<input type="text" class="form-control" id="date2_begin" name="date2_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date2_end" name="date2_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker3">起保日期</label>
<div class="input-group" id="datepicker3">
<input type="text" class="form-control" id="date3_begin" name="date3_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="form-control" id="date3_end" name="date3_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<select name="company_id" id="company_info" class="form-control">
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">险种类型</label>
<select name="insurance_status" id="insurance_status_info" class="form-control">
<option value="">全部</option>
<option value="1">车险</option>
<option value="2">非车险</option>
<option value="3">车险和非车险</option>
</select>
</div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</form>
<hr>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="car_man">车主</th>
<th data-field="id_man">被保险人</th>
<th data-field="submit_date">提单日期</th>
<th data-field="send_date">送单日期</th>
<th data-field="car_no">车牌号</th>
<th data-field="car_factory_model">品牌</th>
<th data-field="total_all">共计签单</th>
<th data-field="total_real">应收</th>
<th data-field="status_txt">状态</th>
<th data-field="show_name">业务员</th>
<th data-field="company_name">保险公司</th>
<th data-field="upload_status_txt">上传状态</th>
<th data-field="lock_show_name">当前操作</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
if (row.insurance_status == 1 || row.insurance_status == 3) {
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>');
opStr.push('</a>');
} else if (row.insurance_status == 2) {
opStr.push('<a href="javascript:void(0);" onclick="infos(' + row.non_id + ',' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="非车险详情">&nbsp;非车险详情</i>');
opStr.push('</a>');
}
return opStr.join(' ');
}
function info(id) {
window.open('/insurer/info?id=' + id);
layer_show('保单信息','/insurer/info?id=' + id);
}
function infos(id,oid) {
window.open('/non-auto-insurance/bd-info-search?id=' + id +'&oid=' + oid);
// window.location.href = ;
layer_show('保单信息','/non-auto-insurance/bd-info-search?id=' + id +'&oid=' + oid);
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/insurer/search-json",
pagination: true,
showFooter: true,
sidePagination: 'server',
queryParams: function(params) {
$('#search').find(':input:not(input[type=button],input[type=submit],button)').each(function(index,item){
params[$(item).attr('name')] = $(item).val();
});
return params;
},
responseHandler: function (res) {
console.log(res);
$('.fixed-table-footer').html('<div style="height: 100%;line-height: 37px;text-align: right;padding-right: 2rem;">' +
' <label class="">净保费总和:</label>' +
' <span style="color:red;">'+ res.sum +'</span>' +
' </div>');
selectInfoInit('company',res['company_info']);
return res
}
});
return false;
}
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/insurer/search?" + params;
// 品牌选项初始化
function selectInfoInit(selectName,options,default_val,data){
var html = '<option value="'+ (default_val?default_val:'') +'">---请选择---</option>';
$.each(options,function(i,item){
var val = item['code']?item['code']:item['id'];
var selected = data && data[selectName + '_id'] && data[selectName + '_id'] == val? 'selected': '';
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>'
});
$('#'+ selectName + '_info').html(html);
}
$(function() {
search();
});
</script>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车主:<input name="car_man" type="text" value="<?=$car_man?>">
被保险人:<input name="id_man" type="text" value="<?=$id_man?>">
电话:<input name="phone" type="text" value="<?=$phone?>">
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
提单日期:从<input name="date_begin" type="text" value="<?=$date_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date_end" type="text" value="<?=$date_end?>" style="width:100px;" onclick="WdatePicker()">截止
正本日期:从<input name="date2_begin" type="text" value="<?=$date2_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date2_end" type="text" value="<?=$date2_end?>" style="width:100px;" onclick="WdatePicker()">截止
起保日期:从<input name="date3_begin" type="text" value="<?=$date3_begin?>" style="width:100px;" onclick="WdatePicker()"><input name="date3_end" type="text" value="<?=$date3_end?>" style="width:100px;" onclick="WdatePicker()">截止
<!--
级别:<select name="group_id">
<option value="0">全部</option>
<?php
foreach($group_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $group_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
//-->
保险公司:<select name="company_id">
<option value="">全部</option>
<?php
foreach($company_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $company_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
险种类型:<select name="insurance_status">
<option value="">全部</option>
<option value="1" <?php if($insurance_status==1) echo ' selected ';?>>车险</option>
<option value="2" <?php if($insurance_status==2) echo ' selected ';?>>非车险</option>
<option value="3" <?php if($insurance_status==3) echo ' selected ';?>>车险和非车险</option>
</select>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> </td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="30" align="center" class="bg_tr" nowrap>序号</td>
<td width="50" align="center" class="bg_tr" nowrap>车主</td>
<td width="50" align="center" class="bg_tr" nowrap>被保险人</td>
<td width="60" align="center" class="bg_tr" nowrap>提单日期</td>
<td width="60" align="center" class="bg_tr" nowrap>送单日期</td>
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td>
<td width="60" align="center" class="bg_tr" nowrap>品牌</td>
<td width="60" align="center" class="bg_tr" nowrap>共计签单</td>
<td width="60" align="center" class="bg_tr" nowrap>应收</td>
<td width="60" align="center" class="bg_tr" nowrap>状态</td>
<td width="60" align="center" class="bg_tr" nowrap>业务员</td>
<td width="60" align="center" class="bg_tr" nowrap>保险公司</td>
<td width="60" align="center" class="bg_tr" nowrap>上传状态</td>
<td width="60" align="center" class="bg_tr" nowrap>当前操作</td>
<td width="30" align="center" class="bg_tr" nowrap>操作</td>
</tr>
<?php
foreach($items as $index => $item) {
$start_index = ($page - 1) * 20 + $index;
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"n owrap ><?=$start_index + 1?></td>
<td class="td_bg" nowrap><?=MyLib::substr_cut($item->car_man,15)?></td>
<td class="td_bg" nowrap><?=MyLib::substr_cut($item->id_man,15)?></td>
<td class="td_bg" nowrap><?=$item->submit_date?></td>
<td class="td_bg" nowrap><?=$item->send_date?></td>
<td class="td_bg" nowrap><?=$item->car_no?></td>
<td class="td_bg" nowrap><?=$item->car?MyLib::substr_cut($item->car->factory_model,15):''?></td>
<td class="td_bg" nowrap><?=$item->total_all?></td>
<td class="td_bg" ><?=$item->total_real?>&nbsp;</td>
<td class="td_bg" ><?=$item->status->name?></td>
<td class="td_bg" ><?=$item->user?$item->user->getShowName():''?></td>
<td class="td_bg" >
<?php if($item->company):?>
<?=$item->company->name?$item->company->name:''?>
<?php endif;?>
</td>
<td class="td_bg" >
<?php if($item->shangye_src || $item->jiaoqiang_src):?>
保单已上传
<?php else:?>
未上传
<?php endif;?>
</td>
<td class="td_bg" ><?=$item->lock?$item->lock->getShowName():''?></td>
<td align="center" class="td_bg" nowrap>
<?php if($item->insurance_status==1 || $item->insurance_status==3):?>
[<a href="javascript:void(0);" onclick="info(<?=$item->id?>)">详情</a>]
<?php elseif($item->insurance_status==2):?>
[<a href="javascript:void(0);" onclick="infos(<?=$item->non_id?>,<?= $item->id ?>)">非车险详情</a>]
<?php endif;?>
</td>
</tr>
<?php
}
?>
<tr>
<td class="td_bg" align="right" colspan="7">净保费总和</td>
<td class="td_bg" align="left" colspan="7"><?=$sum?></td>
</tr>
<tr >
<td height="25" colspan="15" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save