From 9136f5a74ff3ed726ca014fa3200c55a8ecc73e5 Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 22 Apr 2026 10:13:27 +0300 Subject: [PATCH] fix marking --- erp24/views/marking/index.php | 103 +++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/erp24/views/marking/index.php b/erp24/views/marking/index.php index 103f376f..ee9bbe84 100644 --- a/erp24/views/marking/index.php +++ b/erp24/views/marking/index.php @@ -108,9 +108,13 @@ if (!empty($markings)) { getStatusBadge() ?> - - - + is_active): ?> + + + + + + is_active): ?> ' + messages[0] + ''); }); + } else { + \$saveBtn.prop('disabled', false); + alert(resp.message || 'Ошибка сохранения'); } }, - error: function() { alert('Ошибка сервера'); } + error: function() { + \$saveBtn.prop('disabled', false); + alert('Ошибка сервера'); + } }); }); - $(document).on('click', '.btn-marking-delete', function(e) { + \$(document).on('click.markingtab', '.btn-marking-delete', function(e) { e.preventDefault(); - var id = $(this).data('id'); - var code = $(this).data('code'); + var id = \$(this).data('id'); + var code = \$(this).data('code'); if (!confirm('Деактивировать маркировку "' + code + '"?')) { return; } - $.ajax({ + \$.ajax({ url: '{$deleteUrl}?id=' + id, type: 'POST', data: {_csrf: yii.getCsrfToken()}, @@ -251,10 +287,9 @@ $js = <<