Fix product performance grouped JSON build

This commit is contained in:
M_Kececi
2026-08-30 23:04:49 +03:00
parent a8eac2d96b
commit 99ba79df92
@@ -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 : [])