From 56d524ab5733ed07ce634eb9e72f077f1fd9330e Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Fri, 26 Jul 2024 14:51:06 +0300 Subject: [PATCH] =?utf8?q?=D0=9E=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=20=D0=B1=D0=BE=D0=BB=D1=8C?= =?utf8?q?=D1=88=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 10 ++++++++++ erp24/web/js/motivation/index.js | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index a6aa1e25..4ae4d284 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -28,8 +28,18 @@ class MotivationService foreach ($spreadSheetRow->getCellIterator() as $spreadSheetRowCell) { $value = $spreadSheetRowCell->getValue(); $row []= $value; + if ($row[0] == '###') { + break; + } + } + if ($row[0] == '###') { + break; } if ($storeStr) { + if (!is_int($row[0] ?? -1)) { + $error = "Индекс магазина не корректен [0,0] '" . $row[0] . "'"; + break; + } $store = CityStore::find()->where(['id' => $row[0] ?? -1])->one(); if (!$store) { $error = "Не найден магазин с таким индексом [0,0]"; diff --git a/erp24/web/js/motivation/index.js b/erp24/web/js/motivation/index.js index 4522c800..bc37ef85 100644 --- a/erp24/web/js/motivation/index.js +++ b/erp24/web/js/motivation/index.js @@ -18,6 +18,10 @@ function openUploadDictionary(showDownloadLink) { const info = $modalBody.find('#infoModal').get(0); const form = $modalBody.find('form').get(0); async function UploadDict() { + if (browse.files[0].size > 200000) { + info.innerHTML = 'Некорректный файл. Загрузите файл, заполненный по шаблону.'; + return; + } const formData = new FormData(form); formData.append(param10, token10); try { -- 2.39.5