321 lines
19 KiB
PHP
Executable File
321 lines
19 KiB
PHP
Executable File
<?php
|
||
|
||
/**
|
||
* @Author: fm453
|
||
* @Date: 2018-11-23 12:17:02
|
||
* @Email: 1280880631@qq.com
|
||
*/
|
||
|
||
use yii\helpers\Html;
|
||
use yii\bootstrap\ActiveForm;
|
||
use yii\helpers\Url;
|
||
use yii\widgets\LinkPager;
|
||
|
||
$this->title = '预约列表';
|
||
$this->params['breadcrumbs'][] = $this->title;
|
||
?>
|
||
<!--日期时间选择器-->
|
||
<?=Html::jsFile('@web/js/plugins/layer/laydate/laydate.js')?>
|
||
<?=Html::cssFile('@web/js/plugins/layer/laydate/need/laydate.css')?>
|
||
<?=Html::cssFile('@web/js/plugins/layer/laydate/skins/molv/laydate.css')?>
|
||
|
||
<!--选项框-->
|
||
<?=Html::jsFile('@web/js/plugins/iCheck/icheck.min.js')?>
|
||
<script>
|
||
$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
|
||
</script>
|
||
|
||
<style>
|
||
.laydate_body .laydate_top{
|
||
padding:0;
|
||
}
|
||
.laydate_body .laydate_ym{
|
||
/*margin:0;
|
||
padding:5px;*/
|
||
}
|
||
.laydate_body .laydate_table{
|
||
border:0;
|
||
border-bottom: 1px solid rgb(204, 204, 204);
|
||
}
|
||
.laydate_body .laydate_bottom {
|
||
border: 0;
|
||
margin-bottom: 10px;
|
||
}
|
||
</style>
|
||
|
||
<!--滑块选择器-->
|
||
<?=Html::cssFile('@web/css/plugins/ionRangeSlider/ion.rangeSlider.css')?>
|
||
<?=Html::cssFile('@web/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css')?>
|
||
<?=Html::jsFile('@web/js/plugins/ionRangeSlider/ion.rangeSlider.min.js')?>
|
||
|
||
<!--下拉选择、选项框-->
|
||
<?=Html::cssFile('@web/css/plugins/chosen/chosen.css')?>
|
||
<?=Html::jsFile('@web/js/plugins/chosen/chosen.jquery.js')?>
|
||
|
||
<div class="wrapper wrapper-content">
|
||
<div class="row">
|
||
<div class="col-sm-12">
|
||
<div class="ibox float-e-margins">
|
||
<div class="ibox-content" style="text-align: center;">
|
||
<h1>搜索与筛选</h1>
|
||
<form role="form" class="form-horizontal m-t" action="<?=Url::current(['pid' => Yii::$app->session->get('pid')], false);?>" method="post">
|
||
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
||
|
||
<div class="form-group">
|
||
<div class="col-sm-4">
|
||
<div class="input-group">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-sm btn-primary">计划月份</button>
|
||
</span>
|
||
<input class="input-sm form-control layer-date" type="text" name="search[sign_m]" placeholder="请选择月份" autocomplete="off" onclick="laydate({istime: false, format: 'YYYY-MM'})" value="<?=isset($search['sign_m'])?$search['sign_m']:''?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-4">
|
||
<div class="input-group">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-sm btn-primary">计划时间不早于</button>
|
||
</span>
|
||
<input class="input-sm form-control layer-date" type="text" name="search[sign_after]" placeholder="请选择日期" autocomplete="off" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})" value="<?=isset($search['sign_after'])?$search['sign_after']:''?>">
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-4">
|
||
<div class="input-group">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-sm btn-primary">计划时间不晚于</button>
|
||
</span>
|
||
<input class="input-sm form-control layer-date" type="text" name="search[sign_before]" placeholder="请选择日期" autocomplete="off" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})" value="<?=isset($search['sign_before'])?$search['sign_before']:''?>">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="col-sm-3">
|
||
<div class="input-group">
|
||
<input class="form-control" type="text" placeholder="检索联系人姓名" name="search[from_name]" id="search-from_name-name" value="<?=isset($search['from_name'])?$search['from_name']:'';?>">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-success" href="<?=Url::toRoute(['contact/select','callback'=>'search-from_name']);?>" w="80%;" h="90%;" title="从通讯录中选择" mini="load">通讯录</button>
|
||
<button type="button" class="btn btn-info" onclick="clearBind('search-from_name-name')">清除</button>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
function selectContactor(company,name,mobile,idcard,id,callback)
|
||
{
|
||
layer.closeAll();
|
||
layer.msg('已选择');
|
||
$('#'+callback+'-company').val(company);
|
||
$('#'+callback+'-mobile').val(mobile);
|
||
$('#'+callback+'-name').val(name);
|
||
$('#'+callback+'-idcard').val(idcard);
|
||
$('#'+callback+'-value').val(id);
|
||
}
|
||
function clearBind(id)
|
||
{
|
||
$('#'+id).val('');
|
||
}
|
||
</script>
|
||
|
||
<div class="col-sm-3">
|
||
<div class="input-group">
|
||
<input class="form-control" type="text" placeholder="检索联系手机" name="search[from_mobile]" id="from_mobile" value="<?=isset($search['from_mobile'])?$search['from_mobile']:'';?>">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-info" onclick="clearInput(this)">清除</button>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group">
|
||
<div class="col-sm-3">
|
||
<select data-placeholder="选择起运省份..." class="form-control chosen-select" tabindex="2" name="search[start_province]">
|
||
<option value="">选择起运省份</option>
|
||
<?php foreach(Yii::$app->params['regionAreas'] as $key=>$val){?>
|
||
<option value="<?=$key?>" hassubinfo="true" <?=isset($search['start_province']) && $search['start_province']==$key ? 'selected':'';?>><?=$val?></option>
|
||
<?php }?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="col-sm-3">
|
||
<div class="input-group">
|
||
<input class="form-control" type="text" placeholder="检索起运城市名称" name="search[start_city]" id="start_city" value="<?=isset($search['start_city'])?$search['start_city']:'';?>">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-info" onclick="clearInput(this)">清除</button>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-3">
|
||
<select data-placeholder="选择运达省份..." class="select-sm form-control chosen-select" tabindex="2" name="search[aim_province]">
|
||
<option value="">选择运达省份</option>
|
||
<?php foreach(Yii::$app->params['regionAreas'] as $key=>$val){?>
|
||
<option value="<?=$key?>" hassubinfo="true" <?=isset($search['aim_province']) && $search['aim_province']==$key ? 'selected':'';?>><?=$val?></option>
|
||
<?php }?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="col-sm-3">
|
||
<div class="input-group">
|
||
<input class="form-control" type="text" placeholder="检索目标城市名称" name="search[aim_city]" id="aim_city" value="<?=isset($search['aim_city'])?$search['aim_city']:'';?>">
|
||
<span class="input-group-btn">
|
||
<button type="button" class="btn btn-info" onclick="clearInput(this)">清除</button>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<script>
|
||
function clearInput(obj)
|
||
{
|
||
$(obj).parent().prev().val('');
|
||
}
|
||
</script>
|
||
<div class="form-group">
|
||
<div class="col-sm-3">
|
||
<select data-placeholder="选择订单状态..." class="select-sm form-control chosen-select" tabindex="2" name="search[status_code]">
|
||
<option value="all">选择订单状态</option>
|
||
<?php foreach($status as $key=>$val){?>
|
||
<option value="<?=$key?>" hassubinfo="true" <?=isset($search['status_code']) && $search['status_code']==$key ? 'selected':'';?>><?=$val?></option>
|
||
<?php }?>
|
||
</select>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label i-checks"><input <?=isset($search['orderby'])&&$search['orderby']=='sign_date' ? 'checked' : ''?> type="checkbox" name="search[orderby]" value="sign_date" > 按签约日期排序
|
||
</label>
|
||
<label class="col-sm-2 control-label i-checks"><input <?=isset($search['onlyme'])&&$search['onlyme']==1 ? 'checked' : ''?> type="checkbox" name="search[onlyme]" value="1" > 仅查看我录入的记录
|
||
</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="col-sm-12">
|
||
<button type="submit" value="submit" class="btn btn-sm btn-warning"> 搜索</button>
|
||
<button type="reset" value="reset" class="btn btn-sm btn-success" href="<?=Url::current(['reset' => 1]);?>" title="重置全部搜索条件"> 重置 </button>
|
||
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('orderpre/new')?>" target="_blank">新增预约</a>
|
||
<button type="button" value="export" class="btn btn-sm btn-success" href="<?=Url::current(['export' => 'all']);?>" w="50%;" h="50%;" title="导出当前全部数据" mini="load"> 导出</button>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
<!--分页-->
|
||
<div class="ibox-content" style="padding:0;text-align: center;">
|
||
<div class="f-r">
|
||
<?= LinkPager::widget([
|
||
'pagination'=>$pager,
|
||
'firstPageLabel' => '首页',
|
||
'nextPageLabel' => '下一页',
|
||
'prevPageLabel' => '上一页',
|
||
'lastPageLabel' => '末页',
|
||
]) ?>
|
||
</div>
|
||
</div>
|
||
<div class="ibox-title"><?= Html::encode($this->title) ?> <h5 class="pull-right"> 共计 <?=$totalCount?> 条记录</h5></div>
|
||
<div class="ibox-content">
|
||
<div class="table-responsive">
|
||
<table class="table table-striped">
|
||
<thead>
|
||
<tr>
|
||
<th>序号</th>
|
||
<th style="width:100px;">车辆</th>
|
||
<th style="width:150px;">联系人</th>
|
||
<th style="width:180px;">托运信息</th>
|
||
<th style="width:260px;">关联信息</th>
|
||
<th style="width:150px;">跟进人员</th>
|
||
<th style="width:100px;">状态</th>
|
||
<th style="width:180px;">操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
|
||
<?php foreach($orders as $vo):?>
|
||
<tr>
|
||
<td><?=$vo['id']?></td>
|
||
<td style="width:100px;overflow-x: hidden;">
|
||
<p><kbd><?=isset($vo['car_title']) ? $vo['car_title']:''?></kbd></p>
|
||
<p>
|
||
<?=isset($vo['car_no']) ? $vo['car_no']:''?>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
【联系人】<?=isset($vo['from_name']) ? $vo['from_name']:''?><br>
|
||
【手机】<?= $vo['from_mobile'] ?? '' ?><br>
|
||
</td>
|
||
<td>
|
||
【计划时间】<?=isset($vo['date']) && $vo['date']>0 ? date('Y-m-d',$vo['date']) : '未记录'?><br>
|
||
【始发地】<?=isset(Yii::$app->params['regionAreas'][$vo['start_province']]) ? Yii::$app->params['regionAreas'][$vo['start_province']] : ''?> <?=isset($vo['start_city']) ? $vo['start_city'] : ''?><br>
|
||
【目的地】<?=isset(Yii::$app->params['regionAreas'][$vo['aim_province']]) ? Yii::$app->params['regionAreas'][$vo['aim_province']] : ''?> <?=isset($vo['aim_city']) ? $vo['aim_city'] : ''?><br>
|
||
</td>
|
||
<td>
|
||
保价<code><?=isset($vo['car_value']) ? $vo['car_value'] : 0?></code><kbd>万元</kbd>; <br>
|
||
【备注】<?= $vo['car'] ?? '' ?>
|
||
</td>
|
||
<td>
|
||
【指派网点】<kbd><?=isset($stores[$vo['store_id']]['title'])?$stores[$vo['store_id']]['title']:'未设置'?></kbd>-
|
||
<code><?=isset($employees[$vo['employee_id']]['name'])?$employees[$vo['employee_id']]['name']:'未关联'?></code><br>
|
||
【接待员】<CODE><?=isset($vo['receptionist']) ? $vo['receptionist']:''?></CODE><br>
|
||
【介绍人】<CODE><?=isset($vo['bind']) ? $vo['bind']:''?></CODE><br>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<?php if($vo['status_code']<=0){?>
|
||
<label class="btn btn-default btn-xs"><?=$status[$vo['status_code']]?></label>
|
||
<?php }else{?>
|
||
<label class="btn btn-info btn-xs"><?=$status[$vo['status_code']]?></label>
|
||
<?php }?>
|
||
</p>
|
||
|
||
</td>
|
||
<td style="background-color:#0095f626;">
|
||
<p>
|
||
<a class="btn btn-primary btn-sm" href="<?=Url::toRoute(['edit','id'=>$vo['id']])?>" data-toggle="tooltip" data-placement="top" data-title="编辑修改订单" trigger="hover|focus"> <i class="fa fa-edit hidden"></i>改 </a>
|
||
<a title="点击将删除" href="<?=Url::toRoute(['delete','id'=>$vo['id']])?>" class="btn btn-danger btn-sm" mini="act" data-toggle="tooltip" data-placement="top" data-title="点击删除该订单" trigger="hover|focus"> <i class="fa fa-trash hidden"></i>删 </a>
|
||
<a title="点击将取消这张订单" href="<?=Url::toRoute(['ajax','id'=>$vo['id'],'do'=>'cancel'])?>" class="btn btn-warning btn-sm" mini="ajax" data-toggle="tooltip" data-placement="top" data-title="点击取消该订单" trigger="hover|focus"> <i class="fa fa-recycle bigger-120"></i> </a>
|
||
</p>
|
||
|
||
<p>
|
||
<a class="btn btn-success btn-sm" href="<?=Url::toRoute(['copy','id'=>$vo['id']])?>" w="100%;" h="90%;" title="复制订单" mini="load" data-toggle="tooltip" data-placement="top" data-title="复制为新订单并进行调整" trigger="hover|focus"><i class="fa fa-copy bigger-120"></i></a>
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<?php endforeach;?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<!--分页-->
|
||
<div class="ibox-content" style="padding:0;text-align: center;">
|
||
<div class="f-r">
|
||
<?= LinkPager::widget([
|
||
'pagination'=>$pager,
|
||
'firstPageLabel' => '首页',
|
||
'nextPageLabel' => '下一页',
|
||
'prevPageLabel' => '上一页',
|
||
'lastPageLabel' => '末页',
|
||
]) ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
laydate.skin('molv');
|
||
$(document).ready(function() {
|
||
var config = {
|
||
".chosen-select": {},
|
||
".chosen-select-deselect": {
|
||
allow_single_deselect: !0
|
||
},
|
||
".chosen-select-no-single": {
|
||
disable_search_threshold: 10
|
||
},
|
||
".chosen-select-no-results": {
|
||
no_results_text: "Oops, nothing found!"
|
||
},
|
||
".chosen-select-width": {
|
||
width: "95%"
|
||
}
|
||
};
|
||
for (var selector in config) $(selector).chosen(config[selector]);
|
||
});
|
||
</script>
|