客户信息,写一半

dev
zhaocheng 5 years ago
parent 417679cf37
commit 948bdd0503
  1. 84
      frontend/controllers/CarController.php
  2. 30
      frontend/controllers/FixCarController.php
  3. 1471
      frontend/views/car/info-track.php
  4. 183
      frontend/views/car/search.php
  5. 2
      frontend/views/fix-car/my-list-edit.php
  6. 5
      frontend/views/fix-car/my-list-finish.php
  7. 5
      frontend/views/fix-car/my-list.php
  8. 5
      frontend/views/fix-car/step1-list.php
  9. 5
      frontend/views/fix-car/step2-list.php
  10. 5
      frontend/views/fix-car/step3-list.php
  11. 5
      frontend/views/fix-car/step4-list.php

@ -976,8 +976,13 @@ class CarController extends BaseController
]);
}
public function actionInfoTrack()
public function actionInfoTrack() {
return $this->render('info-track');
}
public function actionInfoTrackJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('id',0);
$type = $request->get('type',0);
@ -990,18 +995,24 @@ class CarController extends BaseController
$next_index = $request->get('next_index',0);
$back_params = $request->get('back_params');
// 车辆信息
$car_info = CarT::findOne(['id'=>$id]);
// 运营性质
$car_use_items = CarUseT::find()->all();
// 车辆类型
$car_type_items = CarTypeT::find()->all();
// 品牌信息
$brand_items = BrandT::find()->all();
// 车系信息
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
// 排量信息
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
// $failure_items = InvalidT::getTree(2);
// 无效数据
$failure_items = InvalidT::getTrees();
//新礼品
@ -1017,7 +1028,7 @@ class CarController extends BaseController
//下一辆
$next_id = 0;
if($type == 1) {
if($type == 1) { // 首发 预约时间小于当前
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=1 and car_t.is_track=1')
@ -1044,7 +1055,7 @@ class CarController extends BaseController
}
$next_index++;
}
if($type == 2) {
if($type == 2) { // 历史 预约时间小于当前
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.is_track=1')
@ -1071,7 +1082,8 @@ class CarController extends BaseController
}
$next_index++;
}
if($type == 3) {
if($type == 3) { // 历史 预约时间不限
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.is_track=1');
@ -1107,14 +1119,14 @@ class CarController extends BaseController
//获取业务分组
$business_group = BusinessGroupT::find()->all();
return $this->render('info-track',[
return MyLib::ok3([
'type' => $type,
'car_info' => $car_info,
'failure_items' => $failure_items,
'failure_info' => $failure_items,
'next_id' => $next_id,
'list' => $list,
'items' => $items,
'gift_items' => $gift_items,
'appointment_type' => $list,
'new_gift_info' => $items,
'old_gift_info' => $gift_items,
'uid' => $uid,
'next_index' => $next_index,
'car_man' => $car_man,
@ -1130,10 +1142,10 @@ class CarController extends BaseController
'displacement_items' => $displacement_items,
'back_params' => $back_params,
'business_group' => $business_group,
'business_group_id' => $business_group_id,
'adid' => $aid,
]);
}
public function actionInfoTrackFix()
{
$request = Yii::$app->request;
@ -4185,17 +4197,13 @@ class CarController extends BaseController
return $result;
}
public function actionSearch() {
return $this->render('search');
}
public function actionSearch()
public function actionSearchJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_man = $request->get('car_man');
$phone = $request->get('phone');
@ -4205,8 +4213,8 @@ class CarController extends BaseController
$insurer_date = $request->get('insurer_date');
$id_man = $request->get('id_man');
$op = $request->get('op',1);
$page = $request->get('page',1);
if($page < 1) $page = 1;
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = CarT::find()
->leftJoin('order_t','`order_t`.`car_id`=`car_t`.`id`');
@ -4246,29 +4254,23 @@ class CarController extends BaseController
if($id_man != '') {
$query = $query->andWhere('order_t.id_man="'.$id_man.'"');
}
$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();
$page_info = MyLib::getPageInfo($pagination);
return $this->render('search',[
'items' => $items,
'car_man' => $car_man,
'phone' => $phone,
'car_no' => $car_no,
'car_model' => $car_model,
'register_date' => $register_date,
'insurer_date' => $insurer_date,
'id_man' => $id_man,
'page' => $page,
'page_info' => $page_info
]);
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$row['show_name'] = $item->lib&&$item->lib->user?$item->lib->user->getShowName():'';
$row['location_txt'] = $item->location?$item->getLocation():'';
$data['rows'][] = $row;
}
return $data;
}
public function actionNonSearch()
{
$request = Yii::$app->request;

@ -86,6 +86,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find()
->where('status=0');
@ -97,7 +99,7 @@ class FixCarController extends BaseController
}
$total = $query->count();
$query = $query->orderBy('id DESC');
$query = $query->orderBy('id DESC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -121,6 +123,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find()
->where('status>0');
@ -133,7 +137,7 @@ class FixCarController extends BaseController
$total = $query->count();
$query = $query->orderBy('status ASC');
$query = $query->orderBy('status ASC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -598,6 +602,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status=1');
@ -605,7 +611,7 @@ class FixCarController extends BaseController
$query = $query->andWhere(['like','car_no',$car_no]);
}
$total = $query->count();
$query = $query->orderBy('status ASC,receive_date ASC');
$query = $query->orderBy('status ASC,receive_date ASC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -632,6 +638,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status>1');
@ -639,7 +647,7 @@ class FixCarController extends BaseController
$query = $query->andWhere(['like','car_no',$car_no]);
}
$total = $query->count();
$query = $query->orderBy('status ASC,updated_at DESC');
$query = $query->orderBy('status ASC,updated_at DESC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -686,6 +694,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status=2');
@ -694,7 +704,7 @@ class FixCarController extends BaseController
}
$total = $query->count();
$query = $query->orderBy('status ASC');
$query = $query->orderBy('status ASC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -715,6 +725,8 @@ class FixCarController extends BaseController
{
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status>2');
@ -740,6 +752,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status>2');
@ -748,7 +762,7 @@ class FixCarController extends BaseController
}
$total = $query->count();
$query = $query->orderBy('status ASC,updated_at DESC');
$query = $query->orderBy('status ASC,updated_at DESC')->offset($offset)->limit($limit);
$items = $query->all();
$data = [];
@ -775,6 +789,8 @@ class FixCarController extends BaseController
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$query = FixCarT::find();
$query = $query->where('status>3');
@ -782,7 +798,7 @@ class FixCarController extends BaseController
$query = $query->andWhere(['like','car_no',$car_no]);
}
$total = $query->count();
$query = $query->orderBy('status ASC');
$query = $query->orderBy('status ASC')->offset($offset)->limit($limit);
$items = $query->all();
$lists = array();

File diff suppressed because it is too large Load Diff

@ -1,81 +1,120 @@
<?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" 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" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" id="phone" name="phone" class="form-control">
</div>
<div class="form-group" 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" style="margin-bottom: 8px;">
<label for="car_model">车型</label>
<input type="text" id="car_model" name="car_model" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">初登日期</label>
<div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="register_date" name="register_date" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker2">保险日期</label>
<div class="input-group" id="datepicker2">
<input type="text" class="form-control" id="insurer_date" name="insurer_date" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="caller">被保险人</label>
<input type="text" id="id_man" name="id_man" class="form-control">
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
<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="car_no">车牌号</th>
<th data-field="engine_no">发动机号</th>
<th data-field="car_frame_no">车架号</th>
<th data-field="register_date">初登日期</th>
<th data-field="insurer1_date">保险日期</th>
<th data-field="location_txt">位置</th>
<th data-field="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 = [];
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>');
opStr.push('</a>');
return opStr.join(' ');
}
function info(id) {
window.open('/car/info-track?id=' + id);
layer_show('客户信息','/car/info-track?id=' + id);
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/car/search?" + params;
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/car/search-json",
pagination: 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;
}
});
</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="phone" type="text" value="<?=$phone?>">
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
车型:<input name="car_model" type="text" value="<?=$car_model?>">
</td>
</tr>
<tr>
<td class="td_bg">
初登日期:<input name="register_date" type="text" value="<?=$register_date?>" onclick="WdatePicker()">
保险日期:<input name="insurer_date" type="text" value="<?=$insurer_date?>" onclick="WdatePicker()">
被保险人:<input name="id_man" type="text" value="<?=$id_man?>">
<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="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;
$order_info = $item->getOrders()->orderBy('id DESC')->one();
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"n owrap ><?=$start_index + 1?></td>
<td class="td_bg" nowrap><?=$item->car_man?></td>
<td class="td_bg" nowrap><?=$item->car_no?></td>
<td class="td_bg" nowrap><?=$item->engine_no?></td>
<td class="td_bg" nowrap><?=$item->car_frame_no?></td>
<td class="td_bg" nowrap><?=$item->register_date?></td>
<td class="td_bg" nowrap><?=$item->insurer1_date?></td>
<td class="td_bg" nowrap><?=$item->getLocation()?></td>
<td class="td_bg" ><?=$item->lib&&$item->lib->user?$item->lib->user->getShowName():''?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="info(<?=$item->id?>)">详情</a>]
</td>
</tr>
<?php
return false;
}
?>
<tr >
<td height="25" colspan="14" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
$(function() {
search();
});
</script>
<?php $this->endBlock(); ?>

@ -141,7 +141,7 @@ use \common\libs\MyLib;
</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="car_year" name="car_year" autocomplete="off" value="<?=substr($info->car_year,0,10)?>" />
<input type="text" name="car_year" value="<?=$info->car_year?>" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">商业保单号</label>

@ -19,7 +19,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -97,6 +97,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

@ -19,7 +19,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -97,6 +97,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

@ -16,7 +16,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -79,6 +79,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

@ -16,7 +16,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -79,6 +79,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

@ -16,7 +16,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -79,6 +79,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

@ -16,7 +16,7 @@ use \common\libs\MyLib;
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group" style="margin-bottom: 8px;">
<label for="username">车牌号</label>
<input type="text" id="car_no" name="car_no" class="form-control">
@ -79,6 +79,9 @@ use \common\libs\MyLib;
pagination: 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;
}
});

Loading…
Cancel
Save