From: marina Date: Fri, 24 Jan 2025 07:10:12 +0000 (+0300) Subject: ERP-282 Нужно сделать интерфейс настройки магазина X-Git-Tag: 1.7~35^2~26 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=483f59c780b6d7ea6a5f68554c8d41fa170e238a;p=erp24_rep%2Fyii-erp24%2F.git ERP-282 Нужно сделать интерфейс настройки магазина --- diff --git a/erp24/controllers/CityStoreParamsController.php b/erp24/controllers/CityStoreParamsController.php index d87fe8c3..7971652d 100644 --- a/erp24/controllers/CityStoreParamsController.php +++ b/erp24/controllers/CityStoreParamsController.php @@ -40,24 +40,6 @@ class CityStoreParamsController extends Controller ]; } - /** - * Список всех записей - * @return mixed - */ - public function actionIndex() - { - $dataProvider = new ActiveDataProvider([ - 'query' => CityStoreParams::find(), - 'pagination' => [ - 'pageSize' => 20, - ], - ]); - - return $this->render('index', [ - 'dataProvider' => $dataProvider, - ]); - } - /** * Просмотр конкретной записи * @param int $id @@ -72,7 +54,7 @@ class CityStoreParamsController extends Controller } - public function actionUpdate() + public function actionIndex() { $model = !empty(Yii::$app->request->post()['CityStoreParams']['id']) ? $this->findModel(Yii::$app->request->post()['CityStoreParams']['id']) @@ -87,7 +69,7 @@ class CityStoreParamsController extends Controller } } - return $this->render('update'); + return $this->render('index'); } /** diff --git a/erp24/views/city-store-params/index.php b/erp24/views/city-store-params/index.php index 03b8699d..89511535 100644 --- a/erp24/views/city-store-params/index.php +++ b/erp24/views/city-store-params/index.php @@ -1,53 +1,216 @@ title = 'Список магазинов с настройками'; +$this->title = 'City Store Params'; $this->params['breadcrumbs'][] = $this->title; + +$this->title = "Настройка параметров магазина"; +$this->params['breadcrumbs'][] = $this->title; + +$this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' => \yii\web\View::POS_END]); ?> -
+

title) ?>

- 'btn btn-success']) ?> + 'btn btn-primary mb-3']) ?> - $dataProvider, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - [ - 'attribute' => 'store_id', - 'value' => function ($data) { - return $data->store->name ?? ''; - } - ], - [ - 'attribute' => 'store_type', - 'value' => function ($data) { - return $data->storeType->name ?? ''; - } - ], - [ - 'attribute' => 'address_region', - 'value' => function ($data) { - return $data->addressRegion->name ?? ''; - } - ], - [ - 'attribute' => 'created_by', - 'value' => function ($data) { - return $data->updatedBy->name_full ?? ''; - } - ], - 'created_at', - [ - 'class' => 'yii\grid\ActionColumn', - 'template' => '{view} {delete}', - ] - ], - 'layout' => '{items}', - ]); ?> +
+
+
+ StoreCityList::TYPE_REGION]), 'id', 'name'), + ['prompt' => 'Выберите регион', 'class' => 'form-select', 'id' => 'address_region']); + ?> + 'd-block mt-2 text-decoration-none']); + ?> +
+
+
+
+ StoreCityList::TYPE_CITY]), 'id', 'name'), + ['prompt' => 'Выберите город', 'class' => 'form-select', 'id' => 'address_city']); + ?> +
+
+
+
+ StoreCityList::TYPE_DISTRICT]), 'id', 'name'), + ['prompt' => 'Выберите район', 'class' => 'form-select', 'id' => 'address_district']); + ?> +
+
+
+
+ all(), 'id', 'name'), + ['prompt' => 'Выберите тип магазина', 'class' => 'form-select', 'id' => 'store_type']); + ?> + 'd-block mt-2 text-decoration-none']); ?> +
+
+
+
+ AdminGroup::GROUP_BUSH_DIRECTOR]), 'id', 'name_full'), + ['prompt' => 'Выберите территориального управляющего', 'class' => 'form-select', 'id' => 'territorial_manager']); + ?> +
+
+
+
+
+
+
+
+
+ \yii_app\records\AdminGroup::GROUP_BUSH_CHEF_FLORIST]), 'id', 'name_full'), + ['prompt' => 'Выберите кустового шеф флориста', 'class' => 'form-select', 'id' => 'bush_chef_florist']); + ?> +
+
+
+
+
+ 'btn btn-primary w-100', 'id' => 'apply-button']); ?> +
+
+
+
+ +
+
+
+ all(), 'id', 'name'), [ + 'multiple' => true, + 'size' => 16, + 'class' => 'form-control', + 'id' => 'selected-store', + ]) ?> + 'btn btn-primary w-100 mt-2 py-1', 'id' => 'edit-button']); ?> +
+
+
+
+
+ + + + + 'store-name', 'class' => 'h5']); ?> +
+
+ 'Тип магазина', 'class' => 'form-select', 'id' => 'store-type']); ?> + 'd-block mt-2 text-decoration-none']); ?> +
+
+ 'Номер куста', 'class' => 'form-select', 'id' => 'bush-id']); ?> +
+
+
+
+ +
+
+ + 'Регион', 'class' => 'form-select', 'id' => 'region']); ?> +
+
+ + 'Город', 'class' => 'form-select', 'id' => 'city']); ?> +
+
+ + 'Район', 'class' => 'form-select', 'id' => 'district']); ?> +
+
+
+
+ + 'd-block mb-5 text-decoration-none']); ?> +
+
+ 'territorial-manager', 'class' => 'h5']); ?> +
+
+
+
+ +
+
+ 'Кустовой шеф-флорист', 'class' => 'form-select', 'id' => 'bush-chef-florist']); ?> +
+
+
+
+ 'form-label']); ?> + 'store-area', + 'class' => 'form-control', + 'placeholder' => 'Введите число', + 'oninput' => 'validateDecimal(this)' + ]); ?> + 'form-label']); ?> + 'showcase-volume', + 'class' => 'form-control', + 'placeholder' => 'Введите число', + 'oninput' => 'validateDecimal(this)' + ]); ?> + 'form-label']); ?> + 'freeze-area', + 'class' => 'form-control', + 'placeholder' => 'Введите число', + 'oninput' => 'validateDecimal(this)' + ]); ?> + 'form-label']); ?> + 'freeze-volume', + 'class' => 'form-control', + 'placeholder' => 'Введите число', + 'oninput' => 'validateDecimal(this)' + ]); ?> +
+
+
+ + 'd-block mb-5 text-decoration-none']); ?> + 'CityStoreParams[matrix_type]', + 'data' => [], + 'language' => 'ru-RU', + 'options' => [ + 'id' => 'matrix-type', + 'placeholder' => 'Выберите тип матрицы', + 'multiple' => true, + ], + ]); ?> +
+
+
+ 'btn btn-success']) ?> +
+
+
+
+ +
diff --git a/erp24/views/city-store-params/update.php b/erp24/views/city-store-params/update.php deleted file mode 100644 index 89511535..00000000 --- a/erp24/views/city-store-params/update.php +++ /dev/null @@ -1,216 +0,0 @@ -title = 'City Store Params'; -$this->params['breadcrumbs'][] = $this->title; - -$this->title = "Настройка параметров магазина"; -$this->params['breadcrumbs'][] = $this->title; - -$this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' => \yii\web\View::POS_END]); -?> - -
-

title) ?>

- 'btn btn-primary mb-3']) ?> - -
-
-
- StoreCityList::TYPE_REGION]), 'id', 'name'), - ['prompt' => 'Выберите регион', 'class' => 'form-select', 'id' => 'address_region']); - ?> - 'd-block mt-2 text-decoration-none']); - ?> -
-
-
-
- StoreCityList::TYPE_CITY]), 'id', 'name'), - ['prompt' => 'Выберите город', 'class' => 'form-select', 'id' => 'address_city']); - ?> -
-
-
-
- StoreCityList::TYPE_DISTRICT]), 'id', 'name'), - ['prompt' => 'Выберите район', 'class' => 'form-select', 'id' => 'address_district']); - ?> -
-
-
-
- all(), 'id', 'name'), - ['prompt' => 'Выберите тип магазина', 'class' => 'form-select', 'id' => 'store_type']); - ?> - 'd-block mt-2 text-decoration-none']); ?> -
-
-
-
- AdminGroup::GROUP_BUSH_DIRECTOR]), 'id', 'name_full'), - ['prompt' => 'Выберите территориального управляющего', 'class' => 'form-select', 'id' => 'territorial_manager']); - ?> -
-
-
-
-
-
-
-
-
- \yii_app\records\AdminGroup::GROUP_BUSH_CHEF_FLORIST]), 'id', 'name_full'), - ['prompt' => 'Выберите кустового шеф флориста', 'class' => 'form-select', 'id' => 'bush_chef_florist']); - ?> -
-
-
-
-
- 'btn btn-primary w-100', 'id' => 'apply-button']); ?> -
-
-
-
- -
-
-
- all(), 'id', 'name'), [ - 'multiple' => true, - 'size' => 16, - 'class' => 'form-control', - 'id' => 'selected-store', - ]) ?> - 'btn btn-primary w-100 mt-2 py-1', 'id' => 'edit-button']); ?> -
-
-
-
-
- - - - - 'store-name', 'class' => 'h5']); ?> -
-
- 'Тип магазина', 'class' => 'form-select', 'id' => 'store-type']); ?> - 'd-block mt-2 text-decoration-none']); ?> -
-
- 'Номер куста', 'class' => 'form-select', 'id' => 'bush-id']); ?> -
-
-
-
- -
-
- - 'Регион', 'class' => 'form-select', 'id' => 'region']); ?> -
-
- - 'Город', 'class' => 'form-select', 'id' => 'city']); ?> -
-
- - 'Район', 'class' => 'form-select', 'id' => 'district']); ?> -
-
-
-
- - 'd-block mb-5 text-decoration-none']); ?> -
-
- 'territorial-manager', 'class' => 'h5']); ?> -
-
-
-
- -
-
- 'Кустовой шеф-флорист', 'class' => 'form-select', 'id' => 'bush-chef-florist']); ?> -
-
-
-
- 'form-label']); ?> - 'store-area', - 'class' => 'form-control', - 'placeholder' => 'Введите число', - 'oninput' => 'validateDecimal(this)' - ]); ?> - 'form-label']); ?> - 'showcase-volume', - 'class' => 'form-control', - 'placeholder' => 'Введите число', - 'oninput' => 'validateDecimal(this)' - ]); ?> - 'form-label']); ?> - 'freeze-area', - 'class' => 'form-control', - 'placeholder' => 'Введите число', - 'oninput' => 'validateDecimal(this)' - ]); ?> - 'form-label']); ?> - 'freeze-volume', - 'class' => 'form-control', - 'placeholder' => 'Введите число', - 'oninput' => 'validateDecimal(this)' - ]); ?> -
-
-
- - 'd-block mb-5 text-decoration-none']); ?> - 'CityStoreParams[matrix_type]', - 'data' => [], - 'language' => 'ru-RU', - 'options' => [ - 'id' => 'matrix-type', - 'placeholder' => 'Выберите тип матрицы', - 'multiple' => true, - ], - ]); ?> -
-
-
- 'btn btn-success']) ?> -
-
-
-
- -
-