|
- <?php
-
- use common\components\zGridView;
- use backend\modules\motorcade\models\BusOrder;
-
- //获取表头日期
- $datearr = BusOrder::getDateArr($data['start_date']);
- //对星期的td的列格式处理
- $i = 0;
- $columns = [];
- while ($i < 14) {
- $j = 13 - $i;
- $z = $i + 1;
- $columns[] = [
- 'header' => "<a onclick=driverToDetail('" . $datearr['udate'][$j] . "','')>{$datearr['date'][$j]} {$datearr['xingqi'][$j]}</a>",
- 'value' => function ($model) use ($datearr, $j, $i, $z) {
- $fin = BusOrder::getFinShow($model["date{$z}"]);
- if($fin=='空闲')
- $color = 'label-info';
- elseif($fin=='维保')
- $color ='label-default';
- else
- $color = 'label-success';
- $result = "<span><span type='button' style='width: 34px;cursor:pointer' class='label_style label $color' onclick=driverToDetail('" . $datearr['udate'][$j] . "','" . $model['driver_name'] . "')>{$fin}</span></span>";
-
- return $result;
- },
- 'format' => 'raw',
- 'hAlign' => 'center'
- ];
- $i++;
- }
-
- ?>
- <style>
- .combo-select {
- width: 141px;
- margin-bottom: 0px;
- }
-
- td {
- text-align: left;
- }
-
- th {
- text-align: left;
- }
-
- </style>
- <div class="iframe_box">
- <div class="dis_search">
- <div class="form-inline search_first">
- <span class="search_name_width">出车日期</span>
- <div style="display: inline-block">
- <div style="display: inline-block">
- <div class="input-group date form_date" style="margin-left: 10px;width: 130px;">
- <input class="form-control" size="16" type="text" id="run_date" name="run_date">
- <span class="input-group-addon"><span
- class="glyphicon glyphicon-calendar"></span></span>
- </div>
- </div>
- </div>
-
- <span class="search_name_width">司机:</span>
- <input type="text" class="form-control" name="driver_name" id="driver_name" placeholder="请输入司机姓名,多个姓名用逗号隔开" style="width: 250px"/>
-
- <button type="button" class="btn btn-primary" style="margin-left: 20px" id="submit"
- onclick="search_sc()">
- <span class="glyphicon glyphicon-search"></span>
- 查 询
- </button>
- </div>
- </div>
- <div class="tab-content" style="padding-top: 0;margin-top: 30px">
- <div class="tab-pane active " id="tab1">
- <?php \yii\widgets\Pjax::begin(['id' => 'list', 'timeout' => false]) ?>
- <?=
- zGridView::widget(['dataProvider' => $dataProvider,
- 'tableOptions' => ['class' => 'table table-striped table-hover'],
- 'emptyText' => '没有匹配的记录',
- 'showPageSummary' => false,
- 'showEmpty' => true,
- 'pagerFixed' => true,
- 'columns' => array_merge([
- [
- 'headerOptions' => ['style' => 'width: 1%'],
- 'class' => 'yii\grid\CheckboxColumn'
- ],
- [
- 'headerOptions' => ['style' => 'width: 7%'],
- 'label' => '司机',
- 'value' => function ($model) {
- return $model['driver_name'];
- }
- ],
- [
- 'label' => '司贴',
- 'value' => function ($model) {
- return $model['sitie'];
- }
- ],
-
- ], $columns),
- ]);
- $this->registerJs('z.init()');
- ?>
- <?php \yii\widgets\Pjax::end() ?>
- </div>
- </div>
- </div>
- <script>
- window.onload = function () {
- $("#run_date").val(getDateTime(0));
- }
- function search_sc() {
- loading();
- var run_date = $("#run_date").val();
- var driver_name = $("#driver_name").val();
- $.pjax.reload({
- container: '#list',
- data: {run_date: run_date, driver_name: driver_name},
- replace: false,
- timeout: false
- })
- }
- function driverToDetail(date, driver) {
- // zNewWin('', '/motorcade/schedule/driver-detail?run_date=' + date + '&driver_name=' + driver)
- javascript:window.location='/motorcade/schedule/driver-detail?run_date='+date+'&driver_name='+driver
- }
-
- </script>
|