From: marina Date: Thu, 20 Feb 2025 10:49:10 +0000 (+0300) Subject: ERP-302 Редактирование букета X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=668e2a4a85b0f3ec92221316ba19651c16d3c89e;p=erp24_rep%2Fyii-erp24%2F.git ERP-302 Редактирование букета --- diff --git a/erp24/views/bouquet/_form.php b/erp24/views/bouquet/_form.php index 5b8d6795..1e3f793f 100644 --- a/erp24/views/bouquet/_form.php +++ b/erp24/views/bouquet/_form.php @@ -77,26 +77,26 @@ $form = ActiveForm::begin([
-
- - render('_product_list', [ - 'model' => $model, - 'bouquetCompositionProducts' => $bouquetCompositionProducts - ]); - ?> - - - render('_product_edit', [ - 'availableItems' => $availableItems, - 'selectedItems' => [], - 'isCreate' => true, - ]);?> - - -
+
+ + render('_product_list', [ + 'model' => $model, + 'bouquetCompositionProducts' => $bouquetCompositionProducts + ]); + ?> + + + render('_product_edit', [ + 'availableItems' => $availableItems, + 'selectedItems' => [], + 'isCreate' => true, + 'listContainerSize' => ['width' => '300px', 'height' => '300px'] + ]); ?> + +
-
+
'text-center font-weight-bold pt-5 h5']) ?>
diff --git a/erp24/views/bouquet/_product_edit.php b/erp24/views/bouquet/_product_edit.php index 3a8f7d96..a8351654 100644 --- a/erp24/views/bouquet/_product_edit.php +++ b/erp24/views/bouquet/_product_edit.php @@ -10,23 +10,27 @@ use yii\widgets\ActiveForm; 'availableItems' => $availableItems, 'selectedItems' => $selectedItems, 'ajaxUrl' => '/bouquet/get-list', + 'showQuantity' => true, + 'listContainerSize' => $listContainerSize, 'triggerButton' => 'apply-button', 'filterFields' => ['size', 'color', 'species', 'category', 'type-num'] ]) ?> -
-
-
-

Себестоимость: 0 ₽

-

Наценка: 0 %

-

Цена: 0 ₽

-
-
-
-
- 'btn btn-success w-100']) - ?> +
+
+
+
+

Себестоимость: 0 ₽

+

Наценка: 0 %

+

Цена: 0 ₽

+
+ +
+ 'btn btn-success w-100']) ?> +
+ + +
\ No newline at end of file diff --git a/erp24/views/bouquet/create.php b/erp24/views/bouquet/create.php index d8919671..be17ce0d 100644 --- a/erp24/views/bouquet/create.php +++ b/erp24/views/bouquet/create.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Букеты', 'url' => ['index']] $this->params['breadcrumbs'][] = $this->title; ?> -
+
render('_form', [ 'onlineStoresList' => $onlineStoresList, 'bouquetCompositionProducts' => [], diff --git a/erp24/views/bouquet/update.php b/erp24/views/bouquet/update.php index c541ead8..bacbf370 100644 --- a/erp24/views/bouquet/update.php +++ b/erp24/views/bouquet/update.php @@ -49,6 +49,7 @@ $this->registerJsFile('/js/bouquet/bouquet.js', ['position' => \yii\web\View::PO render('_product_edit', [ 'availableItems' => $availableItems, 'selectedItems' => $selectedItems, - 'isCreate' => true, + 'isCreate' => false, + 'listContainerSize' => [], ]); ?>
diff --git a/erp24/views/bouquet/view.php b/erp24/views/bouquet/view.php index 2b49b726..b126225c 100644 --- a/erp24/views/bouquet/view.php +++ b/erp24/views/bouquet/view.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Букеты', 'url' => ['index']] $this->params['breadcrumbs'][] = $this->title; ?> -
+
render('_form', [ 'model' => $model, 'onlineStoresList' => $onlineStoresList, diff --git a/erp24/widgets/DualList.php b/erp24/widgets/DualList.php index 59befdb7..97b915d9 100644 --- a/erp24/widgets/DualList.php +++ b/erp24/widgets/DualList.php @@ -14,6 +14,8 @@ class DualList extends Widget public $selectedItems = []; public $filterFields = []; public $ajaxUrl; + public $listContainerSize = ['width' => '450px', 'height' => '220px']; + public $showQuantity = false; // Новое свойство для кнопки, вызывающей загрузку @@ -31,6 +33,8 @@ class DualList extends Widget protected function renderDualListBox() { $id = $this->getId(); + $width = isset($this->listContainerSize['width']) ? $this->listContainerSize['width'] : '450px'; + $height = isset($this->listContainerSize['height']) ? $this->listContainerSize['height'] : '220px'; $css = << @@ -116,13 +120,47 @@ class DualList extends Widget border: 1px solid #ccc; border-radius: 4px; } + + .list-container { + width: {$width} !important; + height: auto !important; /* Высота контейнера динамическая */ + display: flex; + flex-direction: column; + align-items: center; + position: relative; + } + + .section-label { + width: 100% !important; + text-align: center; + font-size: 19px; + } + + .filter-input { + width: 100% !important; + margin-bottom: 10px; + padding: 5px; + border: 1px solid #ccc; + border-radius: 4px; + } + + .dual-list { + width: 100% !important; + height: {$height} !important; + background: white; + border: 1px solid #ddd; + padding: 5px; + text-align: left; + overflow-y: auto; + border-radius: 5px; + } + .count-label { position: absolute; - bottom: 5px; + bottom: -20px; right: 5px; - font-size: 12px; - color: #555; } + .section-label { font-weight: bold; margin-bottom: 5px;