From eefde26a2c21a0f6071c889b51db33453f984304 Mon Sep 17 00:00:00 2001 From: marina Date: Thu, 23 Jan 2025 17:22:18 +0300 Subject: [PATCH] =?utf8?q?ERP-282=20=D0=9D=D1=83=D0=B6=D0=BD=D0=BE=20?= =?utf8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20=D0=B8=D0=BD=D1=82?= =?utf8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=20=D0=BD=D0=B0=D1=81=D1=82?= =?utf8?q?=D1=80=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7?= =?utf8?q?=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/StoreTypeController.php | 2 +- ...41638_add_new_column_city_store_params.php | 25 +++++++++++ erp24/records/CityStoreParams.php | 4 +- erp24/views/city-store-params/index.php | 18 ++++---- erp24/views/store-type/index.php | 2 +- .../js/city-store-params/city-store-params.js | 42 +++++++++++++++++-- 6 files changed, 77 insertions(+), 16 deletions(-) create mode 100644 erp24/migrations/m250123_141638_add_new_column_city_store_params.php diff --git a/erp24/controllers/StoreTypeController.php b/erp24/controllers/StoreTypeController.php index 52249124..d4462f64 100644 --- a/erp24/controllers/StoreTypeController.php +++ b/erp24/controllers/StoreTypeController.php @@ -1,6 +1,6 @@ addColumn('city_store_params', 'bush_id', $this->integer()->comment('ID куста')); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn('city_store_params', 'bush_id'); + } +} diff --git a/erp24/records/CityStoreParams.php b/erp24/records/CityStoreParams.php index d57008d3..c6a1ba5f 100644 --- a/erp24/records/CityStoreParams.php +++ b/erp24/records/CityStoreParams.php @@ -29,6 +29,7 @@ use yii\filters\VerbFilter; * @property string $created_at * @property int|null $updated_by * @property string|null $updated_at + * @property int $bush_id */ class CityStoreParams extends ActiveRecord { @@ -64,7 +65,7 @@ class CityStoreParams extends ActiveRecord { return [ [['store_id'], 'required'], - [['store_id', 'stores_type', 'territorial_manager', 'bush_chef_florist', 'created_by', 'updated_by'], 'integer'], + [['store_id', 'stores_type', 'territorial_manager', 'bush_chef_florist', 'created_by', 'updated_by', 'bush_id'], 'integer'], [['store_area', 'showcase_volume', 'freeze_area', 'freeze_volume'], 'number'], [['created_at', 'updated_at'], 'safe'], [['address_city', 'address_region', 'address_district', 'matrix_type'], 'string'], @@ -90,6 +91,7 @@ class CityStoreParams extends ActiveRecord 'freeze_area' => 'Площадь холодильника', 'freeze_volume' => 'Объем холодильника', 'matrix_type' => 'Тип матрицы', + 'bush_id' => 'ИД куста', 'created_by' => 'ИД создателя', 'created_at' => 'Дата создания', 'updated_by' => 'ИД редактировавшего', diff --git a/erp24/views/city-store-params/index.php b/erp24/views/city-store-params/index.php index a92efd2f..fc19d56b 100644 --- a/erp24/views/city-store-params/index.php +++ b/erp24/views/city-store-params/index.php @@ -53,7 +53,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' ArrayHelper::map(StoreType::find()->all(), 'id', 'name'), ['prompt' => 'Выберите тип магазина', 'class' => 'form-select', 'id' => 'store_type']); ?> - 'd-block mt-2 text-decoration-none']); ?> + 'd-block mt-2 text-decoration-none']); ?>
@@ -100,7 +100,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
-
+
@@ -108,10 +108,11 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' 'store-name', 'class' => 'h5']); ?>
- all(), 'id', 'name'), - ['prompt' => 'Тип магазина', 'class' => 'form-select', 'id' => 'store-type']); ?> - 'd-block mt-2 text-decoration-none']); ?> + 'Тип магазина', 'class' => 'form-select', 'id' => 'store-type']); ?> + 'd-block mt-2 text-decoration-none']); ?> +
+
+ 'Номер куста', 'class' => 'form-select', 'id' => 'store-type']); ?>
@@ -134,7 +135,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
- 'd-block mb-5 text-decoration-none']); ?> + 'd-block mb-5 text-decoration-none']); ?>
'territorial-manager', 'class' => 'h5']); ?> @@ -143,7 +144,6 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
- 'd-block mb-5 text-decoration-none']); ?>
'Кустовой шеф-флорист', 'class' => 'form-select', 'id' => 'bush-chef-florist']); ?> @@ -184,7 +184,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
'CityStoreParams[matrix_type]', - 'items' => ArrayHelper::map(MatrixType::find()->all(), 'id', 'name'), + 'items' => [], 'options' => [ 'size' => false ], diff --git a/erp24/views/store-type/index.php b/erp24/views/store-type/index.php index 43c91e1e..009b8595 100644 --- a/erp24/views/store-type/index.php +++ b/erp24/views/store-type/index.php @@ -1,7 +1,7 @@ ' + value + ''); + }); + + // Если есть выбранные значения, добавляем их в список выбранных (selected list) + if (selectedValues && selectedValues.length > 0) { + selectedValues.forEach(function (selectedId) { + $selectedList.append(''); + }); + } + + // Обновляем состояние виджета, вызываем trigger и возможно init для перерисовки + $nonSelectedList.trigger('change'); + $selectedList.trigger('change'); + + // Повторно инициализируем виджет DualListbox, если это необходимо + if (typeof $('#matrix-type').bootstrapDualListbox === 'function') { + $('#matrix-type').bootstrapDualListbox('refresh'); // или аналогичная функция обновления + } +} -- 2.39.5