Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

145 рядки
6.0 KiB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\helpers\ArrayHelper;
  4. use backend\modules\motorcade\models\BusDepartment;
  5. use common\components\zGridView;
  6. use backend\modules\motorcade\models\BusOrder;
  7. use backend\modules\motorcade\models\BaseBus;
  8. ?>
  9. <style>
  10. .combo-select {
  11. width: 141px;
  12. margin-bottom: 0px;
  13. }
  14. </style>
  15. <div class="iframe_box">
  16. <div class="dis_search">
  17. <div class="form-inline search_first">
  18. <span class="search_name_width">出车日期</span>
  19. <div style="display: inline-block">
  20. <div style="display: inline-block">
  21. <div class="input-group date form_date" style="margin-left: 10px;width: 130px;">
  22. <input class="form-control" size="16" type="text" id="run_date" name="run_date"
  23. value="<?= $data['run_date'] ?>">
  24. <span class="input-group-addon"><span
  25. class="glyphicon glyphicon-calendar"></span></span>
  26. </div>
  27. </div>
  28. </div>
  29. <span class="search_name_width">司机:</span>
  30. <input type="text" class="form-control" name="driver_name" value="<?= $data['driver_name'] ?>"
  31. id="driver_name" placeholder="请输入司机姓名"/>
  32. <button type="button" class="btn btn-primary" style="margin-left: 20px" id="submit"
  33. onclick="search_sc()">
  34. <span class="glyphicon glyphicon-search"></span>
  35. 查&nbsp;询
  36. </button>
  37. </div>
  38. </div>
  39. <div class="tab-content" style="padding-top: 0;margin-top: 30px">
  40. <div class="tab-pane active " id="tab1">
  41. <?php \yii\widgets\Pjax::begin(['id' => 'list', 'timeout' => false]) ?>
  42. <?=
  43. zGridView::widget([
  44. 'dataProvider' => $dataProvider,
  45. 'tableOptions' => ['class' => 'table table-striped table-hover'],
  46. 'emptyText' => '没有匹配的记录',
  47. 'showPageSummary' => false,
  48. 'showEmpty' => true,
  49. 'pagerFixed' => true,
  50. 'columns' => [
  51. ['label' => '司机姓名', 'attribute' => 'driver_name'],
  52. [
  53. 'label' => '出车单号',
  54. 'value' => function ($model) {
  55. if ($model['bus_number_name'] == '' && $model['depart_name'] != 'wb')
  56. return '<span class="label label-info">空闲</span>';
  57. else if ($model['depart_name'] == 'wb')
  58. return "<span class='label label-default'>维保</span>";
  59. else
  60. return "<a onclick='driverToDetail({$model['id']})'>{$model['bus_number_name']}</a>";
  61. },
  62. 'format' => 'raw'
  63. ],
  64. [
  65. 'label' => '客户名称',
  66. 'value' => function ($model) {
  67. if ($model['depart_name'] == 'wb')
  68. return '';
  69. else
  70. return $model['depart_name'];
  71. }],
  72. [
  73. 'label' => '开始日期',
  74. 'value' => function ($model) {
  75. if ($model['run_date_name'] == '') {
  76. return '-';
  77. } else
  78. return $model['run_date_name'] . ' ' . $model['start_time'];
  79. }
  80. ],
  81. [
  82. 'label' => '结束日期',
  83. 'value' => function ($model) {
  84. $day = $model['day_num'];
  85. $_ = strtotime($model['run_date_name'] . "+$day day");
  86. $tp = date('Y-m-d', $_);
  87. $time = $model['end_time'];
  88. if ($model['bus_number_name'] == '维保' || $model['bus_number_name'] == '')
  89. return '-';
  90. else
  91. return $tp . ' ' . $time;
  92. }
  93. ],
  94. ['label' => '线路名称', 'attribute' => 'itinerary_name'],
  95. [
  96. 'label' => '类型',
  97. 'value' => function ($model) {
  98. if ($model['line_type'] == 1)
  99. return '省际';
  100. elseif ($model['line_type'] == 2)
  101. return '市内';
  102. else
  103. return '-';
  104. }],
  105. [
  106. 'label' => '乘客数',
  107. 'value' => function ($model) {
  108. if ($model['bus_number_name'] == '维保')
  109. return '';
  110. else
  111. return $model['saled_count'];
  112. }
  113. ],
  114. ['label' => '车牌号', 'attribute' => 'bus_no'],
  115. ['label' => '状态', 'attribute' => 'run_status_name']
  116. ],
  117. ]);
  118. $this->registerJs('z.init()');
  119. ?>
  120. <?php \yii\widgets\Pjax::end() ?>
  121. </div>
  122. </div>
  123. </div>
  124. <script>
  125. function search_sc() {
  126. loading();
  127. var run_date = $("#run_date").val();
  128. var driver_name = $("#driver_name").val();
  129. $.pjax.reload({
  130. container: '#list',
  131. data: {run_date: run_date, driver_name: driver_name},
  132. replace: false,
  133. timeout: false
  134. })
  135. }
  136. function driverToDetail(bus_number) {
  137. zNewWin('motorcade', '/motorcade/bus/detail?id=' + bus_number)
  138. }
  139. </script>