From: fomichev Date: Tue, 1 Jul 2025 15:01:48 +0000 (+0300) Subject: Редактирование разметки X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b90d9760a754bbe50457289e15996c339cb6b9ef;p=erp24_rep%2Fyii-erp24%2F.git Редактирование разметки --- diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 6111b05f..97299e18 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1746,6 +1746,18 @@ class CronController extends Controller $cache = Yii::$app->cache; $task = $cache->get($cacheKey); + /*if (!$task) { + $scriptLauncherLog = ScriptLauncherLog::find() + ->andWhere(['name' => "taskApRecalculate"]) + ->orderBy(['created_at' => SORT_DESC]) + ->asArray() + ->limit(1) + ->one(); + if ($scriptLauncherLog && $scriptLauncherLog['active'] == 1) { + $task = json_decode($scriptLauncherLog['context'], true ); + } + }*/ + //$this->stdout(json_encode($task, JSON_UNESCAPED_UNICODE)); if (!is_array($task) || empty($task['taskName']) || $task['taskName'] !== 'apRecalculateTask') { $this->stdout("Нет задания apRecalculateTask\n"); diff --git a/erp24/views/category-plan/index.php b/erp24/views/category-plan/index.php index 9cdcc31e..214469ad 100644 --- a/erp24/views/category-plan/index.php +++ b/erp24/views/category-plan/index.php @@ -158,7 +158,7 @@ input[readonly] {
- 'btn btn-secondary'])?> + 'btn btn-secondary'])?>
@@ -170,6 +170,20 @@ input[readonly] {

store_id]?>

+
+ + 'btn btn-success m-2', + 'disabled' => true, + 'id' => 'rebuild', + 'name' => 'rebuild', + 'value' => 1, + 'data' => [ + 'confirm' => 'Вы уверены, что хотите пересчитать автопланограмму за ' + . $model->month . '.' . $model->year . ' для магазина ' . $stores[$model->store_id] . '?', + ], + ]) + ?> month && $model->year && $model->store_id) { ?> 'btn btn-danger m-2', @@ -182,22 +196,8 @@ input[readonly] { ], ]) ?> - - 'btn btn-success m-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 2e80485f..775c1b05 100644 --- a/erp24/web/js/category-plan/index.js +++ b/erp24/web/js/category-plan/index.js @@ -136,8 +136,8 @@ function updateChangesLog(store_id) { }); $('#changes-hint').remove(); - $('#changes').after('
После внесения всех изменений нажмите на кнопку\n' + - '"Пересчитать автопланограмму"
'); + $('#changes').after('
После внесения всех изменений нажмите на кнопку\n' + + '
"Пересчитать автопланограмму"
'); changesBox.html(``).hide(); changesCount.html(`Были внесены изменения (число изменений) - ${count} `); @@ -252,20 +252,17 @@ function startTaskPolling() { localStorage.removeItem('planChanges'); $('#rebuild').prop('disabled', false).text('Пересчитать автопланограмму'); $('#delete').prop('disabled', false); - if (data.status === 'done') { - $('#changes-hint').remove(); - $('#changes').hide(); - alert('Задача успешно завершена'); - } else { - alert('Задача завершилась с ошибкой: ' + (data.error || '')); - } + $('#changes-hint').remove(); + $('#changes').hide(); + alert('Персчет автопланнограммы успешно завершен'); + } if (data.status === 'error') { clearInterval(taskPollInterval); taskPollInterval = null; $('#rebuild').prop('disabled', false).text('Пересчитать автопланограмму'); $('#delete').prop('disabled', false); - alert('Задача завершилась с ошибкой: ' + (data.error || '')); + alert('Персчет автопланнограммы завершилася с ошибкой: ' + (data.error || '')); } } });