Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-31 13:28:32 +03:00
parent 2b40983cee
commit ee9150e45a
2 changed files with 50 additions and 38 deletions

View File

@@ -1372,31 +1372,35 @@ const selectedRow = computed(() => {
=========================================================== */ =========================================================== */
const groupOpen = reactive({}) const groupOpen = reactive({})
function normalizeYetiskinGarsonToken (row) { function normalizeSubHeaderText (v, fallback = 'GENEL') {
const raw = [ const s = String(v || '')
row?.yetiskinGarson, .replace(/\([^)]*\)/g, ' ')
row?.YETISKIN_GARSON,
row?.YetiskinGarson,
row?.askiliyan,
row?.AskiliYan,
row?.kategori,
row?.Kategori
]
.map(v => String(v || '').trim())
.filter(Boolean)
.join(' ')
const normalized = raw
.toUpperCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/[^A-Z0-9/ ]+/g, ' ')
.replace(/\s+/g, ' ') .replace(/\s+/g, ' ')
.trim() .trim()
return s || fallback
}
if (normalized.includes('GARSON')) return 'GARSON' function resolveKategoriForSubHeader (row) {
if (normalized.includes('YETISKIN')) return 'YETISKIN' return normalizeSubHeaderText(
return 'GENEL' row?.kategori ||
row?.Kategori ||
row?.ProductAtt44Desc ||
row?.YETISKIN_GARSON ||
row?.yetiskinGarson ||
row?.YetiskinGarson ||
'',
'GENEL'
)
}
function resolveUrunAnaGrubuForSubHeader (row) {
return normalizeSubHeaderText(
row?.urunAnaGrubu ||
row?.UrunAnaGrubu ||
row?.ProductAtt01Desc ||
'',
'GENEL'
).toUpperCase()
} }
const groupedRows = computed(() => { const groupedRows = computed(() => {
@@ -1410,18 +1414,16 @@ const groupedRows = computed(() => {
: storeSchemaByKey : storeSchemaByKey
for (const row of rows) { for (const row of rows) {
const ana = (row?.urunAnaGrubu || 'GENEL') const ana = resolveUrunAnaGrubuForSubHeader(row)
.toUpperCase() const kategori = resolveKategoriForSubHeader(row)
.trim()
const yg = normalizeYetiskinGarsonToken(row)
const grpKey = String(row?.grpKey || 'tak').trim() || 'tak' const grpKey = String(row?.grpKey || 'tak').trim() || 'tak'
const bucketKey = `${yg}::${ana}::${grpKey}` const bucketKey = `${kategori}::${ana}`
if (!buckets[bucketKey]) { if (!buckets[bucketKey]) {
buckets[bucketKey] = { buckets[bucketKey] = {
name: ana, name: ana,
yg, kategori,
displayName: `${yg} ${ana}`, displayName: `${kategori} ${ana}`,
rows: [], rows: [],
toplamAdet: 0, toplamAdet: 0,
toplamTutar: 0, toplamTutar: 0,
@@ -1442,7 +1444,7 @@ const groupedRows = computed(() => {
return order.map(bucketKey => { return order.map(bucketKey => {
const grp = buckets[bucketKey] const grp = buckets[bucketKey]
const schema = schemaMap?.[grp.grpKey] const schema = schemaMap?.[grp.grpKey]
const displayName = `${grp.yg} ${grp.name}`.trim() const displayName = `${grp.kategori} ${grp.name}`.trim()
return { return {
...grp, ...grp,
@@ -2287,7 +2289,9 @@ async function hydrateEditorFromRow(row, opts = {}) {
...d, ...d,
UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '', UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '',
UrunAltGrubu: d.UrunAltGrubu || d.ProductSubGroup || d.ProductAtt02Desc || '', UrunAltGrubu: d.UrunAltGrubu || d.ProductSubGroup || d.ProductAtt02Desc || '',
Kategori: d.Kategori || '', Kategori: d.Kategori || d.ProductAtt44Desc || d.YETISKIN_GARSON || d.YetiskinGarson || '',
ProductAtt01Desc: d.ProductAtt01Desc || d.UrunAnaGrubu || d.ProductGroup || '',
ProductAtt44Desc: d.ProductAtt44Desc || d.Kategori || d.YETISKIN_GARSON || d.YetiskinGarson || '',
AskiliYan: d.AskiliYan || '', AskiliYan: d.AskiliYan || '',
YETISKIN_GARSON: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '', YETISKIN_GARSON: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '',
YetiskinGarson: d.YetiskinGarson || d.YETISKIN_GARSON || d.AskiliYan || '', YetiskinGarson: d.YetiskinGarson || d.YETISKIN_GARSON || d.AskiliYan || '',
@@ -2305,7 +2309,7 @@ async function hydrateEditorFromRow(row, opts = {}) {
} }
const modelMeta = await ensureModelDetail(row.model) const modelMeta = await ensureModelDetail(row.model)
const rowUrunAna = row.urunAnaGrubu || row.UrunAnaGrubu || modelMeta?.UrunAnaGrubu || '' const rowUrunAna = row.urunAnaGrubu || row.UrunAnaGrubu || row.ProductAtt01Desc || modelMeta?.UrunAnaGrubu || modelMeta?.ProductAtt01Desc || ''
const rowUrunAlt = row.urunAltGrubu || row.UrunAltGrubu || modelMeta?.UrunAltGrubu || '' const rowUrunAlt = row.urunAltGrubu || row.UrunAltGrubu || modelMeta?.UrunAltGrubu || ''
const rowAskili = row.askiliyan || row.AskiliYan || modelMeta?.AskiliYan || '' const rowAskili = row.askiliyan || row.AskiliYan || modelMeta?.AskiliYan || ''
const rowYetiskinGarson = const rowYetiskinGarson =
@@ -2319,7 +2323,9 @@ async function hydrateEditorFromRow(row, opts = {}) {
const rowKategori = const rowKategori =
row.kategori || row.kategori ||
row.Kategori || row.Kategori ||
row.ProductAtt44Desc ||
modelMeta?.Kategori || modelMeta?.Kategori ||
modelMeta?.ProductAtt44Desc ||
'' ''
/* ------------------------------------------------------- /* -------------------------------------------------------
@@ -2784,7 +2790,9 @@ async function onModelChange(modelCode) {
ProductGroup: d.ProductGroup || d.UrunAnaGrubu || d.ProductAtt01Desc || '', ProductGroup: d.ProductGroup || d.UrunAnaGrubu || d.ProductAtt01Desc || '',
ProductSubGroup: d.ProductSubGroup || d.UrunAltGrubu || d.ProductAtt02Desc || '', ProductSubGroup: d.ProductSubGroup || d.UrunAltGrubu || d.ProductAtt02Desc || '',
URUN_ANA_GRUBU: d.UrunAnaGrubu || d.ProductAtt01Desc || '', URUN_ANA_GRUBU: d.UrunAnaGrubu || d.ProductAtt01Desc || '',
URUN_ALT_GRUBU: d.UrunAltGrubu || d.ProductAtt02Desc || '' URUN_ALT_GRUBU: d.UrunAltGrubu || d.ProductAtt02Desc || '',
ProductAtt01Desc: d.ProductAtt01Desc || d.UrunAnaGrubu || d.ProductGroup || '',
ProductAtt44Desc: d.ProductAtt44Desc || d.Kategori || d.YETISKIN_GARSON || d.YetiskinGarson || ''
} }
console.log('🗂️ Cache eklendi:', modelCode, Object.keys(productCache[modelCode])) console.log('🗂️ Cache eklendi:', modelCode, Object.keys(productCache[modelCode]))
} }
@@ -2799,7 +2807,7 @@ async function onModelChange(modelCode) {
fit: d.Fit1 || d.Fit || '', fit: d.Fit1 || d.Fit || '',
urunIcerik: d.UrunIcerik || d.Fabric || '', urunIcerik: d.UrunIcerik || d.Fabric || '',
drop: d.Drop || '', drop: d.Drop || '',
kategori: d.Kategori || '', kategori: d.Kategori || d.ProductAtt44Desc || d.YETISKIN_GARSON || d.YetiskinGarson || '',
askiliyan: d.AskiliYan || '', askiliyan: d.AskiliYan || '',
yetiskinGarson: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '', yetiskinGarson: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '',
yasPayloadMap: {}, yasPayloadMap: {},

View File

@@ -1050,7 +1050,9 @@ export const useOrderEntryStore = defineStore('orderentry', {
...d, ...d,
UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '', UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '',
UrunAltGrubu: d.UrunAltGrubu || d.ProductSubGroup || d.ProductAtt02Desc || '', UrunAltGrubu: d.UrunAltGrubu || d.ProductSubGroup || d.ProductAtt02Desc || '',
Kategori: d.Kategori || '', Kategori: d.Kategori || d.ProductAtt44Desc || d.YETISKIN_GARSON || d.YetiskinGarson || '',
ProductAtt01Desc: d.ProductAtt01Desc || d.UrunAnaGrubu || d.ProductGroup || '',
ProductAtt44Desc: d.ProductAtt44Desc || d.Kategori || d.YETISKIN_GARSON || d.YetiskinGarson || '',
YETISKIN_GARSON: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '', YETISKIN_GARSON: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '',
YetiskinGarson: d.YetiskinGarson || d.YETISKIN_GARSON || d.AskiliYan || '', YetiskinGarson: d.YetiskinGarson || d.YETISKIN_GARSON || d.AskiliYan || '',
AskiliYan: d.AskiliYan || '' AskiliYan: d.AskiliYan || ''
@@ -2463,8 +2465,8 @@ export const useOrderEntryStore = defineStore('orderentry', {
groupedKey || groupedKey ||
detectBedenGroup( detectBedenGroup(
null, null,
raw.urunAnaGrubu || raw.UrunAnaGrubu || meta.UrunAnaGrubu || meta.ProductGroup || '', raw.urunAnaGrubu || raw.UrunAnaGrubu || raw.ProductAtt01Desc || meta.UrunAnaGrubu || meta.ProductGroup || meta.ProductAtt01Desc || '',
raw.kategori || raw.Kategori || meta.Kategori || '', raw.kategori || raw.Kategori || raw.ProductAtt44Desc || meta.Kategori || meta.ProductAtt44Desc || '',
raw.yetiskinGarson || raw.yetiskinGarson ||
raw.YETISKIN_GARSON || raw.YETISKIN_GARSON ||
raw.YetiskinGarson || raw.YetiskinGarson ||
@@ -2534,14 +2536,16 @@ export const useOrderEntryStore = defineStore('orderentry', {
renk, renk,
renk2, renk2,
urunAnaGrubu: raw.UrunAnaGrubu || meta.UrunAnaGrubu || meta.ProductGroup || 'GENEL', urunAnaGrubu: raw.UrunAnaGrubu || raw.ProductAtt01Desc || meta.UrunAnaGrubu || meta.ProductGroup || meta.ProductAtt01Desc || 'GENEL',
urunAltGrubu: raw.UrunAltGrubu || meta.UrunAltGrubu || meta.ProductSubGroup || '', urunAltGrubu: raw.UrunAltGrubu || meta.UrunAltGrubu || meta.ProductSubGroup || '',
kategori: kategori:
raw.Kategori || raw.Kategori ||
raw.ProductAtt44Desc ||
raw.YETISKIN_GARSON || raw.YETISKIN_GARSON ||
raw.YetiskinGarson || raw.YetiskinGarson ||
raw.yetiskinGarson || raw.yetiskinGarson ||
meta.Kategori || meta.Kategori ||
meta.ProductAtt44Desc ||
meta.YETISKIN_GARSON || meta.YETISKIN_GARSON ||
meta.YetiskinGarson || meta.YetiskinGarson ||
'', '',