]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-155] подсветка изменившихся полей
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 3 Oct 2024 07:31:44 +0000 (10:31 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 3 Oct 2024 07:31:44 +0000 (10:31 +0300)
erp24/views/marketplace/priority.php
erp24/web/js/marketplace/priority.js

index 51904f985a97dc64dc93a7b76f86a09fb98d78b9..31a9c4a2049ac9b678cc5f3853cada542aec8bf0 100644 (file)
@@ -32,8 +32,8 @@ $this->registerJsFile('/js/marketplace/priority.js', ['position' => \yii\web\Vie
                     $reminderKoef = $marketplacePriorityMap[$guid]->reminder_koef ?? 2;
                     $minimalQuantity = $marketplacePriorityMap[$guid]->minimal_quantity ?? 2;
                     ?>
-                    <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'reminder_koef', this.value)" value="<?= $reminderKoef ?>"/></td>
-                    <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'minimal_quantity', this.value)" value="<?= $minimalQuantity ?>"/></td>
+                    <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'reminder_koef', this)" value="<?= $reminderKoef ?>"/></td>
+                    <td><input onblur="ajaxSavePrameter('<?= $guid ?>', 'minimal_quantity', this)" value="<?= $minimalQuantity ?>"/></td>
                 </tr>
             <?php endforeach; ?>
             </tbody>
index bd6cae28ebefb97e10a76eb82fb5f3007d675d75..000f801e1cd5e2decb07afe172cac6e53fc34626 100644 (file)
@@ -13,7 +13,8 @@ $(document).ready(() => {
     });
 })
 
-function ajaxSavePrameter(guid, paramName, value) {
+function ajaxSavePrameter(guid, paramName, self) {
+    var value = self.value;
     $.ajax({
         url: window.location.href,
         method: 'post',
@@ -21,6 +22,10 @@ function ajaxSavePrameter(guid, paramName, value) {
         data: {guid, paramName, value, [param22]: token22},
         success: function(data) {
             console.log(data);
+            self.style.background = 'lightgreen';
+            setTimeout(() => {
+                self.style.background = 'white';
+            }, 1000)
         },
     });
 }
\ No newline at end of file