From: fomichev Date: Fri, 7 Feb 2025 10:12:19 +0000 (+0300) Subject: Правки X-Git-Tag: 1.7~2^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=849769cb57396c00748075e83c4428d30e4bfd84;p=erp24_rep%2Fyii-erp24%2F.git Правки --- diff --git a/erp24/records/StoreCityList.php b/erp24/records/StoreCityList.php index 9c8c0bfd..226f645b 100644 --- a/erp24/records/StoreCityList.php +++ b/erp24/records/StoreCityList.php @@ -41,7 +41,10 @@ class StoreCityList extends \yii\db\ActiveRecord [['created_at', 'parent_id'], 'safe'], [['name', 'type'], 'string', 'max' => 255], [['type'], 'in', 'range' => [self::TYPE_REGION, self::TYPE_CITY, self::TYPE_DISTRICT]], - [['parent_id'], 'exist', 'skipOnError' => true, 'targetClass' => StoreCityList::class, 'targetAttribute' => ['parent_id' => 'id']], + [ + ['parent_id'], 'exist', 'skipOnError' => true, 'targetClass' => StoreCityList::class, + 'targetAttribute' => ['parent_id' => 'id'] + ], ]; } @@ -51,10 +54,10 @@ class StoreCityList extends \yii\db\ActiveRecord public function attributeLabels() { return [ - 'id' => 'Первичный ключ', + 'id' => 'Код региона', 'parent_id' => 'Идентификатор родителя', - 'name' => 'Название (регион, город, район)', - 'type' => 'Тип (region, city, district)', + 'name' => 'Название', + 'type' => 'Тип', 'created_at' => 'Дата создания записи', ]; } diff --git a/erp24/views/store-city-list/index.php b/erp24/views/store-city-list/index.php index 6f9e529d..17481d44 100644 --- a/erp24/views/store-city-list/index.php +++ b/erp24/views/store-city-list/index.php @@ -1,27 +1,43 @@ title = 'Справочник адресов (регион, город, район)'; +$this->title = 'Справочник адресов'; $this->params['breadcrumbs'][] = $this->title; ?>
-

title) ?>

+
+

title) ?>

+ 'ms-3', 'target' => '_blank', 'title' => 'Открыть документацию'] + ) ?> +

Загрузка из excel регионов в справочник + 'ms-2', 'target' => '_blank', 'title' => 'Скачать шаблон для загрузки'] + ) ?>

+ 'multipart/form-data', 'class' => 'row row-cols-lg-auto g-3 align-items-center']) ?>
@@ -51,17 +67,35 @@ $this->params['breadcrumbs'][] = $this->title; 'columns' => [ ['class' => 'yii\grid\SerialColumn'], - 'id', + [ + 'attribute' => 'id', + 'width' => '50px', + 'headerOptions' => ['title' => 'Уникальный идентификатор записи'], + ], [ 'attribute' => 'parent_id', 'value' => function ($model) { - return $model->parent ? $model->parent->name : ''; + return $model->parent ? $model->parent->name : 'Российская Федерация'; }, - 'label' => 'Родитель', + 'label' => 'Административный центр', + 'width' => 'auto', + 'headerOptions' => ['title' => 'Иерархический родитель элемента (для регионов - РФ, для городов - регион и тд)'], + ], + [ + 'attribute' => 'name', + 'label' => 'Название', + 'headerOptions' => ['title' => 'Название административного подразделения'], + ], + [ + 'attribute' => 'type', + 'label' => 'Тип', + 'headerOptions' => ['title' => 'Тип административного подразделения (регион, город, район) - для фильтрации ввести - region, city, district'], + ], + [ + 'attribute' => 'created_at', + 'label' => 'Дата создания', + 'headerOptions' => ['title' => 'Дата добавления записи в систему'], ], - 'name', - 'type', - 'created_at', [ 'class' => ActionColumn::class, 'urlCreator' => function ($action, StoreCityList $model, $key, $index, $column) { diff --git a/erp24/web/uploads/region_temp.xlsx b/erp24/web/uploads/region_temp.xlsx new file mode 100644 index 00000000..f7d048a5 Binary files /dev/null and b/erp24/web/uploads/region_temp.xlsx differ