维修保养页面修改

dev
zhaocheng 5 years ago
parent bf819df4a8
commit dbfb9a369d
  1. 99
      frontend/controllers/FixCarController.php
  2. 180
      frontend/views/fix-car/add-item.php
  3. 358
      frontend/views/fix-car/ajax-item-list.php
  4. 144
      frontend/views/fix-car/my-list-edit.php
  5. 4
      frontend/views/fix-car/my-list-finish.php
  6. 40
      frontend/views/fix-car/my-list.php
  7. 132
      frontend/views/fix-car/my-search-result.php
  8. 49
      frontend/views/fix-car/my-search.php
  9. 38
      frontend/views/fix-car/step1-list.php
  10. 175
      frontend/views/fix-car/step2-list.php
  11. 145
      frontend/views/fix-car/step3-list.php
  12. 145
      frontend/views/fix-car/step4-list.php

@ -70,7 +70,7 @@ class FixCarController extends BaseController
if($car_phone != '') { if($car_phone != '') {
$query = $query->andWhere('phone like "'.$car_phone.'"'); $query = $query->andWhere('phone like "'.$car_phone.'"');
} }
$items = $query->all(); $items = $query->asArray()->all();
return $this->render('my-search-result',[ return $this->render('my-search-result',[
'items' => $items 'items' => $items
@ -105,6 +105,7 @@ class FixCarController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;
@ -114,7 +115,6 @@ class FixCarController extends BaseController
return $this->render('my-list-finish'); return $this->render('my-list-finish');
} }
public function actionMyListFinishJson() public function actionMyListFinishJson()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
@ -140,6 +140,8 @@ class FixCarController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['show_name'] = $item->user->getShowName();
$row['status_txt'] = $item->getStatus();
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;
@ -211,8 +213,11 @@ class FixCarController extends BaseController
//礼品 //礼品
$gift_items = CarGiftT::find() $gift_items = CarGiftT::find()
->with('user')
->with('gift')
->where('car_id='.$car_info->id) ->where('car_id='.$car_info->id)
->orderBy('strategy_id DESC') ->orderBy('strategy_id DESC')
->asArray()
->all(); ->all();
$direction_items = DirectionT::find()->all(); $direction_items = DirectionT::find()->all();
@ -237,6 +242,7 @@ class FixCarController extends BaseController
$log_items = CarLogT::find() $log_items = CarLogT::find()
->where('car_id='.$info->car_id.' and type=2') ->where('car_id='.$info->car_id.' and type=2')
->orderBy('id DESC') ->orderBy('id DESC')
->asArray()
->all(); ->all();
return $this->render('my-list-edit',[ return $this->render('my-list-edit',[
@ -537,7 +543,7 @@ class FixCarController extends BaseController
} }
$fix_id = $request->get('fix_id'); $fix_id = $request->get('fix_id');
$fix_info = FixCarT::findOne(['id'=>$fix_id]); $fix_info = FixCarT::findOne(['id'=>$fix_id]);
return $this->renderPartial('add-item',[ return $this->render('add-item',[
'fix_info' => $fix_info 'fix_info' => $fix_info
]); ]);
} }
@ -553,30 +559,32 @@ class FixCarController extends BaseController
$big_type_id = $request->get('big_type_id'); $big_type_id = $request->get('big_type_id');
$type1_items = FixItemT::find() $type1_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=1') ->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=1')
->asArray()
->all(); ->all();
$type2_items = FixItemT::find() $type2_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=2') ->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=2')
->asArray()
->all(); ->all();
$type3_items = FixItemT::find() $type3_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=3') ->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=3')
->asArray()
->all(); ->all();
$type4_items = FixItemT::find() $type4_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=4') ->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=4')
->asArray()
->all(); ->all();
$type5_items = FixItemT::find() $type5_items = FixItemT::find()
->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=5') ->where('fix_id='.$fix_id.' and big_type_id='.$big_type_id.' and small_type_id=5')
->asArray()
->all(); ->all();
$html = $this->renderPartial('ajax-item-list',[
return [
'type1_items' => $type1_items, 'type1_items' => $type1_items,
'type2_items' => $type2_items, 'type2_items' => $type2_items,
'type3_items' => $type3_items, 'type3_items' => $type3_items,
'type4_items' => $type4_items, 'type4_items' => $type4_items,
'type5_items' => $type5_items 'type5_items' => $type5_items
]); ];
$result['success'] = true;
$result['msg'] = '读取成功';
$result['html'] = $html;
return $result;
} }
public function actionStep1List() public function actionStep1List()
@ -604,15 +612,15 @@ class FixCarController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;
} }
public function actionStep1ListFinish() public function actionStep1ListFinish()
{ {
return $this->render('step1-list'); return $this->render('step1-list-finish');
} }
public function actionStep1ListFinishJson() public function actionStep1ListFinishJson()
@ -635,6 +643,7 @@ class FixCarController extends BaseController
$data['rows'] = []; $data['rows'] = [];
foreach($items as $item) { foreach($items as $item) {
$row = $item->toArray(); $row = $item->toArray();
$row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;
@ -665,6 +674,12 @@ class FixCarController extends BaseController
public function actionStep2List() public function actionStep2List()
{ {
return $this->render('step2-list');
}
public function actionStep2ListJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
@ -673,13 +688,20 @@ class FixCarController extends BaseController
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]); $query = $query->andWhere(['like','car_no',$car_no]);
} }
$total = $query->count();
$query = $query->orderBy('status ASC'); $query = $query->orderBy('status ASC');
$items = $query->all(); $items = $query->all();
return $this->render('step2-list',[ $data = [];
'items' => $items, $data['total'] = $total;
'car_no' => $car_no $data['rows'] = [];
]); foreach($items as $item) {
$row = $item->toArray();
$row['user'] = $item->getUser()->asArray()->one();
$data['rows'][] = $row;
}
return $data;
} }
public function actionStep2ListFinish() public function actionStep2ListFinish()
@ -703,6 +725,12 @@ class FixCarController extends BaseController
public function actionStep3List() public function actionStep3List()
{ {
return $this->render('step3-list');
}
public function actionStep3ListJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
@ -711,17 +739,33 @@ class FixCarController extends BaseController
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]); $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');
$items = $query->all(); $items = $query->all();
return $this->render('step3-list',[ $data = [];
'items' => $items, $data['total'] = $total;
'car_no' => $car_no $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() public function actionStep4List()
{ {
return $this->render('step4-list');
}
public function actionStep4ListJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$car_no = $request->get('car_no'); $car_no = $request->get('car_no');
@ -730,6 +774,7 @@ class FixCarController extends BaseController
if($car_no != '') { if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]); $query = $query->andWhere(['like','car_no',$car_no]);
} }
$total = $query->count();
$query = $query->orderBy('status ASC'); $query = $query->orderBy('status ASC');
$items = $query->all(); $items = $query->all();
@ -741,10 +786,18 @@ class FixCarController extends BaseController
} }
} }
return $this->render('step4-list',[ $data = [];
'items' => $lists, $data['total'] = $total;
'car_no' => $car_no $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() public function actionStep5List()

@ -1,94 +1,98 @@
<form id="theFrm"> <?php
<input type="hidden" name="fix_id" value="<?=$fix_info->id?>"> use \common\libs\MyLib;
<input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>"> ?>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="table"> <?php $this->beginBlock('header_css'); ?>
<tbody> <?php $this->endBlock(); ?>
<tr class="tdbg2">
<td align="right" class="bg_tr">名称:</td> <div class="wrapper wrapper-content animated fadeInRight">
<td class="td_bg"> <div class="ibox float-e-margins">
<div align="left"> <div class="ibox-title">
<input id="name" name="name" type="text" value=""/> <h5>维修明细 - 新增</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="fix_id" value="<?=$fix_info->id?>">
<input type="hidden" name="_csrf" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" id="name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">价格</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="price" id="price">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">数量</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="count" id="count">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分类</label>
<div class="col-sm-10">
<select class="form-control" name="type" id="type">
<option>钣金</option>
<option>喷漆</option>
<option>机电</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">大类</label>
<div class="col-sm-10">
<select class="form-control" name="big_type_id" id="big_type_id">
<option value="1">保险理赔</option>
<option value="2">自费维修</option>
<option value="3">汽车保养</option>
<option value="4">汽车美容</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">小类</label>
<div class="col-sm-10">
<select class="form-control" name="small_type_id" id="small_type_id">
<option value="1">更换清单</option>
<option value="2">维修清单</option>
<option value="3">待定清单</option>
<option value="4">配件清单</option>
<option value="5">工时清单</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">备注</label>
<div class="col-sm-10">
<textarea name="car_phone" id="car_phone"></textarea>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-primary btn-save" type="button" onclick="saveInfo()">保存</button>
</div>
</div>
</form>
</div> </div>
</td> </div>
</tr> </div>
<tr class="tdbg2"> </div>
<td align="right" class="bg_tr">价格:</td> </div>
<td class="td_bg">
<div align="left"> <?php $this->beginBlock('footer_js'); ?>
<input id="price" name="price" type="text" value=""/> <script type="text/javascript" language="javascript">
</div> function saveInfo(){
</td>
</tr>
<tr class="tdbg2">
<td align="right" class="bg_tr">数量:</td>
<td class="td_bg">
<div align="left">
<input id="count" name="count" type="text" value=""/>
</div>
</td>
</tr>
<tr class="tdbg2">
<td align="right" class="bg_tr">分类:</td>
<td class="td_bg">
<div align="left">
<select name="type" id="type">
<option>钣金</option>
<option>喷漆</option>
<option>机电</option>
</select>
</div>
</td>
</tr>
<tr class="tdbg2">
<td align="right" class="bg_tr">大类:</td>
<td class="td_bg">
<div align="left">
<select name="big_type_id" id="big_type_id">
<option value="1">保险理赔</option>
<option value="2">自费维修</option>
<option value="3">汽车保养</option>
<option value="4">汽车美容</option>
</select>
</div>
</td>
</tr>
<tr class="tdbg2">
<td align="right" class="bg_tr">小类:</td>
<td class="td_bg">
<div align="left">
<select name="small_type_id" id="small_type_id">
<option value="1">更换清单</option>
<option value="2">维修清单</option>
<option value="3">待定清单</option>
<option value="4">配件清单</option>
<option value="5">工时清单</option>
</select>
</div>
</td>
</tr>
<tr class="tdbg2">
<td align="right" class="bg_tr">备注:</td>
<td class="td_bg">
<div align="left">
<textarea name="fix_remark" id="fix_remark"></textarea>
</div>
</td>
</tr>
<tr class="tdbg2">
<td height="22" colspan="4" align="center" class="td_bg">
<input id="save-btn" type=button class="ACT_btn" name="appointment-save-btn" value=" 添加 "/>
</td>
</tr>
</tbody>
</table>
</form>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script>
$('#save-btn').click(function(){
var param = $('#theFrm').serialize(); var param = $('#theFrm').serialize();
$.post('/fix-car/add-item',param,function(obj){ $.post('/fix-car/add-item',param,function(obj){
alert(obj.msg); alert(obj.msg);
parent.closeDlg(); parent.closeDlg();
},'json'); },'json');
}); }
</script> </script>
<?php $this->endBlock('footer_js'); ?>

@ -1,187 +1,177 @@
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> <?php
<?php use \common\libs\MyLib;
if(count($type1_items) > 0) { ?>
?> <?php $this->beginBlock('header_css'); ?>
<tr> <?php $this->endBlock(); ?>
<td colspan="8" style="text-align: left">更换清单</td>
</tr> <div class="wrapper wrapper-content animated fadeInRight">
<tr> <div id="type1" class="ibox float-e-margins">
<td width="50" align="center" class="bg_tr" nowrap>序号</td> <div class="ibox-title">
<td width="100" align="center" class="bg_tr" nowrap>名称</td> <h5>更换清单</h5>
<td width="80" align="center" class="bg_tr" nowrap>价格</td> </div>
<td width="50" align="center" class="bg_tr" nowrap>数量</td> <div class="ibox-content">
<td width="80" align="center" class="bg_tr" nowrap>合计</td> <div class="row">
<td width="100" align="center" class="bg_tr" nowrap>结算方式</td> <div class="col-md-12">
<td width="80" align="center" class="bg_tr" nowrap>实收</td> <table id="type1ListTable">
<td width="100" align="center" class="bg_tr" nowrap>分类</td> <thead>
<td width="100" align="center" class="bg_tr" nowrap>维修人</td> <tr>
<td width="150" align="center" class="bg_tr" nowrap>备注</td> <th data-field="id">ID</th>
</tr> <th data-field="name">名称</th>
<?php <th data-field="price">价格</th>
foreach($type1_items as $index => $item) { <th data-field="count">数量</th>
?> <th data-field="total">合计</th>
<tr> <th data-field="">结算方式</th>
<td align="center" class="td_bg"nowrap ><?=$index+1?></td> <th data-field="">实收</th>
<td class="td_bg" style="word-break: break-all"><?=$item->name?></td> <th data-field="type">分类</th>
<td align="center" class="td_bg" nowrap><?=$item->price?></td> <th data-field="">维修人</th>
<td align="center" class="td_bg" style="word-break: break-all"><?=$item->count?></td> <th data-field="fix_remark">备注</th>
<td align="center" class="td_bg" nowrap><?=$item->total?></td> </tr>
<td class="td_bg" nowrap></td> </thead>
<td align="center" class="td_bg" nowrap></td> </table>
<td align="center" class="td_bg" nowrap><?=$item->type?></td> </div>
<td align="center" class="td_bg" nowrap></td> </div>
<td align="center" class="td_bg" nowrap><?=$item->fix_remark?></td> </div>
</tr> </div>
<?php <div id="type2" class="ibox float-e-margins">
<div class="ibox-title">
<h5>维修清单</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="type2ListTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名称</th>
<th data-field="price">价格</th>
<th data-field="count">数量</th>
<th data-field="total">合计</th>
<th data-field="">结算方式</th>
<th data-field="">实收</th>
<th data-field="type">分类</th>
<th data-field="">维修人</th>
<th data-field="fix_remark">备注</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div id="type3" class="ibox float-e-margins">
<div class="ibox-title">
<h5>待定清单</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="type3ListTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名称</th>
<th data-field="price">价格</th>
<th data-field="count">数量</th>
<th data-field="total">合计</th>
<th data-field="">结算方式</th>
<th data-field="">实收</th>
<th data-field="type">分类</th>
<th data-field="">维修人</th>
<th data-field="fix_remark">备注</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div id="type4" class="ibox float-e-margins">
<div class="ibox-title">
<h5>配件清单</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="type4ListTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名称</th>
<th data-field="price">价格</th>
<th data-field="count">数量</th>
<th data-field="total">合计</th>
<th data-field="">结算方式</th>
<th data-field="">实收</th>
<th data-field="type">分类</th>
<th data-field="">维修人</th>
<th data-field="fix_remark">备注</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div id="type5" class="ibox float-e-margins">
<div class="ibox-title">
<h5>工时清单</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="type5ListTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名称</th>
<th data-field="price">价格</th>
<th data-field="count">数量</th>
<th data-field="total">合计</th>
<th data-field="">结算方式</th>
<th data-field="">实收</th>
<th data-field="type">分类</th>
<th data-field="">维修人</th>
<th data-field="fix_remark">备注</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
var items = {
type1: <?=json_encode($type1_items)?>,
type2: <?=json_encode($type2_items)?>,
type3: <?=json_encode($type3_items)?>,
type4: <?=json_encode($type4_items)?>,
type5: <?=json_encode($type5_items)?>,
};
$.each(items,function(i,d)){
var $table = $('#'+i+'ListTable');
$table.hide();
if(d.length>0){
loadData($table.d);
$table.show();
} }
} }
?>
<?php function loadData(target,data) {
if(count($type2_items) > 0) { target.bootstrapTable('destroy');
?> target.bootstrapTable({
<tr> data: data,
<td colspan="8" style="text-align: left">维修清单</td> pagination: true,
</tr> sidePagination: 'server',
<tr> queryParams: function(params) {
<td width="50" align="center" class="bg_tr" nowrap>序号</td> return params;
<td width="100" align="center" class="bg_tr" nowrap>名称</td> }
<td width="80" align="center" class="bg_tr" nowrap>价格</td> });
<td width="50" align="center" class="bg_tr" nowrap>数量</td> return false;
<td width="80" align="center" class="bg_tr" nowrap>合计</td>
<td width="100" align="center" class="bg_tr" nowrap>结算方式</td>
<td width="80" align="center" class="bg_tr" nowrap>实收</td>
<td width="100" align="center" class="bg_tr" nowrap>分类</td>
<td width="100" align="center" class="bg_tr" nowrap>维修人</td>
<td width="150" align="center" class="bg_tr" nowrap>备注</td>
</tr>
<?php
foreach($type2_items as $index => $item) {
?>
<tr>
<td align="center" class="td_bg"nowrap ><?=$index+1?></td>
<td class="td_bg" style="word-break: break-all"><?=$item->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->price?></td>
<td align="center" class="td_bg" style="word-break: break-all"><?=$item->count?></td>
<td align="center" class="td_bg" nowrap><?=$item->total?></td>
<td class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->type?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->fix_remark?></td>
</tr>
<?php
}
}
?>
<?php
if(count($type3_items) > 0) {
?>
<tr>
<td colspan="8" style="text-align: left">待定清单</td>
</tr>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>序号</td>
<td width="100" align="center" class="bg_tr" nowrap>名称</td>
<td width="80" align="center" class="bg_tr" nowrap>价格</td>
<td width="50" align="center" class="bg_tr" nowrap>数量</td>
<td width="80" align="center" class="bg_tr" nowrap>合计</td>
<td width="100" align="center" class="bg_tr" nowrap>结算方式</td>
<td width="80" align="center" class="bg_tr" nowrap>实收</td>
<td width="100" align="center" class="bg_tr" nowrap>分类</td>
<td width="100" align="center" class="bg_tr" nowrap>维修人</td>
<td width="150" align="center" class="bg_tr" nowrap>备注</td>
</tr>
<?php
foreach($type3_items as $index => $item) {
?>
<tr>
<td align="center" class="td_bg"nowrap ><?=$index+1?></td>
<td class="td_bg" style="word-break: break-all"><?=$item->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->price?></td>
<td align="center" class="td_bg" style="word-break: break-all"><?=$item->count?></td>
<td align="center" class="td_bg" nowrap><?=$item->total?></td>
<td class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->type?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->fix_remark?></td>
</tr>
<?php
}
}
?>
<?php
if(count($type4_items) > 0) {
?>
<tr>
<td colspan="8" style="text-align: left">配件清单</td>
</tr>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>序号</td>
<td width="100" align="center" class="bg_tr" nowrap>名称</td>
<td width="80" align="center" class="bg_tr" nowrap>价格</td>
<td width="50" align="center" class="bg_tr" nowrap>数量</td>
<td width="80" align="center" class="bg_tr" nowrap>合计</td>
<td width="100" align="center" class="bg_tr" nowrap>结算方式</td>
<td width="80" align="center" class="bg_tr" nowrap>实收</td>
<td width="100" align="center" class="bg_tr" nowrap>分类</td>
<td width="100" align="center" class="bg_tr" nowrap>维修人</td>
<td width="150" align="center" class="bg_tr" nowrap>备注</td>
</tr>
<?php
foreach($type4_items as $index => $item) {
?>
<tr>
<td align="center" class="td_bg"nowrap ><?=$index+1?></td>
<td class="td_bg" style="word-break: break-all"><?=$item->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->price?></td>
<td align="center" class="td_bg" style="word-break: break-all"><?=$item->count?></td>
<td align="center" class="td_bg" nowrap><?=$item->total?></td>
<td class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->type?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->fix_remark?></td>
</tr>
<?php
}
}
?>
<?php
if(count($type5_items) > 0) {
?>
<tr>
<td colspan="8" style="text-align: left">工时清单</td>
</tr>
<tr>
<td width="50" align="center" class="bg_tr" nowrap>序号</td>
<td width="100" align="center" class="bg_tr" nowrap>名称</td>
<td width="80" align="center" class="bg_tr" nowrap>价格</td>
<td width="50" align="center" class="bg_tr" nowrap>数量</td>
<td width="80" align="center" class="bg_tr" nowrap>合计</td>
<td width="100" align="center" class="bg_tr" nowrap>结算方式</td>
<td width="80" align="center" class="bg_tr" nowrap>实收</td>
<td width="100" align="center" class="bg_tr" nowrap>分类</td>
<td width="100" align="center" class="bg_tr" nowrap>维修人</td>
<td width="150" align="center" class="bg_tr" nowrap>备注</td>
</tr>
<?php
foreach($type5_items as $index => $item) {
?>
<tr>
<td align="center" class="td_bg"nowrap ><?=$index+1?></td>
<td class="td_bg" style="word-break: break-all"><?=$item->name?></td>
<td align="center" class="td_bg" nowrap><?=$item->price?></td>
<td align="center" class="td_bg" style="word-break: break-all"><?=$item->count?></td>
<td align="center" class="td_bg" nowrap><?=$item->total?></td>
<td class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->type?></td>
<td align="center" class="td_bg" nowrap></td>
<td align="center" class="td_bg" nowrap><?=$item->fix_remark?></td>
</tr>
<?php
}
} }
?> </script>
</table> <?php $this->endBlock('footer_js'); ?>

@ -2,8 +2,16 @@
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<?php $this->beginBlock('header_css'); ?> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> <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(); ?> <?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
@ -23,7 +31,7 @@ use \common\libs\MyLib;
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<form role="form" class="form-inline" id="theFrm"> <form role="form" class="form-inline" id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>" /> <input type="hidden" name="id" id="id" value="<?=$info->id?>" />
<input type="hidden" name="car_id" value="<?=$info->car_id?>" /> <input type="hidden" name="car_id" value="<?=$info->car_id?>" />
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">车牌号</label> <label class="control-label">车牌号</label>
@ -38,7 +46,7 @@ use \common\libs\MyLib;
<input type="text" name="car_frame_no" value="<?=$info->car_frame_no?>" class="form-control"> <input type="text" name="car_frame_no" value="<?=$info->car_frame_no?>" class="form-control">
</div> </div>
<div class="form-group col-md-3" style="margin-bottom: 8px;"> <div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="call_result">事故类型</label> <label class="control-label">事故类型</label>
<select name="accident_type" id="accident_type" class="form-control"> <select name="accident_type" id="accident_type" class="form-control">
<option><?=$info->accident_type?></option> <option><?=$info->accident_type?></option>
<option>单方</option> <option>单方</option>
@ -327,19 +335,19 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form class="row"> <div class="row">
<form id="giftFrm" class="col-md-12"> <form id="giftFrm" class="col-md-12">
<table id="listTable"> <table id="listTable">
<thead> <thead>
<tr> <tr>
<th data-field="id">ID</th> <th data-field="id">ID</th>
<th data-field="car_no">礼品名称</th> <th data-field="gift.name">礼品名称</th>
<th data-field="id_man">类型</th> <th data-field="gift.type_id" data-formatter="typeFormatter">类型</th>
<th data-field="link_man">描述</th> <th data-field="gift.remark">描述</th>
<th data-field="link_phone">分类</</th> <th data-field="strategy_id" data-formatter="strategyFormatter">分类</</th>
<th data-field="submit_date">添加者</th> <th data-field="user" data-formatter="showNameFormatter">添加者</th>
<th data-field="show_name">操作时间</th> <th data-field="submit_time"data-formatter="dateFormatter">操作时间</th>
<th data-field="status">状态</th> <th data-field="status" data-formatter="statusFormatter">状态</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -351,21 +359,24 @@ use \common\libs\MyLib;
<div class="ibox-title fixed"> <div class="ibox-title fixed">
<h5>保险理赔</h5> <h5>保险理赔</h5>
</div> </div>
</div> <div id="list3" class="ibox-content"></div>
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title fixed"> <div class="ibox-title fixed">
<h5>自费维修</h5> <h5>自费维修</h5>
</div> </div>
<div id="list4" class="ibox-content"></div>
</div> </div>
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title fixed"> <div class="ibox-title fixed">
<h5>汽车保养</h5> <h5>汽车保养</h5>
</div> </div>
<div id="list5" class="ibox-content"></div>
</div> </div>
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title fixed"> <div class="ibox-title fixed">
<h5>汽车美容</h5> <h5>汽车美容</h5>
</div> </div>
<div id="list6" class="ibox-content"></div>
</div> </div>
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title fixed"> <div class="ibox-title fixed">
@ -378,10 +389,10 @@ use \common\libs\MyLib;
<thead> <thead>
<tr> <tr>
<th data-field="id">ID</th> <th data-field="id">ID</th>
<th data-field="car_no">姓名</th> <th data-field="op_man">姓名</th>
<th data-field="id_man">操作时间</th> <th data-field="op_time" data-formatter="dateFormatter">操作时间</th>
<th data-field="link_man">意见</th> <th data-field="info">意见</th>
<th data-field="link_phone">意见说明</</th> <th data-field="remark">意见说明</</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -446,8 +457,6 @@ use \common\libs\MyLib;
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> <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/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/assets/js/plugins/layer/laydate/laydate.js"></script>
<script src="/assets/js/plugins/clockpicker/clockpicker.js"></script>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(function () { $(function () {
$('.input-date').datepicker({ $('.input-date').datepicker({
@ -455,12 +464,54 @@ use \common\libs\MyLib;
forceParse: false, forceParse: false,
autoclose: true autoclose: true
}); });
$('.clockpicker').clockpicker();
$('#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');
}
});
reloadItems();
myListGift(); myListGift();
myListLog(); myListLog();
}); });
// 刷新明细
// 动态加载html
function reloadItems() {
var id = $('#id').val();
if(id > 0) {
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=1','list3');
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=2','list4');
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=3','list5');
getPage('/fix-car/ajax-item-list?fix_id=' + id + '&big_type_id=4','list6');
}
}
function getPage(url,idname) {
$.get(url,{},function(html){
html&&$('#' + idname).html(html);
});
}
// 保存维修信息 // 保存维修信息
function saveMyList(){ function saveMyList(){
if(confirm('是否确认提交?')) { if(confirm('是否确认提交?')) {
@ -483,6 +534,7 @@ use \common\libs\MyLib;
pagination: true, pagination: true,
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
console.log(params);
return params; return params;
} }
}); });
@ -563,7 +615,7 @@ use \common\libs\MyLib;
function addInfo(){ function addInfo(){
var id = $('#id').val(); var id = $('#id').val();
if(id > 0) { if(id > 0) {
art.dialog.open('/fix-car/add-item?fix_id=' + id); layer_show('维修明细', '/fix-car/add-item?fix_id=' + id);
} else { } else {
alert('请先保存维修信息'); alert('请先保存维修信息');
} }
@ -607,5 +659,57 @@ use \common\libs\MyLib;
echo 'window.location.href="'.$url.'"'; 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> </script>
<?php $this->endBlock('footer_js'); ?> <?php $this->endBlock('footer_js'); ?>

@ -11,7 +11,7 @@ use \common\libs\MyLib;
<h5>已提单</h5> <h5>已提单</h5>
<div class="ibox-tools"> <div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="/fix-car/my-search""> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="/fix-car/my-search"">
<i class="fa fa-refresh"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新 <i class="fa fa-refresh"></i> 刷新
@ -38,7 +38,7 @@ use \common\libs\MyLib;
<th data-field="link_phone">电话</th> <th data-field="link_phone">电话</th>
<th data-field="submit_date">提单日期</th> <th data-field="submit_date">提单日期</th>
<th data-field="show_name">提单者</th> <th data-field="show_name">提单者</th>
<th data-field="status">状态</th> <th data-field="status_txt">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>

@ -37,8 +37,8 @@ use \common\libs\MyLib;
<th data-field="link_man">联系人</th> <th data-field="link_man">联系人</th>
<th data-field="link_phone">电话</th> <th data-field="link_phone">电话</th>
<th data-field="submit_date">提单日期</th> <th data-field="submit_date">提单日期</th>
<th data-field="show_name">提单者</th> <th data-field="user" data-formatter="showNameFormatter">提单者</th>
<th data-field="status">状态</th> <th data-field="status" data-formatter="statusFormatter">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -66,7 +66,7 @@ use \common\libs\MyLib;
return opStr.join(' '); return opStr.join(' ');
} }
function create() { function create() {
title = '维修提单'; var title = '维修提单';
layer_show(title, '/fix-car/my-search'); layer_show(title, '/fix-car/my-search');
} }
function edit(id) { function edit(id) {
@ -103,6 +103,40 @@ use \common\libs\MyLib;
return false; return false;
} }
function showNameFormatter(value){
return value.username + '(' + value.name + ')';
}
function statusFormatter(value){
var result = '';
switch(+value) {
case 1:
result = '维修调度';
break;
case 2:
result = '司机接车';
break;
case 3:
result = '前台派工';
break;
case 4:
result = '查勘定损';
break;
case 5:
result = '技工维修';
break;
case 6:
result = '总检';
break;
case 7:
result = '财务结算';
break;
default:
result = '';
}
return result;
}
$(function() { $(function() {
search(); search();
}); });

@ -1,74 +1,80 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <?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="/fix-car/my-search">
<i class="fa fa-backward"></i> 返回
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="car_no">车牌号</th>
<th data-field="car_man">车主</th>
<th data-field="phone">电话</th>
<th data-field="engine_no">发动机号</th>
<th data-field="car_frame_no">车架号</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 type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
//编辑 function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="添加修车记录"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function edit(id) { function edit(id) {
var title = '修车记录';
window.location.href = '/fix-car/my-list-edit?car_id=' + id + '&status=0'; window.location.href = '/fix-car/my-list-edit?car_id=' + id + '&status=0';
} }
//删除
function del(id) { function refreshList() {
if(confirm('是否确认删除?')) { $('#listTable').bootstrapTable('refresh');
$.post('/fix-car/my-list-delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
} }
$(function(){
$("#search-btn").click(function(){ function search() {
var params = $('#searchForm').serialize(); $('#listTable').bootstrapTable('destroy');
window.location.href = "/fix-car/my-list?" + params; $('#listTable').bootstrapTable({
}); data: <?=json_encode($items)?>,
$('#add-btn').click(function(){ pagination: true,
window.location.href = '/fix-car/my-search'; sidePagination: 'server',
}); queryParams: function(params) {
//返回按钮 return params;
$('#back-btn').click(function(){ }
window.location.href='/fix-car/my-search';
}); });
return false;
}
$(function() {
search();
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<tr>
<td class="td_bg">
搜索结果
<input type="button" class="act_btn" id="back-btn" name="back-btn" value="返回">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td align="center" align="center" class="bg_tr">车牌号</td>
<td align="center" align="center" class="bg_tr">车主</td>
<td align="center" align="center" class="bg_tr">电话</td>
<td align="center" align="center" class="bg_tr">发动机号</td>
<td align="center" align="center" class="bg_tr">车架号</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->phone?></td>
<td align="left" class="td_bg" nowrap><?=$item->engine_no?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_frame_no?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">添加修车记录</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -7,46 +7,47 @@ use \common\libs\MyLib;
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>销售提单 - 新增</h5> <h5>维修提单 - 新增</h5>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<form role="form" class="form-horizontal data-from" id="theFrm"> <form role="form" class="form-horizontal" id="theFrm">
<div class="row"> <div class="form-group">
<div class="form-group col-md-3" style="margin-right: 1%;"> <label class="col-sm-2 control-label">车牌号</label>
<label class="control-label">车牌号</label> <div class="col-sm-10">
<input type="text" class="form-control" name="car_no" id="car_no"> <input type="text" class="form-control" name="car_no" id="car_no">
</div> </div>
<div class="form-group col-md-3" style="margin-right: 1%;"> </div>
<label class="control-label">发动机号</label> <div class="form-group">
<label class="col-sm-2 control-label">发动机号</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="engine_no" id="engine_no"> <input type="text" class="form-control" name="engine_no" id="engine_no">
</div> </div>
<div class="form-group col-md-3" style="margin-right: 1%;"> </div>
<label class="control-label">车架号</label> <div class="form-group">
<label class="col-sm-2 control-label">车架号</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="car_frame_no" id="car_frame_no"> <input type="text" class="form-control" name="car_frame_no" id="car_frame_no">
</div> </div>
</div> </div>
<div class="row"> <div class="form-group">
<div class="form-group col-md-3" style="margin-right: 1%;"> <label class="col-sm-2 control-label">车主</label>
<label class="control-label">车主</label> <div class="col-sm-10">
<input type="text" class="form-control" name="car_man" id="car_man"> <input type="text" class="form-control" name="car_man" id="car_man">
</div> </div>
<div class="form-group col-md-3" style="margin-right: 1%;"> </div>
<label class="control-label">手机</label> <div class="form-group">
<label class="col-sm-2 control-label">手机</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="car_phone" id="car_phone"> <input type="text" class="form-control" name="car_phone" id="car_phone">
</div> </div>
</div> </div>
<div class="row"> <div class="hr-line-dashed"></div>
<div class="col-md-2 col-md-offset-3"> <div class="form-group">
<button class="btn btn-primary btn-save" type="button" onclick="saveInfo()"> <div class="col-sm-4 col-sm-offset-2">
<strong>搜索</strong> <button class="btn btn-primary btn-save" type="button" onclick="saveInfo()">搜索</button>
</button> <button class="btn btn-primary btn-save" type="button" onclick="goBack()">返回</button>
</div>
<div class="col-md-2">
<button class="btn btn-primary btn-save" type="button" onclick="goBack()">
<strong>返回</strong>
</button>
</div> </div>
</div> </div>
</form> </form>

@ -38,8 +38,8 @@ use \common\libs\MyLib;
<th data-field="receive_date">接车日期</th> <th data-field="receive_date">接车日期</th>
<th data-field="accident_type">事故类型</th> <th data-field="accident_type">事故类型</th>
<th data-field="responsibility">责任</th> <th data-field="responsibility">责任</th>
<th data-field="show_name">提单者</th> <th data-field="user" data-formatter="showNameFormatter">提单者</th>
<th data-field="status">状态</th> <th data-field="status" data-formatter="statusFormatter">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -85,6 +85,40 @@ use \common\libs\MyLib;
return false; return false;
} }
function showNameFormatter(value){
return value.username + '(' + value.name + ')';
}
function statusFormatter(value){
var result = '';
switch(+value) {
case 1:
result = '维修调度';
break;
case 2:
result = '司机接车';
break;
case 3:
result = '前台派工';
break;
case 4:
result = '查勘定损';
break;
case 5:
result = '技工维修';
break;
case 6:
result = '总检';
break;
case 7:
result = '财务结算';
break;
default:
result = '';
}
return result;
}
$(function() { $(function() {
search(); search();
}); });

@ -1,69 +1,122 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <?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="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" 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">
</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="link_man">联系人</th>
<th data-field="car_no">车牌号</th>
<th data-field="brand">品牌</th>
<th data-field="series">车型</th>
<th data-field="address">地址</th>
<th data-field="">代步车</th>
<th data-field="receive_date">接车日期</th>
<th data-field="accident_type">事故类型</th>
<th data-field="responsibility">责任</th>
<th data-field="show_name">提单者</th>
<th data-field="status" data-formatter="statusFormatter">状态</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 type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
//编辑 function opFormatter(value, row, index) {
function edit(id,status) { var opStr = [];
window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=2'; opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ',' + row.status +')">');
opStr.push('<i class="fa fa-edit" title="详情"></i>');
opStr.push('</a>');
return opStr.join(' ');
} }
$(function(){ function edit(id) {
$("#search-btn").click(function(){ var title = '司机接车';
var params = $('#searchForm').serialize(); window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=1';
window.location.href = "/fix-car/step2-list?" + params; }
});
$('#add-btn').click(function(){ function refreshList() {
edit(0); $('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/fix-car/step2-list-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
}); });
return false;
}
function statusFormatter(value){
var result = '';
switch(+value) {
case 1:
result = '维修调度';
break;
case 2:
result = '司机接车';
break;
case 3:
result = '前台派工';
break;
case 4:
result = '查勘定损';
break;
case 5:
result = '技工维修';
break;
case 6:
result = '总检';
break;
case 7:
result = '财务结算';
break;
default:
result = '';
}
return result;
}
$(function() {
search();
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<tr>
<td class="td_bg">
车牌号:<input name="car_no" type="text" value="<?=$car_no?>">
<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="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td align="center" align="center" class="bg_tr">联系人</td>
<td align="center" align="center" class="bg_tr">车牌号</td>
<td align="center" align="center" class="bg_tr">品牌</td>
<td align="center" align="center" class="bg_tr">车型</td>
<td align="center" align="center" class="bg_tr">地址</td>
<td align="center" align="center" class="bg_tr">代步车</td>
<td align="center" align="center" class="bg_tr">事故类型</td>
<td align="center" align="center" class="bg_tr">责任</td>
<td align="center" align="center" class="bg_tr">提单者</td>
<td align="center" align="center" class="bg_tr">状态</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->link_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="left" class="td_bg" nowrap><?=$item->brand?$item->brand->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->series?$item->series->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->address?></td>
<td align="left" class="td_bg" nowrap></td>
<td align="left" class="td_bg" nowrap><?=$item->accident_type?></td>
<td align="left" class="td_bg" nowrap><?=$item->responsibility?></td>
<td align="left" class="td_bg" nowrap><?=$item->user->getShowName()?></td>
<td align="left" class="td_bg" nowrap><?=$item->getStatus()?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>,<?=$item->status?>)">详情</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -1,69 +1,92 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <?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="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" 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">
</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="link_man">联系人</th>
<th data-field="car_no">车牌号</th>
<th data-field="brand">品牌</th>
<th data-field="series">车型</th>
<th data-field="address">地址</th>
<th data-field="">代步车</th>
<th data-field="receive_date">接车日期</th>
<th data-field="accident_type">事故类型</th>
<th data-field="responsibility">责任</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>
<?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"> <script type="text/javascript" language="javascript">
//编辑 function opFormatter(value, row, index) {
function edit(id,status) { var opStr = [];
window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=3&gift_enable=1'; opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ',' + row.status +')">');
opStr.push('<i class="fa fa-edit" title="详情"></i>');
opStr.push('</a>');
return opStr.join(' ');
} }
$(function(){ function edit(id) {
$("#search-btn").click(function(){ var title = '前台派工';
var params = $('#searchForm').serialize(); window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=1';
window.location.href = "/fix-car/step3-list?" + params; }
});
$('#add-btn').click(function(){ function refreshList() {
edit(0); $('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/fix-car/step3-list-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
}); });
return false;
}
$(function() {
search();
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<tr>
<td class="td_bg">
车牌号:<input name="car_no" type="text" value="<?=$car_no?>">
<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="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td align="center" align="center" class="bg_tr">联系人</td>
<td align="center" align="center" class="bg_tr">车牌号</td>
<td align="center" align="center" class="bg_tr">品牌</td>
<td align="center" align="center" class="bg_tr">车型</td>
<td align="center" align="center" class="bg_tr">地址</td>
<td align="center" align="center" class="bg_tr">代步车</td>
<td align="center" align="center" class="bg_tr">事故类型</td>
<td align="center" align="center" class="bg_tr">责任</td>
<td align="center" align="center" class="bg_tr">提单者</td>
<td align="center" align="center" class="bg_tr">状态</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->link_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="left" class="td_bg" nowrap><?=$item->brand?$item->brand->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->series?$item->series->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->address?></td>
<td align="left" class="td_bg" nowrap></td>
<td align="left" class="td_bg" nowrap><?=$item->accident_type?></td>
<td align="left" class="td_bg" nowrap><?=$item->responsibility?></td>
<td align="left" class="td_bg" nowrap><?=$item->user->getShowName()?></td>
<td align="left" class="td_bg" nowrap><?=$item->getStatus()?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>,<?=$item->status?>)">详情</a>]
</td>
</tr>
<?php
}
?>
</table>

@ -1,69 +1,92 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <?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="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" 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">
</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="link_man">联系人</th>
<th data-field="car_no">车牌号</th>
<th data-field="brand">品牌</th>
<th data-field="series">车型</th>
<th data-field="address">地址</th>
<th data-field="">代步车</th>
<th data-field="receive_date">接车日期</th>
<th data-field="accident_type">事故类型</th>
<th data-field="responsibility">责任</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>
<?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"> <script type="text/javascript" language="javascript">
//编辑 function opFormatter(value, row, index) {
function edit(id,status) { var opStr = [];
window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=4'; opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ',' + row.status +')">');
opStr.push('<i class="fa fa-edit" title="详情"></i>');
opStr.push('</a>');
return opStr.join(' ');
} }
$(function(){ function edit(id) {
$("#search-btn").click(function(){ var title = '查勘定损';
var params = $('#searchForm').serialize(); window.location.href = '/fix-car/my-list-edit?id=' + id + '&status=' + status + '&type=1';
window.location.href = "/fix-car/step4-list?" + params; }
});
$('#add-btn').click(function(){ function refreshList() {
edit(0); $('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/fix-car/step4-list-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
}); });
return false;
}
$(function() {
search();
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<tr>
<td class="td_bg">
车牌号:<input name="car_no" type="text" value="<?=$car_no?>">
<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="50" align="center" align="center" class="bg_tr" nowrap>排序</td>
<td align="center" align="center" class="bg_tr">联系人</td>
<td align="center" align="center" class="bg_tr">车牌号</td>
<td align="center" align="center" class="bg_tr">品牌</td>
<td align="center" align="center" class="bg_tr">车型</td>
<td align="center" align="center" class="bg_tr">地址</td>
<td align="center" align="center" class="bg_tr">代步车</td>
<td align="center" align="center" class="bg_tr">事故类型</td>
<td align="center" align="center" class="bg_tr">责任</td>
<td align="center" align="center" class="bg_tr">提单者</td>
<td align="center" align="center" class="bg_tr">状态</td>
<td width="30" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($items as $index => $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap><?=$index+1?></td>
<td align="left" class="td_bg" nowrap><?=$item->link_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->car_no?></td>
<td align="left" class="td_bg" nowrap><?=$item->brand?$item->brand->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->series?$item->series->name:''?></td>
<td align="left" class="td_bg" nowrap><?=$item->address?></td>
<td align="left" class="td_bg" nowrap></td>
<td align="left" class="td_bg" nowrap><?=$item->accident_type?></td>
<td align="left" class="td_bg" nowrap><?=$item->responsibility?></td>
<td align="left" class="td_bg" nowrap><?=$item->user->getShowName()?></td>
<td align="left" class="td_bg" nowrap><?=$item->getStatus()?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>,<?=$item->status?>)">详情</a>]
</td>
</tr>
<?php
}
?>
</table>
Loading…
Cancel
Save