维修提单列表,编辑页面

dev
zhaocheng 5 years ago
parent 22c26ef453
commit a43ebd7f2a
  1. 454
      composer.lock
  2. 21
      frontend/controllers/FixCarController.php
  3. 2
      frontend/controllers/PhoneCenterController.php
  4. 869
      frontend/views/fix-car/my-list-edit.php
  5. 164
      frontend/views/fix-car/my-list.php
  6. 1
      frontend/views/phone-center/call-records.php

454
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -77,8 +77,13 @@ class FixCarController extends BaseController
]);
}
public function actionMyList()
public function actionMyList() {
return $this->render('my-list');
}
public function actionMyListJson()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$car_no = $request->get('car_no');
@ -90,13 +95,19 @@ class FixCarController extends BaseController
if($car_no != '') {
$query = $query->andWhere(['like','car_no',$car_no]);
}
$total = $query->count();
$query = $query->orderBy('id DESC');
$items = $query->all();
return $this->render('my-list',[
'items' => $items,
'car_no' => $car_no
]);
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
}
return $data;
}
public function actionMyListFinish()

@ -71,6 +71,8 @@ class PhoneCenterController extends BaseController
$company_id=2;
}elseif ($company_type == 2){
$company_id=3;
}else {
$company_id=0;
}
$query = NetworkPhoneT::find()

File diff suppressed because it is too large Load Diff

@ -1,82 +1,110 @@
<?php
use \common\libs\MyLib;
?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>维修提单</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)">
<i class="fa fa-plus"></i> 添加
</a>
<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="car_no">车牌号</th>
<th data-field="id_man">被保险人</th>
<th data-field="link_man">联系人</th>
<th data-field="link_phone">电话</th>
<th data-field="submit_date">提单日期</th>
<th data-field="show_name">提单者</th>
<th data-field="status">状态</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">
//编辑
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>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function create() {
title = '维修提单';
layer_show(title, '/fix-car/my-search');
}
function edit(id) {
var title = '维修信息';
window.location.href = '/fix-car/my-list-edit?id=' + id;
}
//删除
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/fix-car/my-list-delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
parent.layer.confirm('是否确认删除?', {
btn: ['删除','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/fix-car/my-list-delete',{id:id},function(data) {
parent.layer.msg(data.msg);
refreshList();
}, 'json');
}, function(){
//
});
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/fix-car/my-list-json",
pagination: true,
sidePagination: 'server',
queryParams: function(params) {
return params;
}
$(function(){
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/fix-car/my-list?" + params;
});
$('#add-btn').click(function(){
window.location.href = '/fix-car/my-search';
});
return false;
}
$(function() {
search();
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<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="搜索">
<input type="button" class="act_btn" id="add-btn" name="add-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 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->id_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->link_man?></td>
<td align="left" class="td_bg" nowrap><?=$item->link_phone?></td>
<td align="left" class="td_bg" nowrap><?=$item->submit_date?></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>
<?php
if($item->status == 0) {
?>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?= $item->id ?>)">删除</a>]
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php $this->endBlock(); ?>

@ -110,6 +110,7 @@ use \common\libs\MyLib;
您的浏览器不支持在线播放,请<a href="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3">下载</a>
</audio>
</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>

Loading…
Cancel
Save