From: vladfo Date: Wed, 9 Oct 2024 09:10:41 +0000 (+0300) Subject: Выставил значения по умолчанию и кнопки назад на /store/index X-Git-Tag: 1.6~30^2~11 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7b95dc23e4e906953b170fef0c8536864d90dec8;p=erp24_rep%2Fyii-erp24%2F.git Выставил значения по умолчанию и кнопки назад на /store/index --- diff --git a/erp24/controllers/CityStoreController.php b/erp24/controllers/CityStoreController.php index 5ac4bdc8..61a4018f 100644 --- a/erp24/controllers/CityStoreController.php +++ b/erp24/controllers/CityStoreController.php @@ -104,6 +104,8 @@ class CityStoreController extends Controller $model->loadDefaultValues(); } + + return $this->render('/city_store/create', [ 'model' => $model, 'cities' => $cities, diff --git a/erp24/views/city_store/_form.php b/erp24/views/city_store/_form.php index 97653a58..305fb1f8 100644 --- a/erp24/views/city_store/_form.php +++ b/erp24/views/city_store/_form.php @@ -33,7 +33,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'FloraPointID магазина'])) ->widget(Select2::class, [ 'data' => $firms, - 'options' => ['placeholder' => 'Выберите ID'], + 'options' => ['placeholder' => 'Выберите ID', 'value' => $model->f_id ?? 637], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -44,7 +44,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'ID привязанного к магазину юрлица'])) ->widget(Select2::class, [ 'data' => $firms, - 'options' => ['placeholder' => 'Выберите юрлицо'], + 'options' => ['placeholder' => 'Выберите юрлицо', 'value' => $model->firma_id ?? 637], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -55,7 +55,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'Группа привязанного к магазину юрлица???'])) ->widget(Select2::class, [ 'data' => $firmsGroups, - 'options' => ['placeholder' => 'Выберите группу'], + 'options' => ['placeholder' => 'Выберите группу', 'value' => $model->firma_group_id ?? 2], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -66,7 +66,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'Группа привязанного к магазину юрлица???'])) ->widget(Select2::class, [ 'data' => $firmsGroups, - 'options' => ['placeholder' => 'Выберите группу'], + 'options' => ['placeholder' => 'Выберите группу', 'value' => $model->firma_group_id ?? 2], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -87,7 +87,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'style' => 'width: 16px; height: 16px; margin-left:7px; cursor: pointer;', 'data-toggle' => 'tooltip', 'title' => 'Выберите город из списка']))->widget(Select2::class, [ 'data' => $cities, - 'options' => ['placeholder' => 'Выберите город'], + 'options' => ['placeholder' => 'Выберите город', 'value' => $model->city_id ?? 1342], 'pluginOptions' => [ 'allowClear' => true, ], @@ -105,7 +105,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'style' => 'width: 16px; height: 16px; margin-left:7px; cursor: pointer;', 'data-toggle' => 'tooltip', 'title' => 'Позиция магазина'])) ?> - field($model, 'square_store')->textInput(['value' => null]) + field($model, 'square_store')->textInput(['value' => 0]) ->label('Площадь магазина (кв.м) ' . Html::img('@web/images/info-icon.svg', [ 'alt' => 'Info', 'style' => 'width: 16px; height: 16px; margin-left:7px; cursor: pointer;', @@ -275,7 +275,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'ID администратора'])) ->widget(Select2::class, [ 'data' => $administrators, - 'options' => ['placeholder' => 'Выберите администратора'], + 'options' => ['placeholder' => 'Выберите администратора', 'value' => $model->administrator_id ?? 3], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -286,7 +286,7 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P 'data-toggle' => 'tooltip', 'title' => 'ID куста'])) ->widget(Select2::class, [ 'data' => $clusters, - 'options' => ['placeholder' => 'Выберите куст'], + 'options' => ['placeholder' => 'Выберите куст', 'value' => $model->cluster_id ?? 1], 'pluginOptions' => ['allowClear' => true], ]) ?> @@ -305,10 +305,12 @@ $this->registerJsFile('/js/city-store/index.js', ['position' => \yii\web\View::P
'btn btn-success']) ?> - Отмена + Отмена
- + diff --git a/erp24/views/city_store/create.php b/erp24/views/city_store/create.php index 3357b413..a52635be 100644 --- a/erp24/views/city_store/create.php +++ b/erp24/views/city_store/create.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = ['label' => 'City Stores', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?>
- Назад + Назад

title) ?>

render('_form', [ diff --git a/erp24/views/city_store/update.php b/erp24/views/city_store/update.php index b6f41cf2..7f0f917a 100644 --- a/erp24/views/city_store/update.php +++ b/erp24/views/city_store/update.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id $this->params['breadcrumbs'][] = 'Update'; ?>
- Назад + Назад

title) ?>

render('_form', [ diff --git a/erp24/views/city_store/view.php b/erp24/views/city_store/view.php index 10304bcd..8e08fac3 100644 --- a/erp24/views/city_store/view.php +++ b/erp24/views/city_store/view.php @@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = $this->title; \yii\web\YiiAsset::register($this); ?>