]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-302 Редактирование букета
authormarina <m.zozirova@gmail.com>
Fri, 21 Feb 2025 07:13:22 +0000 (10:13 +0300)
committermarina <m.zozirova@gmail.com>
Fri, 21 Feb 2025 07:13:22 +0000 (10:13 +0300)
erp24/views/bouquet/_product_edit.php
erp24/web/js/bouquet/bouquet.js

index 1f3479cc03e40c6a0cf7438e256ededc3de2458a..e1f5b9c6b34acdc767b72e1b68fae41bb24738aa 100644 (file)
@@ -16,14 +16,14 @@ use yii\helpers\Html;
 ]) ?>
 <br>
 <div class="row">
-    <div class="col-md-4">
+    <div class="col-md-6">
         <div class="pt-2">
             <p class="mb-1"><strong>Себестоимость:</strong> <span class="selfcost-value"><?= $selfCost ?? 0 ?></span> ₽</p>
             <p class="mb-1"><strong>Наценка:</strong> <span class="markup-value"><?= $markUp?? 0 ?></span></p>
             <p class="mb-0"><strong>Цена:</strong> <span class="cost-value"><?= $cost ?? 0 ?></span> ₽</p>
         </div>
     </div>
-<div class="col-md-4"></div>
+<div class="col-md-2"></div>
     <?php if (!$isCreate) {?>
         <div class="col-md-2 d-flex justify-content-end align-items-end px-3 w-100">
             <?= Html::button('Рассчитать', ['class' => 'btn btn-warning calculate-btn w-100']) ?>
index 03c72a73c48f50487acdffc067576f2c5a86a36a..4b273debe073efd01ee9fe6a5fa3b9d02f79fdbc 100644 (file)
@@ -46,7 +46,7 @@ $('.calculate-btn').on('click', function () {
     let data = [];
 
     $('.selected-item').each(function () {
-        let id = $(this).data('id'); 
+        let id = $(this).data('id');
         let quantity = $(this).find('.quantity-input').val();
 
         if (id && quantity) {
@@ -56,6 +56,9 @@ $('.calculate-btn').on('click', function () {
             });
         }
     });
+    $('.cost-value').text(null);
+    $('.selfcost-value').text(null);
+    $('.markup-value').text(null);
 
     $.ajax({
         url: '/bouquet/get-calculates',
@@ -66,7 +69,7 @@ $('.calculate-btn').on('click', function () {
         success: function(response) {
             if (response) {
                 if (response.cost !== undefined) {
-                    $('.price-value').text(response.cost);
+                    $('.cost-value').text(response.cost);
                 }
                 if (response.selfcost !== undefined) {
                     $('.selfcost-value').text(response.selfcost);