diff --git a/frontend/controllers/CarController.php b/frontend/controllers/CarController.php index 1ea872b..86b0e05 100644 --- a/frontend/controllers/CarController.php +++ b/frontend/controllers/CarController.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; diff --git a/frontend/controllers/FixCarController.php b/frontend/controllers/FixCarController.php index d34cf3b..053683f 100644 --- a/frontend/controllers/FixCarController.php +++ b/frontend/controllers/FixCarController.php @@ -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(); diff --git a/frontend/views/car/info-track.php b/frontend/views/car/info-track.php index 478eaab..2b061ea 100644 --- a/frontend/views/car/info-track.php +++ b/frontend/views/car/info-track.php @@ -1,859 +1,894 @@ - - - - - - - - - - -
- - - - -
- - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
车牌号 - - 厂牌型号 - - 品牌 - - 车系 - -
发动机号 - - 车架号 - - 初登日期 - - 排量 - -
车辆类型 - - 运营性质 - - 座位数 - - 年份 - -
车主 - - 联系电话 - - 证件号码 - -
商业止保日期 - - 交强止保日期 - - 保险公司 - -
备注 - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
车牌号 - car_no?> - 厂牌型号 - factory_model?> - 品牌 - brand_id == $item->id){ - echo $item->name; - } - } - ?> - 车系 - series_id == $item->id){ - echo $item->name; - } - } - ?> -
发动机号 - engine_no?> - 车架号 - car_frame_no?> - 初登日期 - register_date?> - 排量 - displacement_id == $item->id){ - echo $item->name; - } - } - ?> -
车辆类型 - car_type_id == $item->id){ - echo $item->name; - } - } - ?> - 运营性质 - car_use_id == $item->id){ - echo $item->name; - } - } - ?> - 座位数 - seats?> - 年份 - car_year?> -
车主 - car_man?> - 联系电话 - phone?> - 证件号码 - car_man_number?> -
商业止保日期 - insurer1_date?> - 交强止保日期 - insurer2_date?> - 保险公司 - company?> -
备注 - remark?> -
- -
- - - - - - -    - -
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
车牌号car_no?>厂牌型号factory_model?>品牌brand?$car_info->brand->name:''?>
发动机号engine_no?>车架号car_frame_no?>初登日期register_date?>
车辆类型carType?$car_info->carType->name:''?>运营性质carUse?$car_info->carUse->name:''?>座位数 - seats?> -
车系series?$car_info->series->name:''?>排量displacement?$car_info->displacement->name:''?>年份car_year?>
车主car_man?>联系电话phone?> - - - 车主证件号码 - car_man_number?> -
商业止保日期交强止保日期保险公司
新保座席op_user1?>客服代表op_user2?>续保座席op_user3?>
备注remark?>区域 - - location == 3){ - echo '本区'; - }else if($car_info->location == 6){ - echo '外区'; - } - ?> - -
- -
- - - - - - - - - - - - - - - - - - - - - - - -
预约日期: -
- -
-
预约时间: -
- -
-
预约类型: -
- -
-
当天预约人数: -
- 0 -
-
预约备注: -
- -
-
业务分组: - -
- 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 ''; - } -// $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.'
结束年份:'.$year_date.'
今天日期'.$cur_date.'
到期前三个月日期'.$begin_date.'
最后真正到期日期'.$end_date.'
'; -// if((date('m') < 10) && ($cur_year >= $year_date && $cur_date >= $begin_date && $cur_date <= $end_date)){ -// echo ''; -// }else if((date('m') >= 10) && ($cur_date >= $begin_date)){ -// echo ''; -// } - ?> - - - - - - -
-
-
- - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - getOrders()->orderBy('print_date DESC, id DESC')->all(); - foreach($order_items as $index => $item) { - ?> - - - - - - - - - - - - -
序号被保险人商业起保日期交强起保日期出单日期共计签单业务员状态操作
id_man?>insurer1_begin_date?>insurer2_begin_date?>print_date?>total_all?>user?$item->user->getShowName():''?>status?$item->status->name:''?>[详情]
-
- -
- - - - - - - -
- - - - - - - -
- - - - - - - - - - - $item) { - ?> - - - - - - - - -
礼品编号礼品名称操作时间状态操作员
code)?>type->name?>use_date?>getStatus()?>status > 0) - echo $item->user?$item->user->getShowName():'---' - ?> -
- - - - - - - - - - - - - - - - $item) { - if(!$item->gift) continue; - ?> - - - - - - - - - - - -
序号礼品名称类型描述分类添加者操作时间状态
gift->name?>gift->type->name?>gift->remark?>strategy_id>0?'公司礼品':'自费礼品'?>user?$item->user->getShowName():''?>submit_time)?> - status == 0) echo '未出库'; - if($item->status == 1) echo '已出库'; - if($item->status == 2) echo '正在退换'; - ?> -
- - -
- -
- - - - - - - -
- - - - - - - -
-
-
- -
-
-
- - + + + \ No newline at end of file + }, '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=id?>'); + } + + //返回 + function goBack() { + + } + + 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; + } + + + +endBlock('footer_js'); ?> \ No newline at end of file diff --git a/frontend/views/car/search.php b/frontend/views/car/search.php index 728007f..8b5fc6e 100644 --- a/frontend/views/car/search.php +++ b/frontend/views/car/search.php @@ -1,81 +1,120 @@ - - - - - + + + - - - - - - - - - - -
- 车主: - 电话: - 车牌: - 车型: -
- 初登日期: - 保险日期: - 被保险人: - -
- - - - - - - - - - - - - - $item) { - $start_index = ($page - 1) * 20 + $index; - $order_info = $item->getOrders()->orderBy('id DESC')->one(); - ?> - - - - - - - - - - - - - - - - -
序号车主车牌号发动机号车架号初登日期保险日期位置业务员操作
car_man?>car_no?>engine_no?>car_frame_no?>register_date?>insurer1_date?>getLocation()?>lib&&$item->lib->user?$item->lib->user->getShowName():''?> - [详情] -
+endBlock(); ?> \ No newline at end of file diff --git a/frontend/views/fix-car/my-list-edit.php b/frontend/views/fix-car/my-list-edit.php index ead2187..a1e9859 100644 --- a/frontend/views/fix-car/my-list-edit.php +++ b/frontend/views/fix-car/my-list-edit.php @@ -141,7 +141,7 @@ use \common\libs\MyLib;
- +
diff --git a/frontend/views/fix-car/my-list-finish.php b/frontend/views/fix-car/my-list-finish.php index 0c3febc..ced3681 100644 --- a/frontend/views/fix-car/my-list-finish.php +++ b/frontend/views/fix-car/my-list-finish.php @@ -19,7 +19,7 @@ use \common\libs\MyLib;
-
+
@@ -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; } }); diff --git a/frontend/views/fix-car/my-list.php b/frontend/views/fix-car/my-list.php index 1e418b3..3eb2e64 100644 --- a/frontend/views/fix-car/my-list.php +++ b/frontend/views/fix-car/my-list.php @@ -19,7 +19,7 @@ use \common\libs\MyLib;
- +
@@ -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; } }); diff --git a/frontend/views/fix-car/step1-list.php b/frontend/views/fix-car/step1-list.php index b2a0f0e..9834013 100644 --- a/frontend/views/fix-car/step1-list.php +++ b/frontend/views/fix-car/step1-list.php @@ -16,7 +16,7 @@ use \common\libs\MyLib;
- +
@@ -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; } }); diff --git a/frontend/views/fix-car/step2-list.php b/frontend/views/fix-car/step2-list.php index 0f83018..56f4d69 100644 --- a/frontend/views/fix-car/step2-list.php +++ b/frontend/views/fix-car/step2-list.php @@ -16,7 +16,7 @@ use \common\libs\MyLib;
- +
@@ -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; } }); diff --git a/frontend/views/fix-car/step3-list.php b/frontend/views/fix-car/step3-list.php index c6ab3ba..e7f8334 100644 --- a/frontend/views/fix-car/step3-list.php +++ b/frontend/views/fix-car/step3-list.php @@ -16,7 +16,7 @@ use \common\libs\MyLib;
- +
@@ -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; } }); diff --git a/frontend/views/fix-car/step4-list.php b/frontend/views/fix-car/step4-list.php index 59dfd13..edf97d2 100644 --- a/frontend/views/fix-car/step4-list.php +++ b/frontend/views/fix-car/step4-list.php @@ -16,7 +16,7 @@ use \common\libs\MyLib;
- +
@@ -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; } });