修改维修保养字段显示

dev
zhaocheng 5 years ago
parent f38f5e51be
commit 099be1c84f
  1. 13
      frontend/controllers/FixCarController.php
  2. 6
      frontend/views/fix-car/my-list-edit.php
  3. 38
      frontend/views/fix-car/my-list.php
  4. 38
      frontend/views/fix-car/step1-list.php
  5. 32
      frontend/views/fix-car/step2-list.php

@ -105,7 +105,8 @@ 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(); $row['show_name'] = $item->user->getShowName();
$row['status_txt'] = $item->getStatus();
$data['rows'][] = $row; $data['rows'][] = $row;
} }
return $data; return $data;
@ -612,7 +613,10 @@ 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(); $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; $data['rows'][] = $row;
} }
return $data; return $data;
@ -698,7 +702,10 @@ 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(); $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; $data['rows'][] = $row;
} }
return $data; return $data;

@ -523,7 +523,7 @@ use \common\libs\MyLib;
var table_data = []; var table_data = [];
$.each(data,function(name,item){ $.each(data,function(name,item){
if (item[1].length) { if (item[1].length) {
table_data.push(item[1]); table_data[name] = item[1];
html += '<div class="ibox float-e-margins">' + html += '<div class="ibox float-e-margins">' +
' <div class="ibox-title">' + ' <div class="ibox-title">' +
' <h5>'+ item[0] +'</h5>' + ' <h5>'+ item[0] +'</h5>' +
@ -531,7 +531,7 @@ use \common\libs\MyLib;
' <div class="ibox-content">' + ' <div class="ibox-content">' +
' <div class="row">' + ' <div class="row">' +
' <div class="col-md-12">' + ' <div class="col-md-12">' +
' <table id="'+ id + '_' + name +'_table">' + ' <table id="'+ id + '_' + name +'_table" data-name="'+ name +'">' +
' <thead>' + ' <thead>' +
' <tr>' + ' <tr>' +
' <th data-field="id">ID</th>' + ' <th data-field="id">ID</th>' +
@ -556,7 +556,7 @@ use \common\libs\MyLib;
$('#'+ id).html(html).find('table').each(function(i,target){ $('#'+ id).html(html).find('table').each(function(i,target){
$(target).bootstrapTable("destroy"); $(target).bootstrapTable("destroy");
$(target).bootstrapTable({ $(target).bootstrapTable({
data: table_data[i], data: table_data[$(target).data('name')],
pagination: false, pagination: false,
queryParams: function (params) { queryParams: function (params) {
return params; return params;

@ -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="user" data-formatter="showNameFormatter">提单者</th> <th data-field="show_name">提单者</th>
<th data-field="status" data-formatter="statusFormatter">状态</th> <th data-field="status_txt">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -103,40 +103,6 @@ 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();
}); });

@ -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="user" data-formatter="showNameFormatter">提单者</th> <th data-field="show_name">提单者</th>
<th data-field="status" data-formatter="statusFormatter">状态</th> <th data-field="status_txt">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -85,40 +85,6 @@ 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();
}); });

@ -39,7 +39,7 @@ use \common\libs\MyLib;
<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="show_name">提单者</th>
<th data-field="status" data-formatter="statusFormatter">状态</th> <th data-field="status_txt">状态</th>
<th data-formatter="opFormatter">操作</th> <th data-formatter="opFormatter">操作</th>
</tr> </tr>
</thead> </thead>
@ -85,36 +85,6 @@ use \common\libs\MyLib;
return false; 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() { $(function() {
search(); search();
}); });

Loading…
Cancel
Save