From: Vladimir Fomichev Date: Mon, 11 Aug 2025 08:47:29 +0000 (+0300) Subject: Выгрузка отчета в excel X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f8fb919ce084dcd01ec9cda5fef5a2af28c7680f;p=erp24_rep%2Fyii-erp24%2F.git Выгрузка отчета в excel --- diff --git a/erp24/views/marketplace/priority.php b/erp24/views/marketplace/priority.php index 6cd6d614..4ca5c0d2 100644 --- a/erp24/views/marketplace/priority.php +++ b/erp24/views/marketplace/priority.php @@ -14,11 +14,15 @@ th { } th span { /*border-radius: 50%; - border: 1px solid black;*/ - min-width: 30px; font-size: 0.6rem; + border: 1px solid black; + min-width: 30px; */ + + + font-size: 0.6rem; position: relative; } th>span.dt-column-order { + position: absolute; right: 0px !important; top: 0; @@ -26,11 +30,11 @@ th>span.dt-column-order { width: 12px; } th>span>span{ - /* min-width: 30px; */ + font-size: 0.6rem; position: absolute; top: -1px; - right: -22px; + right: -5px; } '); ?> diff --git a/erp24/views/marketplace/report.php b/erp24/views/marketplace/report.php index 6db472f3..8220f042 100644 --- a/erp24/views/marketplace/report.php +++ b/erp24/views/marketplace/report.php @@ -1,8 +1,9 @@ params['breadcrumbs'][] = $this->title; - 'yii\grid\SerialColumn'], + 'name', + 'articule', + 'id', + [ + 'attribute' => 'is_valid', + 'label' => 'Активен ли букет на МП?', + 'value' => function ($model) { + return $model['is_valid'] ? 'Да' : 'Нет'; + } + ], + [ + 'attribute' => 'reason', + 'label' => 'Причина не активности', + 'format' => 'raw', + 'value' => function ($model) { + return nl2br(htmlspecialchars($model['reason'] ?? '')); + }, + ], + ]; + $exportMenu = ExportMenu::widget([ + 'container' => ['class' => 'btn-group mr-2 mt-2 mb-2'], 'dataProvider' => $dataProvider, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - 'name', - 'articule', - 'id', - [ - 'attribute' => 'is_valid', - 'label' => 'Активен ли букет на МП?', - 'value' => function ($model) { - return $model['is_valid'] ? 'Да' : 'Нет'; - } - ], - [ - 'attribute' => 'reason', - 'label' => 'Причина не активности', - 'format' => 'raw', - 'value' => function ($model) { - return nl2br(htmlspecialchars($model['reason'] ?? '')); - }, + 'columns' => $columns, + 'exportConfig' => [ + ExportMenu::FORMAT_EXCEL => [ + 'label' => 'Excel', + 'options' => ['title' => 'Сохранить в Excel'], ], + ExportMenu::FORMAT_TEXT => false, + ExportMenu::FORMAT_HTML => false, + ExportMenu::FORMAT_CSV => false, + ExportMenu::FORMAT_PDF => false, + ], + 'filename' => 'export_' . date('Y-m-d'), + 'showColumnSelector' => false, + 'showConfirmAlert' => false, + 'target' => ExportMenu::TARGET_SELF, + 'dropdownOptions' => [ + 'label' => 'Экспорт данных', + ], + ]); + echo $exportMenu;?> + $dataProvider, + 'columns' => $columns ]); ?> \ No newline at end of file