You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 regels
2.1 KiB

  1. <?php
  2. use yii\helpers\Html;
  3. use common\components\zGridView;
  4. use yii\widgets\Pjax;
  5. use backend\common\Utils;
  6. use backend\modules\motorcade\models\searchSchedule;
  7. use yii\helpers\Url;
  8. /* @var $this yii\web\View */
  9. /* @var $searchModel backend\modules\motorcade\models\searchSchedule */
  10. /* @var $dataProvider yii\data\ActiveDataProvider */
  11. $this->title = '车辆排班';
  12. $this->params['breadcrumbs'][] = $this->title;
  13. $time = strtotime($searchModel->BUSY_DATE);
  14. $times = Utils::getWeekTime($time);
  15. //对星期的td的列格式处理
  16. $i = 0;
  17. $columns = [];
  18. while ($i < 14) {
  19. $date = date('Y-m-d', $times[$i]);
  20. $columns[] = [
  21. 'attribute' => 'day' . $i,
  22. 'header' => Html::a(date('m-d', $times[$i]) . ' ' . Utils::getWeekLabel(date('w', $times[$i])),
  23. Url::to(['bus-detail', 'date'=> $date])),
  24. 'value' => function ($model) use ($i, $date) {
  25. /* @var searchSchedule $model */
  26. 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]). '\'']);
  27. },
  28. 'format' => 'raw',
  29. 'hAlign' => 'center'
  30. ];
  31. $i++;
  32. }
  33. ?>
  34. <div class="iframe_box bus-order-index label-min-width">
  35. <?php Pjax::begin(['id' => 'pjax-list', 'timeout' => false]); ?>
  36. <?php echo $this->render('_search', ['model' => $searchModel, 'action'=> 'bus']); ?>
  37. <div style="margin-top: 30px;">
  38. <?= zGridView::widget([
  39. 'id' => 'grid-view-list',
  40. 'dataProvider' => $dataProvider,
  41. 'emptyText' => '没有匹配的记录',
  42. 'pagerFixed' => true,
  43. 'columns' => array_merge([
  44. [
  45. 'headerOptions' => ['style' => 'width: 1%'],
  46. 'class' => 'yii\grid\CheckboxColumn'
  47. ],
  48. 'BUS_NO',
  49. 'SEAT_DESC',
  50. 'RES_NAME',
  51. 'MILE_AMOUNT:integer',
  52. ] , $columns)
  53. ]); ?>
  54. </div>
  55. <?php Pjax::end(); ?>
  56. </div>