From 99ba79df92ee51a1b95dee9247aeb13c8bf313cd Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Sun, 30 Aug 2026 23:04:34 +0300 Subject: [PATCH] Fix product performance grouped JSON build --- .../ProductionProductCostingHasCostDetail.vue | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/ui/src/pages/ProductionProductCostingHasCostDetail.vue b/ui/src/pages/ProductionProductCostingHasCostDetail.vue index 0303e3f..3e175fd 100644 --- a/ui/src/pages/ProductionProductCostingHasCostDetail.vue +++ b/ui/src/pages/ProductionProductCostingHasCostDetail.vue @@ -5256,6 +5256,27 @@ function scrollToFirstRequiredAttentionRow () { } async function saveChanges () { + if (!detailHeader.value) { + $q.dialog({ + title: 'Kayit Yapilamadi', + message: 'Maliyet baslik bilgisi bulunamadi.', + ok: { label: 'Tamam', color: 'primary' }, + persistent: true + }) + return + } + + const selectedUretimSekliID = parseInt(String(detailHeader.value?.UretimSekliID || '0').trim() || '0', 10) || 0 + if (!(selectedUretimSekliID > 0)) { + $q.dialog({ + title: 'Uretim Sekli Zorunlu', + message: 'Kaydetmeden once Uretim Sekli alanini secmelisiniz.', + ok: { label: 'Tamam', color: 'warning', textColor: 'black' }, + persistent: true + }) + return + } + saveLoading.value = true try { requiredAttentionRowKeys.value = {} @@ -5346,22 +5367,6 @@ async function saveChanges () { const okBrPrice = await confirmBrPriceDeviationIfNeeded() if (!okBrPrice) return - if (!detailHeader.value) { - $q.notify({ type: 'negative', message: 'Header bulunamadi.', position: 'top-right' }) - return - } - - // Validate required header fields - const selectedUretimSekliID = parseInt(String(detailHeader.value?.UretimSekliID || '0').trim() || '0', 10) || 0 - if (!(selectedUretimSekliID > 0)) { - $q.notify({ - type: 'warning', - message: 'Uretim Sekli secilmeden kayit yapilamaz.', - position: 'top-right' - }) - return - } - // Validate: "Kod" (sKodu) is mandatory for any row that has a hammadde type. // We block saving if there are rows with empty/whitespace code, to avoid sending blank rows to backend. const blankCodeRows = (Array.isArray(flatDetailRows.value) ? flatDetailRows.value : [])