|
- <?php
-
- use yii\helpers\Html;
- use common\components\zGridView;
- use yii\widgets\Pjax;
- use backend\common\Utils;
- use backend\modules\motorcade\models\searchSchedule;
- use yii\helpers\Url;
-
- /* @var $this yii\web\View */
- /* @var $searchModel backend\modules\motorcade\models\searchSchedule */
- /* @var $dataProvider yii\data\ActiveDataProvider */
-
- $this->title = '车辆排班';
- $this->params['breadcrumbs'][] = $this->title;
- $time = strtotime($searchModel->BUSY_DATE);
- $times = Utils::getWeekTime($time);
-
- //对星期的td的列格式处理
- $i = 0;
- $columns = [];
- while ($i < 14) {
- $date = date('Y-m-d', $times[$i]);
- $columns[] = [
- 'attribute' => 'day' . $i,
- 'header' => Html::a(date('m-d', $times[$i]) . ' ' . Utils::getWeekLabel(date('w', $times[$i])),
- Url::to(['bus-detail', 'date'=> $date])),
- 'value' => function ($model) use ($i, $date) {
- /* @var searchSchedule $model */
- return Html::tag('span', $model->getTd($i), ['style'=> 'cursor: pointer', 'onclick'=> 'javascript:window.location=\''. Url::to(['bus-detail', 'date'=> $date, 'bus_id'=> $model->BUS_ID]). '\'']);
- },
- 'format' => 'raw',
- 'hAlign' => 'center'
- ];
- $i++;
- }
- ?>
- <div class="iframe_box bus-order-index label-min-width">
-
- <?php Pjax::begin(['id' => 'pjax-list', 'timeout' => false]); ?>
- <?php echo $this->render('_search', ['model' => $searchModel, 'action'=> 'bus']); ?>
-
- <div style="margin-top: 30px;">
- <?= zGridView::widget([
- 'id' => 'grid-view-list',
- 'dataProvider' => $dataProvider,
- 'emptyText' => '没有匹配的记录',
- 'pagerFixed' => true,
- 'columns' => array_merge([
- [
- 'headerOptions' => ['style' => 'width: 1%'],
- 'class' => 'yii\grid\CheckboxColumn'
- ],
- 'BUS_NO',
- 'SEAT_DESC',
- 'RES_NAME',
- 'MILE_AMOUNT:integer',
- ] , $columns)
-
- ]); ?>
- </div>
- <?php Pjax::end(); ?>
- </div>
|