From: fomichev Date: Wed, 25 Jun 2025 09:51:11 +0000 (+0300) Subject: Добавление кнопки пересчета X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=bec459ed67646473fc7989b00b98f405f434c5b8;p=erp24_rep%2Fyii-erp24%2F.git Добавление кнопки пересчета --- diff --git a/erp24/views/category-plan/index.php b/erp24/views/category-plan/index.php index a5af77cc..59f6c393 100644 --- a/erp24/views/category-plan/index.php +++ b/erp24/views/category-plan/index.php @@ -159,16 +159,28 @@ input[readonly] {
'btn btn-secondary'])?> - 'btn btn-danger ms-4', + 'btn btn-danger ms-2', 'name' => 'delete', 'value' => 1, 'data' => [ - 'confirm' => 'Вы уверены, что хотите удалить план за ' + 'confirm' => 'Вы уверены, что хотите вернуть автоплан за ' . $model->month . '.' . $model->year . '?', ], ]) ?> + 'btn btn-success ms-2', + 'disabled' => true, + 'id' => 'rebuild', + 'name' => 'rebuild', + 'value' => 1, + 'data' => [ + 'confirm' => 'Вы уверены, что хотите пересчитать автопланограмму за ' + . $model->month . '.' . $model->year . ' для магазина ' . $stores[$model->store_id] . '?', + ], + ]) + ?>
diff --git a/erp24/web/js/category-plan/index.js b/erp24/web/js/category-plan/index.js index 9532403b..72274c70 100644 --- a/erp24/web/js/category-plan/index.js +++ b/erp24/web/js/category-plan/index.js @@ -80,8 +80,16 @@ function editProcent(zis) { write_offs: writeoffsVal, [param26]: token26 }, - dataType: "text" + dataType: "text", + success: function(response) { + // включаем кнопку при успешном сохранении + $('#rebuild').prop('disabled', false); + }, + error: function() { + alert('Ошибка сохранения! Попробуйте ещё раз.'); + } }); + } $(document).ready(() => {