Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-29 22:41:02 +03:00
parent 96ede55936
commit 05c6103a3a
10 changed files with 629 additions and 92 deletions

View File

@@ -835,6 +835,7 @@ const $q = useQuasar()
const orderStore = useOrderEntryStore()
const orderentryStore = useOrderEntryStore()
orderStore.initSchemaMap()
void orderStore.ensureProductSizeMatchRules()
const schemaSource = computed(() =>
Object.keys(orderStore?.schemaMap || {}).length
@@ -1777,6 +1778,7 @@ watch(() => orderStore.replaceRouteSignal, async (id) => {
/* -------------------- LIFECYCLE -------------------- */
onMounted(async () => {
await orderStore.ensureProductSizeMatchRules()
await nextTick()
/* ---------------- UI ---------------- */
@@ -2671,17 +2673,16 @@ async function onModelChange(modelCode) {
})
/* =======================================================
🔑 BEDEN GRUBU — TEK VE KESİN KARAR
- ÖNCE detectBedenGroup (accent/garson/yas kurallarını içerir)
- Sonra güvenli fallback
🔑 BEDEN GRUBU — TEK VE KESİN KARAR (SQL kural tabanı)
======================================================= */
let bedenGrpKey = null
try {
bedenGrpKey = detectBedenGroup(
null,
form.urunAnaGrubu,
form.kategori || form.urunAltGrubu,
form.yetiskinGarson || form.askiliyan
form.kategori || '',
form.yetiskinGarson || form.askiliyan,
form.urunAltGrubu || ''
)
} catch (e) {
console.warn('⚠️ detectBedenGroup hata:', e)
@@ -2689,42 +2690,13 @@ async function onModelChange(modelCode) {
}
if (!bedenGrpKey) {
const anaNRaw = String(form.urunAnaGrubu || '')
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.trim()
const katN = String(form.kategori || form.urunAltGrubu || '')
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.trim()
const ygN = String(form.yetiskinGarson || form.askiliyan || '')
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.trim()
const anaN =
(katN.includes('yetiskin') && anaNRaw.includes('gomlek klasik'))
? anaNRaw.replace('gomlek klasik', 'gomlek ata yaka')
: anaNRaw
const hasGarsonMeta =
anaN.includes('garson') ||
katN.includes('garson') ||
katN.includes('yetiskin/garson') ||
ygN.includes('garson') ||
ygN.includes('yetiskin/garson')
if (hasGarsonMeta) bedenGrpKey = 'yas'
else if (anaN.includes('pantolon') || katN.includes('pantolon')) bedenGrpKey = 'pan'
else if (anaN.includes('gomlek') || katN.includes('gomlek')) bedenGrpKey = 'gom'
else if (anaN.includes('ayakkabi') || katN.includes('ayakkabi')) bedenGrpKey = 'ayk'
$q.notify({
type: 'negative',
message: 'Beden grubu eşleşmesi bulunamadı (kategori/ana grup/alt grup).'
})
return
}
// ✅ Son fallback
if (!bedenGrpKey) bedenGrpKey = 'tak'
form.grpKey = bedenGrpKey
console.log('🧭 Editor grpKey set edildi →', bedenGrpKey)
// ✅ Editor bedenleri hemen aç (UI seed) — schemaMap tek kaynak