Интегрирован wesp в сайт
CI / quality (push) Canceled after 0s

This commit is contained in:
влад
2026-07-17 12:57:18 +03:00
parent 5dfa06ddbe
commit 355c0ef9f1
883 changed files with 194576 additions and 177 deletions
+26 -2
View File
@@ -4789,15 +4789,19 @@
return;
}
// Для кормоцеха: добавляем target_component_id
// Для кормоцеха: добавляем target_component_id и привязку к кормоцеху
if (currentDispenserType === 'mill') {
const targetComponentSelect = document.getElementById('targetComponentSelect');
if (targetComponentSelect) {
recipeData.target_component_id = targetComponentSelect.value || null;
}
if (selectedDispenser) {
recipeData.dispenser_id = selectedDispenser;
}
}
let url, method;
const wasCreate = !selectedRecipe;
if (selectedRecipe) {
url = `/api/recipes/${selectedRecipe}`;
method = 'PUT';
@@ -4825,10 +4829,23 @@
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
throw new Error(errorData.message || 'Ошибка при сохранении рейса');
const detail = errorData.message || errorData.detail;
let message = 'Ошибка при сохранении рейса';
if (typeof detail === 'string') {
if (response.status === 401) {
message = 'Сессия истекла. Войдите снова.';
} else {
message = detail;
}
}
throw new Error(message);
}
const result = await response.json();
if (wasCreate && result && result.id) {
selectedRecipe = result.id;
pageState.set({ selectedRecipe });
}
const savedRecipeName = document.getElementById('recipeName')?.value?.trim();
notyf.success('Сохранено', {
record: savedRecipeName ? { recipeName: savedRecipeName } : undefined,
@@ -5055,6 +5072,13 @@
showRecipeEdit,
loadRecipes,
loadPeriods,
selectPeriod,
persistRecipe: (closeAfterSave) => doSaveRecipe(!!closeAfterSave),
toggleUnloadingBlocks: () => recipesEditorController.toggleUnloadingBlocks(),
resetDeletedEntities: () => {
deletedIngredientIds = [];
deletedGroupIds = [];
},
ensureComponentsLoaded: async () => {
if (!componentsCache) {
await loadComponents();