From dbfb9a369dd9718806dddf454f36e13a0d8bc48f Mon Sep 17 00:00:00 2001
From: zhaocheng <578322713@qq.com>
Date: Fri, 11 Oct 2019 18:07:44 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E4=BF=9D=E5=85=BB=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/controllers/FixCarController.php | 99 ++++--
frontend/views/fix-car/add-item.php | 180 +++++-----
frontend/views/fix-car/ajax-item-list.php | 358 ++++++++++----------
frontend/views/fix-car/my-list-edit.php | 144 ++++++--
frontend/views/fix-car/my-list-finish.php | 4 +-
frontend/views/fix-car/my-list.php | 40 ++-
frontend/views/fix-car/my-search-result.php | 132 ++++----
frontend/views/fix-car/my-search.php | 49 +--
frontend/views/fix-car/step1-list.php | 38 ++-
frontend/views/fix-car/step2-list.php | 175 ++++++----
frontend/views/fix-car/step3-list.php | 145 ++++----
frontend/views/fix-car/step4-list.php | 145 ++++----
12 files changed, 917 insertions(+), 592 deletions(-)
diff --git a/frontend/controllers/FixCarController.php b/frontend/controllers/FixCarController.php
index c85330f..076a074 100644
--- a/frontend/controllers/FixCarController.php
+++ b/frontend/controllers/FixCarController.php
@@ -70,7 +70,7 @@ class FixCarController extends BaseController
if($car_phone != '') {
$query = $query->andWhere('phone like "'.$car_phone.'"');
}
- $items = $query->all();
+ $items = $query->asArray()->all();
return $this->render('my-search-result',[
'items' => $items
@@ -105,6 +105,7 @@ class FixCarController extends BaseController
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
+ $row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row;
}
return $data;
@@ -114,7 +115,6 @@ class FixCarController extends BaseController
return $this->render('my-list-finish');
}
-
public function actionMyListFinishJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
@@ -140,6 +140,8 @@ class FixCarController extends BaseController
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
+ $row['show_name'] = $item->user->getShowName();
+ $row['status_txt'] = $item->getStatus();
$data['rows'][] = $row;
}
return $data;
@@ -211,8 +213,11 @@ class FixCarController extends BaseController
//礼品
$gift_items = CarGiftT::find()
+ ->with('user')
+ ->with('gift')
->where('car_id='.$car_info->id)
->orderBy('strategy_id DESC')
+ ->asArray()
->all();
$direction_items = DirectionT::find()->all();
@@ -237,6 +242,7 @@ class FixCarController extends BaseController
$log_items = CarLogT::find()
->where('car_id='.$info->car_id.' and type=2')
->orderBy('id DESC')
+ ->asArray()
->all();
return $this->render('my-list-edit',[
@@ -537,7 +543,7 @@ class FixCarController extends BaseController
}
$fix_id = $request->get('fix_id');
$fix_info = FixCarT::findOne(['id'=>$fix_id]);
- return $this->renderPartial('add-item',[
+ return $this->render('add-item',[
'fix_info' => $fix_info
]);
}
@@ -553,30 +559,32 @@ class FixCarController extends BaseController
$big_type_id = $request->get('big_type_id');
$type1_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=1')
+ ->asArray()
->all();
$type2_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=2')
+ ->asArray()
->all();
$type3_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=3')
+ ->asArray()
->all();
$type4_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=4')
+ ->asArray()
->all();
$type5_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=5')
+ ->asArray()
->all();
- $html = $this->renderPartial('ajax-item-list',[
+
+ return [
'type1_items' => $type1_items,
'type2_items' => $type2_items,
'type3_items' => $type3_items,
'type4_items' => $type4_items,
'type5_items' => $type5_items
- ]);
- $result['success'] = true;
- $result['msg'] = '读取成功';
- $result['html'] = $html;
- return $result;
+ ];
}
public function actionStep1List()
@@ -604,15 +612,15 @@ class FixCarController extends BaseController
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
+ $row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row;
}
return $data;
}
-
public function actionStep1ListFinish()
{
- return $this->render('step1-list');
+ return $this->render('step1-list-finish');
}
public function actionStep1ListFinishJson()
@@ -635,6 +643,7 @@ class FixCarController extends BaseController
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
+ $row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row;
}
return $data;
@@ -665,6 +674,12 @@ class FixCarController extends BaseController
public function actionStep2List()
{
+ return $this->render('step2-list');
+ }
+
+ public function actionStep2ListJson()
+ {
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
@@ -673,13 +688,20 @@ class FixCarController extends BaseController
if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]);
}
+
+ $total = $query->count();
$query = $query->orderBy('status ASC');
$items = $query->all();
- return $this->render('step2-list',[
- 'items' => $items,
- 'car_no' => $car_no
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $row = $item->toArray();
+ $row['user'] = $item->getUser()->asArray()->one();
+ $data['rows'][] = $row;
+ }
+ return $data;
}
public function actionStep2ListFinish()
@@ -703,6 +725,12 @@ class FixCarController extends BaseController
public function actionStep3List()
{
+ return $this->render('step3-list');
+ }
+
+ public function actionStep3ListJson()
+ {
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
@@ -711,17 +739,33 @@ class FixCarController extends BaseController
if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]);
}
+
+ $total = $query->count();
$query = $query->orderBy('status ASC,updated_at DESC');
$items = $query->all();
- return $this->render('step3-list',[
- 'items' => $items,
- 'car_no' => $car_no
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($items as $item) {
+ $row = $item->toArray();
+ $row['brand'] = $item->brand?$item->brand->name:'';
+ $row['series'] = $item->series?$item->series->name:'';
+ $row['show_name'] = $item->user->getShowName();
+ $row['status_txt'] = $item->getStatus();
+ $data['rows'][] = $row;
+ }
+ return $data;
}
public function actionStep4List()
{
+ return $this->render('step4-list');
+ }
+
+ public function actionStep4ListJson()
+ {
+ Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
@@ -730,6 +774,7 @@ class FixCarController extends BaseController
if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]);
}
+ $total = $query->count();
$query = $query->orderBy('status ASC');
$items = $query->all();
@@ -741,10 +786,18 @@ class FixCarController extends BaseController
}
}
- return $this->render('step4-list',[
- 'items' => $lists,
- 'car_no' => $car_no
- ]);
+ $data = [];
+ $data['total'] = $total;
+ $data['rows'] = [];
+ foreach($lists as $item) {
+ $row = $item->toArray();
+ $row['brand'] = $item->brand->name;
+ $row['series'] = $item->series->name;
+ $row['show_name'] = $item->user->getShowName();
+ $row['status_txt'] = $item->getStatus();
+ $data['rows'][] = $row;
+ }
+ return $data;
}
public function actionStep5List()
diff --git a/frontend/views/fix-car/add-item.php b/frontend/views/fix-car/add-item.php
index 305360b..f4f617b 100644
--- a/frontend/views/fix-car/add-item.php
+++ b/frontend/views/fix-car/add-item.php
@@ -1,94 +1,98 @@
-
-
-
\ No newline at end of file
+ }
+
+endBlock('footer_js'); ?>
\ No newline at end of file
diff --git a/frontend/views/fix-car/ajax-item-list.php b/frontend/views/fix-car/ajax-item-list.php
index ab853b4..ecad3ee 100644
--- a/frontend/views/fix-car/ajax-item-list.php
+++ b/frontend/views/fix-car/ajax-item-list.php
@@ -1,187 +1,177 @@
-
- 0) {
- ?>
-
- 更换清单
-
-
- 序号
- 名称
- 价格
- 数量
- 合计
- 结算方式
- 实收
- 分类
- 维修人
- 备注
-
- $item) {
- ?>
-
- =$index+1?>
- =$item->name?>
- =$item->price?>元
- =$item->count?>
- =$item->total?>元
-
-
- =$item->type?>
-
- =$item->fix_remark?>
-
-
+beginBlock('header_css'); ?>
+endBlock(); ?>
+
+
+
+
+
更换清单
+
+
+
+
+
+
+
+ ID
+ 名称
+ 价格
+ 数量
+ 合计
+ 结算方式
+ 实收
+ 分类
+ 维修人
+ 备注
+
+
+
+
+
+
+
+
+
+
维修清单
+
+
+
+
+
+
+
+ ID
+ 名称
+ 价格
+ 数量
+ 合计
+ 结算方式
+ 实收
+ 分类
+ 维修人
+ 备注
+
+
+
+
+
+
+
+
+
+
待定清单
+
+
+
+
+
+
+
+ ID
+ 名称
+ 价格
+ 数量
+ 合计
+ 结算方式
+ 实收
+ 分类
+ 维修人
+ 备注
+
+
+
+
+
+
+
+
+
+
配件清单
+
+
+
+
+
+
+
+ ID
+ 名称
+ 价格
+ 数量
+ 合计
+ 结算方式
+ 实收
+ 分类
+ 维修人
+ 备注
+
+
+
+
+
+
+
+
+
+
工时清单
+
+
+
+
+
+
+
+ ID
+ 名称
+ 价格
+ 数量
+ 合计
+ 结算方式
+ 实收
+ 分类
+ 维修人
+ 备注
+
+
+
+
+
+
+
+
+
+beginBlock('footer_js'); ?>
+
+endBlock('footer_js'); ?>
\ 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 f5d183a..6f79f32 100644
--- a/frontend/views/fix-car/my-list-edit.php
+++ b/frontend/views/fix-car/my-list-edit.php
@@ -2,8 +2,16 @@
use \common\libs\MyLib;
?>
beginBlock('header_css'); ?>
-
+
endBlock(); ?>
@@ -23,7 +31,7 @@ use \common\libs\MyLib;
-
+
ID
- 礼品名称
- 类型
- 描述
- 分类
- 添加者
- 操作时间
- 状态
+ 礼品名称
+ 类型
+ 描述
+ 分类
+ 添加者
+ 操作时间
+ 状态
@@ -351,21 +359,24 @@ use \common\libs\MyLib;
保险理赔
-
+
@@ -378,10 +389,10 @@ use \common\libs\MyLib;
ID
- 姓名
- 操作时间
- 意见
- 意见说明
+ 姓名
+ 操作时间
+ 意见
+ 意见说明
@@ -446,8 +457,6 @@ use \common\libs\MyLib;
-
-
endBlock('footer_js'); ?>
diff --git a/frontend/views/fix-car/my-list-finish.php b/frontend/views/fix-car/my-list-finish.php
index 1f30732..0c3febc 100644
--- a/frontend/views/fix-car/my-list-finish.php
+++ b/frontend/views/fix-car/my-list-finish.php
@@ -11,7 +11,7 @@ use \common\libs\MyLib;
已提单