2025-04-10 23:19:13 +08:00

419 lines
26 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @Author: fm453
* @Date: 2018-11-23 12:17:02
* @Last Modified by: fm453
* @Last Modified time: 2020-09-14 11:54:24
* @Email: fm453@lukegzs.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')?>
<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">
<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>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control" name="store_title" id="store-title" value="<?=isset($search['store_title'])?$search['store_title']:'';?>" placeholder="点击选择接单网点" autocomplete="off" href="<?=Url::toRoute(['store/select','callback'=>'store']);?>" w="80%;" h="90%;" title="选择接单网点" mini="load">
<input type="hidden" class="form-control" name="search[store_id]" id="store-value" value="<?=isset($search['store_id'])?$search['store_id']:0;?>">
<span class="input-group-btn">
<button type="button" class="btn btn-info" onclick="clearStore('store')">清除选择</button>
</span>
</div>
<script>
function selectStore(title,id,callback)
{
layer.closeAll();
layer.msg('已选择');
$('#'+callback+'-value').val(id);
$('#'+callback+'-title').val(title);
}
function clearStore(id)
{
$('#'+id+'-value').val('');
$('#'+id+'-title').val('');
}
</script>
</div>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control" name="employee_title" id="employee-title" value="<?=isset($search['employee_title'])?$search['employee_title']:'';?>" placeholder="点击选择该运单的派单员工" autocomplete="off" href="<?=Url::toRoute(['employee/select','callback'=>'employee']);?>" w="80%;" h="90%;" title="选择派单员工" mini="load">
<input type="hidden" class="form-control" name="search[employee]" id="employee-value" value="<?=isset($search['employee'])?$search['employee']:0;?>">
<span class="input-group-btn">
<button type="button" class="btn btn-info" onclick="clearEmployee('employee')">清除选择</button>
</span>
</div>
<script>
function selectEmployee(title,id,callback)
{
layer.closeAll();
layer.msg('已选择');
$('#'+callback+'-value').val(id);
$('#'+callback+'-title').val(title);
}
function clearEmployee(id)
{
$('#'+id+'-value').val('');
$('#'+id+'-title').val('');
}
</script>
</div>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control" name="car_title" id="car-title" value="<?=isset($search['car_title'])?$search['car_title']:'';?>" placeholder="点击选择关联客户车辆" autocomplete="off" href="<?=Url::toRoute(['car/select','callback'=>'car']);?>" w="80%;" h="90%;" title="选择关联客户车辆" mini="load">
<input type="hidden" class="form-control" name="search[car_id]" id="car-value" value="<?=isset($search['car_id'])?$search['car_id']:0;?>">
<span class="input-group-btn">
<button type="button" class="btn btn-info" onclick="clearCar('car')">清除选择</button>
</span>
</div>
</div>
<script>
function selectCar(title,id,number,username,callback)
{
layer.closeAll();
layer.msg('已选择');
$('#'+callback+'-value').val(id);
$('#'+callback+'-title').val(title+number);
}
function clearCar(id)
{
$('#'+id+'-value').val('');
$('#'+id+'-title').val('');
}
</script>
</div>
<div class="form-group">
<div class="col-sm-3">
<div class="input-group">
<input class="form-control" type="text" placeholder="模糊检索介绍人名字" name="search[bind]" id="search-bind-name" value="<?=isset($search['bind'])?$search['bind']:'';?>">
<span class="input-group-btn">
<button type="button" class="btn btn-success" href="<?=Url::toRoute(['contact/select','callback'=>'search-bind']);?>" w="80%;" h="90%;" title="从通讯录中选择" mini="load">通讯录</button>
<button type="button" class="btn btn-info" onclick="clearBind('search-bind-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[signer]" id="signer-name" value="<?=isset($search['signer'])?$search['signer']:'';?>">
<span class="input-group-btn">
<button type="button" class="btn btn-success" href="<?=Url::toRoute(['contact/select','callback'=>'signer']);?>" w="80%;" h="90%;" title="从通讯录中选择" mini="load">通讯录</button>
<button type="button" class="btn btn-info" onclick="clearSigner('signer-name')">清除</button>
</span>
</div>
</div>
<script>
function clearSigner(id)
{
$('#'+id).val('');
}
</script>
<div class="col-sm-3">
<div class="input-group">
<input class="form-control" type="text" placeholder="模糊检索发车人名字" name="search[sender_name]" id="sender-name" value="<?=isset($search['sender_name'])?$search['sender_name']:'';?>">
<span class="input-group-btn">
<button type="button" class="btn btn-success" href="<?=Url::toRoute(['contact/select','callback'=>'sender']);?>" w="80%;" h="90%;" title="从通讯录中选择" mini="load">通讯录</button>
<button type="button" class="btn btn-info" onclick="clearSender('sender-name')">清除</button>
</span>
</div>
</div>
<script>
function clearSender(id)
{
$('#'+id).val('');
}
</script>
<div class="col-sm-3">
<div class="input-group">
<input class="form-control" type="text" placeholder="模糊检索接车人名字" name="search[receiver_name]" id="receiver-name" value="<?=isset($search['receiver_name'])?$search['receiver_name']:'';?>">
<span class="input-group-btn">
<button type="button" class="btn btn-success" href="<?=Url::toRoute(['contact/select','callback'=>'receiver']);?>" w="80%;" h="90%;" title="从通讯录中选择" mini="load">通讯录</button>
<button type="button" class="btn btn-info" onclick="clearReceiver('receiver-name')">清除</button>
</span>
</div>
</div>
<script>
function clearReceiver(id)
{
$('#'+id).val('');
}
</script>
</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-12">
<button type="submit" class="btn btn-sm btn-warning dim"> 搜索</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) ?></div>
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>序号</th>
<th>车辆</th>
<th style="width:120px;">联系人</th>
<th style="width:180px;">托运信息</th>
<th style="width:150px;">网点员工</th>
<th style="width:260px;">关联信息</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($orders as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td>
<kbd><?=isset($cars[$vo['car_id']]['title']) ? $cars[$vo['car_id']]['title']:''?></kbd><br>
<?=isset($cars[$vo['car_id']]['number2']) ? $cars[$vo['car_id']]['number2']:''?>
</td>
<td>
【发车人】<?=isset($vo['sender_name']) ? $vo['sender_name']:''?><br>
<!-- 【手机】<?=isset($vo['sender_mobiles']) ? $vo['sender_mobiles']:''?><br> -->
<!-- 【身份证号】<?=isset($vo['sender_idcard']) ? $vo['sender_idcard']:''?><br> -->
【接车人】<?=isset($vo['receiver_name']) ? $vo['receiver_name']:''?><br>
<!-- 【手机】<?=isset($vo['receiver_mobiles']) ? $vo['receiver_mobiles']:''?><br> -->
<!-- 【身份证号】<?=isset($vo['receiver_idcard']) ? $vo['receiver_idcard']:''?><br> -->
【委托方】<?=isset($vo['signer']) ? $vo['signer'] : ''?>
</td>
<td>
【签约时间】<?=isset($vo['sign_date']) && $vo['sign_date']>0 ? date('Y-m-d',$vo['sign_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>
【<?=isset($stores[$vo['store_id']]['title'])?$stores[$vo['store_id']]['title']:'未设置'?>】
<code><?=isset($employees[$vo['employee_id']]['name'])?$employees[$vo['employee_id']]['name']:'未关联'?></code><br>
【介绍人】<CODE><?=isset($vo['bind']) ? $vo['bind']:''?></CODE>
</td>
<td>
【保险】保价<code><?=isset($vo['car_value']) ? $vo['car_value'] : 0?></code><kbd>万元</kbd> 保费<code><?=isset($vo['fee_insurance']) ? $vo['fee_insurance'] : 0?></code><kbd>元</kbd> <br>
【费用】运费<code><?=isset($vo['fee_truck']) ? $vo['fee_truck'] : 0?></code><kbd>元</kbd>
总费用<code><?=isset($vo['fee_total']) ? $vo['fee_total'] : 0?></code><kbd>元</kbd> <br>
【收款】现付<code><?=isset($vo['pay_send']) ? $vo['pay_send'] : 0?></code><kbd>元</kbd>;到收<code><?=isset($vo['pay_receive']) ? $vo['pay_receive'] : 0?></code><kbd>元</kbd>
</td>
<td>
<?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 }?>
<?php if($vo['is_cwqr']==0){?>
<label class="btn btn-default btn-xs">待财务确认</label>
<?php }else{?>
<label class="btn btn-info btn-xs">财务已确认</label>
<?php }?>
</td>
<td>
<a class="btn btn-primary btn-xs" onclick="parent.selectOrder('<?=$vo['car_id']?>','<?=$vo['id']?>','<?=isset($cars[$vo['car_id']]['title']) ? $cars[$vo['car_id']]['title']:''?>','<?=isset($cars[$vo['car_id']]['num_p']) ? $cars[$vo['car_id']]['num_p']:''?><?=isset($cars[$vo['car_id']]['num_area']) ? $cars[$vo['car_id']]['num_area']:''?><?=isset($cars[$vo['car_id']]['num_left']) ? $cars[$vo['car_id']]['num_left']:''?>','<?=isset($cars[$vo['car_id']]['num_frame']) ? $cars[$vo['car_id']]['num_frame']:''?>','<?=isset($vo['start_city']) ? $vo['start_city'] : ''?>','<?=isset($vo['aim_city']) ? $vo['aim_city'] : ''?>','<?=isset($employees[$vo['employee_id']]['name'])?$employees[$vo['employee_id']]['name']:'未关联'?>','<?=$callback?>');">选择</a>
</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>