]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Тип планограммы
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 21 Jul 2025 13:59:44 +0000 (16:59 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 21 Jul 2025 13:59:44 +0000 (16:59 +0300)
erp24/controllers/AutoPlannogrammaController.php
erp24/views/auto-plannogramma/index.php
erp24/web/css/autoplannogramma/index.css [new file with mode: 0644]
erp24/web/js/autoplannogramma/autoplannogramma.js

index 4606c91f5a62b7302280293093e64bf142d205d1..b57a605f869ccd9bb0b1d48d6fd67dd55095149b 100644 (file)
@@ -100,8 +100,8 @@ class AutoPlannogrammaController extends BaseController
             ->andFilterWhere(['=', 'cp.address_city', $filters['city']])
             ->andFilterWhere(['=', 'cp.address_region', $filters['region']])
             ->andFilterWhere(['=', 'cp.address_district', $filters['district']])
-            ->andFilterWhere(['=', 'cp.store_type', $filters['store_type']])
-            ->andFilterWhere(['=', 'a.capacity_type', $filters['capacity_type']]);
+            ->andFilterWhere(['=', 'cp.store_type', $filters['store_type']]);
+            //->andFilterWhere(['=', 'a.capacity_type', $filters['capacity_type']]);
 
         if (!empty($filters['territorial_manager'])) {
             $territorialManagerStoreIds = StoreDynamic::find()
@@ -148,9 +148,14 @@ class AutoPlannogrammaController extends BaseController
                 ];
             }
 
+            if (!empty($filters['capacity_type']) && $filters['capacity_type'] == 'min') {
+                $quantity = round((int)$model['modify'] * 0.3, 2);
+            } else {
+                $quantity = (int)$model['modify'];
+            }
             $result[$productId]['values'][] = [
                 'id' => $model['plan_id'],
-                'quantity' => (int)$model['modify'],
+                'quantity' => $quantity,
                 'store_id' => (int)$model['store_id'],
                 'title' => !empty($model['details']) ? json_decode($model['details'], true) : null,
             ];
index 9ee91af0c7f654a0e334ea6715693ff3227c3a55..d5c4204919faad89da07ce5ffa0d14418b033975 100644 (file)
@@ -19,7 +19,7 @@ use yii\jui\Accordion;
 
 
 use yii\data\ArrayDataProvider;
-
+$this->registerCssFile(Yii::getAlias('@web') . '/css/autoplannogramma/index.css');
 $tooltipText = "Оффлайн: 50&#10;Флаумак (off-line): 20&#10;Флаумак (on-line): 10&#10;Флаумак (market): 10&#10;Изумительная (off-line): 30&#10;Списания: 20";
 $this->registerJsFile('/js/autoplannogramma/autoplannogramma.js', ['position' => View::POS_END]);
 ?>
diff --git a/erp24/web/css/autoplannogramma/index.css b/erp24/web/css/autoplannogramma/index.css
new file mode 100644 (file)
index 0000000..76d7a68
--- /dev/null
@@ -0,0 +1,11 @@
+.auto-input-bg {
+    background-color: #5b9aff !important;
+    color: #fff !important;
+    border: 1px solid #5b9aff !important;
+}
+
+.corrected-input-bg {
+    background-color: #9dff5b !important;
+    color: #fff !important;
+    border: 1px solid #9dff5b !important;
+}
\ No newline at end of file
index e337b58d11f19f8bd79241df591c8fea976a5055..00f03c3f6cf691b73b0cd2d49e0bdebbcda0ba87 100644 (file)
@@ -44,6 +44,10 @@ document.addEventListener("DOMContentLoaded", () => {
 
 $(document).ready(function () {
     $('.btn-apply').trigger('click');
+    $('#polnogramma-type').on('change', function () {
+        console.log('Выбрано:', $(this).val());
+
+    });
 });
 
 
@@ -105,7 +109,7 @@ $('.subcategory .list-group-item').on('click', function (e) {
     filters.month = getMonthByWeek(week, year, true);
     filters.category = category;
     filters.subcategory = subcategory;
-
+    console.log(filters.capacity_type);
     $('.loader-overlay').removeClass('d-none');
 
     $.ajax({
@@ -160,7 +164,7 @@ $('.subcategory .list-group-item').on('click', function (e) {
                         <td data-store-id="${storeId}">
                             <div class="d-flex align-items-center">
                                 <input type="number" 
-                                       class="btn btn-primary input w-100"
+                                       class="btn input w-100 auto-input-bg"
                                        value="${val.quantity}"
                                        data-id="${val.id}"
                                        data-guid="${item.product_id || ''}"