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.

3 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. use yii\helpers\Html;
  3. use common\components\zGridView;
  4. /* @var $this yii\web\View */
  5. /* @var $model backend\modules\motorcade\models\searchDocument */
  6. /* @var $form yii\widgets\ActiveForm */
  7. /* @var $tab string */
  8. \yii\widgets\Pjax::begin(['id' => 'pjax-tab' . $tab, 'timeout' => false]);
  9. echo $this->render('_search', ['model' => $searchModel, 'tab' => $tab, 'type' => 'bus']);
  10. $visible_1 = false;
  11. $visible_2 = false;
  12. $visible_3 = false;
  13. if (in_array($tab, [1, 2,])) {
  14. $visible_1 = true;
  15. }
  16. if (in_array($tab, [3, 4, 5])) {
  17. $visible_2 = true;
  18. }
  19. if ($tab == 6) {
  20. $visible_3 = true;
  21. }
  22. ?>
  23. <div class="tab-pane" role="tabpanel">
  24. <?php
  25. echo zGridView::widget([
  26. 'id' => 'grid-view-tab1',
  27. 'tableOptions'=>['class'=>'table table-striped table-hover'],
  28. 'dataProvider' => $dataProvider,
  29. 'resizableColumns'=>false,
  30. 'pagerFixed' => true,
  31. 'rowOptions' => function ($model, $key, $index, $column) {
  32. return ['class' => ($model->EXPIRE_DATE < date('Y-m-d', strtotime('+30 days')) ? 'bg-light-sky-blue bg-font-light-pink' : '')];
  33. },
  34. 'columns' => [
  35. [
  36. 'width' => '55px',
  37. 'class' => 'kartik\grid\CheckboxColumn',
  38. 'rowSelectedClass' => '',
  39. ],
  40. [
  41. 'width'=>'220px',
  42. 'label' => '车牌号',
  43. 'attribute' => 'bus.BUS_NO',
  44. ],
  45. // 'bus.BUS_NO',
  46. [
  47. 'width'=>'200px',
  48. 'label' => '品牌',
  49. 'attribute' => 'bus.brand.RES_NAME',
  50. ],
  51. [
  52. 'width'=>'240px',
  53. 'label'=>'座位',
  54. 'attribute'=>'bus.SEAT_DESC',
  55. ],
  56. // 'bus.SEAT_DESC',
  57. [
  58. 'width'=>'100px',
  59. 'label' => '有效保险数',
  60. 'attribute' => 'countInsurance',
  61. 'visible' => $visible_2
  62. ],
  63. [
  64. 'width'=>'275px',
  65. 'label' => '下次保养里程数',
  66. 'attribute' => 'LAST_MAINTAIN',
  67. 'format' => ['decimal', 2],
  68. 'visible' => $visible_3
  69. ],
  70. [
  71. 'width'=>'210px',
  72. 'label' => '当前里程数',
  73. 'attribute' => 'end_value',
  74. 'format' => ['decimal', 2],
  75. 'visible' => $visible_3
  76. ],
  77. [
  78. 'width'=>'130px',
  79. 'attribute' => 'EXPIRE_DATE',
  80. 'visible' => $visible_1
  81. ],
  82. [
  83. 'width'=>'200',
  84. 'label' => '保险期结束',
  85. 'attribute' => 'EXPIRE_DATE',
  86. 'visible' => $visible_2
  87. ],
  88. [
  89. 'hAlign'=>'center',
  90. // 'width'=>'125px',
  91. 'header' => '操作',
  92. 'value' => function ($model) {
  93. if (in_array($model->DOC_OPTION, [511, 512, 513, 514])) {
  94. $href = 'upload-tab2';
  95. $contain = 'image2';
  96. } else if ($model->DOC_OPTION == 515) {
  97. $href = 'upload-tab3';
  98. $contain = 'image3';
  99. } else {
  100. $href = 'upload-tab1';
  101. $contain = 'image1';
  102. }
  103. return '<a class="btn btn-link" href="#' . $href . '" data-toggle="modal"
  104. onclick="javascirpt:$.pjax.reload({container: \'#' . $contain . '\', data:{doc_id:' . $model->DOC_ID . ',doc_option:' . $model->DOC_OPTION . '},url: \'/motorcade/warning/images\', timeout: false, replace: false})">更新</a>';
  105. },
  106. 'format' => 'raw',
  107. ],
  108. ],
  109. ]);
  110. ?>
  111. </div>
  112. <?php
  113. \yii\widgets\Pjax::end();