|
- <?php
-
- use backend\modules\motorcade\models\searchDocument;
- use backend\modules\motorcade\models\RunBusExpenses;
- use yii\widgets\Pjax;
-
- /* @var $this yii\web\View */
- /* @var $searchModel backend\modules\motorcade\models\searchDocument */
- /* @var $dataProvider yii\data\ActiveDataProvider */
-
- $this->title = '车辆预警';
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <style>
- .c_red {
- color: #e02222;
- }
- .date{
- width: 275px!important;
- }
- .search_name_this {
- display: inline-block !important;
- /*padding-left: 40px!important;*/
- padding-left: 0px !important;
- width: 91px !important;
- text-align: right !important;
- color:#80889a;
- }
-
- .search_name {
- display: inline-block !important;
- /*padding-left: 40px!important;*/
- padding-left: 15px !important;
- width: 115px !important;
- text-align: right !important;;
- }
-
- #bussearch-bus_belong > label {
- margin-left: 5px;
- margin-right: 10px
- }
-
- .form-inline {
- margin-bottom: 25px;
- margin-left: 0px;
- }
- .form-horizontal .form-group{
- margin-right: 0!important;
- margin-left: 0!important;
- }
- .span_left{
- width: 90px;text-align:right;display:inline-block;color:#80889a;
- }
- li>a{
- color:#80889a;
- }
- li>.active>a{
- color:#3e4355;
- }
- .old-nav{
- color: #80889a;
- cursor: pointer;
-
- }
- .old-nav:hover,.old-nav:focus,.old-nav:active{
- text-decoration: none;
- }
- .new-nav{
- color: #3e4355;
- text-decoration: none;
- }
- .new-nav:hover,.new-nav:focus,.new-nav:active{
- text-decoration: none;
- }
- label{
- color:#80889a;
- }
- .help-block{
- display: none!important;
- margin-bottom:6px!important;
- }
- .pagination{
- float: right;
- }
- .nav_title>li {
- width: auto !important;
- }
- </style>
- <?php $this->registerJs('z.init()'); ?>
- <div class="iframe_box">
- <?php
- $dataProviders = [];
- $dataProviders[1] = unserialize(serialize($dataProvider));
- $dataProviders[2] = unserialize(serialize($dataProvider));
- $dataProviders[3] = unserialize(serialize($dataProvider));
- $dataProviders[3]->query->addSelect([searchDocument::tableName() . '.*', 'sum(if(EXPIRE_DATE>="' . date('Y-m-d') . '",1,0)) as countInsurance']);
- $dataProviders[4] = unserialize(serialize($dataProvider));
- $dataProviders[4]->query->addSelect([searchDocument::tableName() . '.*', 'sum(if(EXPIRE_DATE>="' . date('Y-m-d') . '",1,0)) as countInsurance']);
- $dataProviders[5] = unserialize(serialize($dataProvider));
- $dataProviders[5]->query->addSelect([searchDocument::tableName() . '.*', 'sum(if(EXPIRE_DATE>="' . date('Y-m-d') . '",1,0)) as countInsurance']);
-
- $dataProviders[6] = unserialize(serialize($dataProvider));
- foreach ($dataProviders as $tab => &$item) {
- $item->query->andFilterWhere(['DOC_OPTION' => searchDocument::getDocOption($tab, 'bus')]);
- }
- //保养的预警和其他的不一样,不以时间为限,以里程数限制
- //::todo 有接口的,可以通过GPS直接取到当前里程数值,
- //没有取到的,通过报账数据run_bus_expense获取当前里程数
- // dict_type 462 没电费
- $query = $dataProviders[6]->query;
- $query->addSelect([searchDocument::tableName() . '.*', 'end_value']);
- $query->leftJoin(
- RunBusExpenses::tableName(),
- searchDocument::tableName() . ".DOC_ID = " . RunBusExpenses::tableName() . ".bus_res_id and " .
- RunBusExpenses::tableName() . ".end_value = (select max(end_value) from " . RunBusExpenses::tableName() . " where expense_subject_id = 462 and bus_res_id = DOC_ID)")
- ->andWhere('LAST_MAINTAIN < if(end_value is null,0,end_value) + ' . searchDocument::WARNING_MILE);
- $query->having = '';
- ?>
- <ul class="nav nav-tabs nav_title" role="tablist">
- <li href="#tab1" role="presentation" class="active" data-toggle="tab">
- <a style="cursor: pointer;width:126px;text-align: center">车辆行驶证
- <span class="label label-danger" <?= $dataProviders[1]->totalCount>0?$dataProviders[1]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[1]->totalCount ?></span>
- </a>
- </li>
- <li href="#tab2"
- role="presentation" class="" data-toggle="tab">
- <a style="cursor: pointer;width:126px;text-align: center">道路运输证
- <span class="label label-danger" <?= $dataProviders[2]->totalCount>0?$dataProviders[2]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[2]->totalCount ?></span>
- </a>
- </li>
- <li href="#tab3" role="presentation" data-toggle="tab" class="">
- <a style="cursor: pointer;width:126px;text-align: center">交强险
- <span class="label label-danger" <?= $dataProviders[3]->totalCount>0?$dataProviders[3]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[3]->totalCount ?></span>
- </a>
- </li>
- <li href="#tab4" role="presentation" data-toggle="tab" class="">
- <a style="cursor: pointer;width:126px;text-align: center">商业险
- <span class="label label-danger" <?= $dataProviders[4]->totalCount>0?$dataProviders[4]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[4]->totalCount?></span>
- </a>
- </li>
- <li href="#tab5" role="presentation" data-toggle="tab" class="">
- <a style="cursor: pointer;width:126px;text-align: center">座位险
- <span class="label label-danger" <?= $dataProviders[5]->totalCount>0?$dataProviders[5]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[5]->totalCount ?></span>
- </a>
- </li>
- <li href="#tab6" role="presentation" data-toggle="tab" class="">
- <a style="cursor: pointer;width:126px;text-align: center">保养
- <span class="label label-danger" <?= $dataProviders[6]->totalCount>0?$dataProviders[6]->totalCount : 'style="visibility:hidden"' ?>><?= $dataProviders[6]->totalCount ?></span>
- </a>
- </li>
- </ul>
- <div class="tab-content table_box">
- <div class="tab-pane active" role="tabpanel" id="tab1">
- <?php echo$this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[1], 'tab' => 1]) ?>
- </div>
- <div class="tab-pane" role="tabpanel" id="tab2">
- <?php echo $this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[2], 'tab' => 2]) ?>
- </div>
- <div class="tab-pane" role="tabpanel" id="tab3">
- <?php echo $this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[3], 'tab' => 3]) ?>
- </div>
- <div class="tab-pane" role="tabpanel" id="tab4">
- <?php echo $this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[4], 'tab' => 4]) ?>
- </div>
- <div class="tab-pane" role="tabpanel" id="tab5">
- <?php echo $this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[5], 'tab' => 5]) ?>
- </div>
- <div class="tab-pane" role="tabpanel" id="tab6">
- <?php echo $this->render('_bus-tab', ['searchModel' => $searchModel, 'dataProvider' => $dataProviders[6], 'tab' => 6]) ?>
- </div>
- </div>
- </div>
-
- <?php echo $this->render('_images_bus') ?>
-
- <?php echo $this->render('_images_insurance') ?>
-
- <?php echo $this->render('_images_maintain') ?>
|