]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Выставил значения по умолчанию и кнопки назад на /store/index
authorvladfo <fvv2011@gmail.com>
Wed, 9 Oct 2024 09:10:41 +0000 (12:10 +0300)
committervladfo <fvv2011@gmail.com>
Wed, 9 Oct 2024 09:10:41 +0000 (12:10 +0300)
erp24/controllers/CityStoreController.php
erp24/views/city_store/_form.php
erp24/views/city_store/create.php
erp24/views/city_store/update.php
erp24/views/city_store/view.php

index 5ac4bdc82011dd637a076c71a177675fbc017f87..61a4018f228440f7c9c092e12d6ae3a05ae5eadc 100644 (file)
@@ -104,6 +104,8 @@ class CityStoreController extends Controller
             $model->loadDefaultValues();
         }
 
+
+
         return $this->render('/city_store/create', [
             'model' => $model,
             'cities' => $cities,
index 97653a581a16dd4b48909badc1b51709042aeb3d..305fb1f8632213a1a57695ac800d684203062d4b 100644 (file)
@@ -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' => 'Позиция магазина'])) ?>
 
-    <?= $form->field($model, 'square_store')->textInput(['value' => null])
+    <?= $form->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
 
     <div class="form-group">
         <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
-        <a href="<?= Url::to(['/city-store/index']) ?>" class="btn btn-danger">Отмена</a>
+        <a href="<?= Url::to(['/store/index']) ?>" class="btn btn-danger">Отмена</a>
     </div>
 
-    <?php ActiveForm::end(); ?>
+    <?php ActiveForm::end();
+    print_r($firms);
+    ?>
 
 
 
index 3357b413a179ec5afc5f5daf1e1f978f983c3998..a52635bee3fc7b997c9b9718ed2a185b1fa48fa5 100644 (file)
@@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = ['label' => 'City Stores', 'url' => ['index']];
 $this->params['breadcrumbs'][] = $this->title;
 ?>
 <div class="city-store-create m-3">
-    <a href="<?= Url::to(['/city-store/index']) ?>" class="btn btn-link">Назад</a>
+    <a href="<?= Url::to(['/store/index']) ?>" class="btn btn-link">Назад</a>
     <h1><?= Html::encode($this->title) ?></h1>
 
     <?= $this->render('_form', [
index b6f41cf2a2e0cbde096f9d1a8caf431a439f68e0..7f0f917a002962116a8ab03f694154846dee3306 100644 (file)
@@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id
 $this->params['breadcrumbs'][] = 'Update';
 ?>
 <div class="city-store-update m-3">
-    <a href="<?= Url::to(['/city-store/index']) ?>" class="btn btn-link">Назад</a>
+    <a href="<?= Url::to(['/store/index']) ?>" class="btn btn-link">Назад</a>
     <h1><?= Html::encode($this->title) ?></h1>
 
     <?= $this->render('_form', [
index 10304bcd4923472df51329afcab1eaf2ebc0c2e1..8e08fac3e16e000fae20671da7d31e8e495844ef 100644 (file)
@@ -13,7 +13,7 @@ $this->params['breadcrumbs'][] = $this->title;
 \yii\web\YiiAsset::register($this);
 ?>
 <div class="city-store-view p-4">
-    <a href="<?= Url::to(['/city-store/index']) ?>" class="btn btn-link">Назад</a>
+    <a href="<?= Url::to(['/store/index']) ?>" class="btn btn-link">Назад</a>
     <h1><?= Html::encode($this->title) ?></h1>
 
     <p>