From c6874f02e544041de37b336b8533adf306f751b9 Mon Sep 17 00:00:00 2001 From: marina Date: Fri, 24 Jan 2025 12:08:54 +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 --- .../controllers/CityStoreParamsController.php | 5 ++-- erp24/views/city-store-params/index.php | 25 ++++++++++++------- .../js/city-store-params/city-store-params.js | 9 +++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/erp24/controllers/CityStoreParamsController.php b/erp24/controllers/CityStoreParamsController.php index e8995e5c..51050cd9 100644 --- a/erp24/controllers/CityStoreParamsController.php +++ b/erp24/controllers/CityStoreParamsController.php @@ -138,12 +138,13 @@ class CityStoreParamsController extends Controller ->andFilterWhere([ 'visible' => CityStore::IS_VISIBLE, 'city' => $addressCity, - 'district' => $addressRegion, - 'type' => $addressDistrict, + 'region' => $addressRegion, + 'district' => $addressDistrict, 'type' => $storeType, ]) ->andFilterWhere(['in', 'id', $bushChefFloristStoreIds]) ->andFilterWhere(['in', 'id', $territorialManagerStoreIds]) + ->orderBy('id') ->all(); return [ diff --git a/erp24/views/city-store-params/index.php b/erp24/views/city-store-params/index.php index 03379c6d..b923ae26 100644 --- a/erp24/views/city-store-params/index.php +++ b/erp24/views/city-store-params/index.php @@ -6,6 +6,7 @@ use yii\helpers\Html; use yii\helpers\Url; use yii_app\records\Admin; use yii_app\records\AdminGroup; +use yii_app\records\CityStore; use yii_app\records\StoreCityList; use yii_app\records\StoreType; @@ -95,12 +96,15 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
all(), 'id', 'name'), [ - 'multiple' => true, - 'size' => 16, - 'class' => 'form-control', - 'id' => 'selected-store', - ]) ?> + ArrayHelper::map(CityStore::find()->where(['visible' => CityStore::IS_VISIBLE])->orderBy('id')->all(), 'id', function ($store) { + return $store->id . ' ' . $store->name; + }), + [ + 'multiple' => true, + 'size' => 16, + 'class' => 'form-control', + 'id' => 'selected-store', + ]) ?> 'btn btn-primary w-100 mt-2 py-1', 'id' => 'edit-button']); ?>
@@ -164,6 +168,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' 'placeholder' => 'Введите число', 'oninput' => 'validateDecimal(this)' ]); ?> + 'form-label']); ?> 'showcase-volume', @@ -171,6 +176,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' 'placeholder' => 'Введите число', 'oninput' => 'validateDecimal(this)' ]); ?> + 'form-label']); ?> 'freeze-area', @@ -178,6 +184,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position' 'placeholder' => 'Введите число', 'oninput' => 'validateDecimal(this)' ]); ?> + 'form-label']); ?> 'freeze-volume', @@ -188,14 +195,14 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
- + 'd-block mb-5 text-decoration-none']); ?> 'CityStoreParams[matrix_type]', 'data' => [], 'language' => 'ru-RU', 'options' => [ - 'id' => 'matrix-type', + 'id' => 'matrix-type', 'placeholder' => 'Выберите тип матрицы', 'multiple' => true, ], @@ -203,7 +210,7 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
- 'btn btn-success']) ?> + 'btn btn-success']) ?>
diff --git a/erp24/web/js/city-store-params/city-store-params.js b/erp24/web/js/city-store-params/city-store-params.js index f68a1a79..158c8014 100644 --- a/erp24/web/js/city-store-params/city-store-params.js +++ b/erp24/web/js/city-store-params/city-store-params.js @@ -138,6 +138,15 @@ function populateDualListbox(matrixTypeArray, matrixType) { select.val(matrixType).trigger('change'); } +function validateDecimal(input) { + let value = input.value; + value = value.replace(/[^0-9.]/g, ''); + if (value.indexOf('.') !== -1) { + value = value.replace(/(\.\d{2})\d+$/, '$1'); + } + input.value = value; +} + -- 2.39.5