Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1372,31 +1372,35 @@ const selectedRow = computed(() => {
|
||||
=========================================================== */
|
||||
const groupOpen = reactive({})
|
||||
|
||||
function normalizeYetiskinGarsonToken (row) {
|
||||
const raw = [
|
||||
row?.yetiskinGarson,
|
||||
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, ' ')
|
||||
function normalizeSubHeaderText (v, fallback = 'GENEL') {
|
||||
const s = String(v || '')
|
||||
.replace(/\([^)]*\)/g, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
return s || fallback
|
||||
}
|
||||
|
||||
if (normalized.includes('GARSON')) return 'GARSON'
|
||||
if (normalized.includes('YETISKIN')) return 'YETISKIN'
|
||||
return 'GENEL'
|
||||
function resolveKategoriForSubHeader (row) {
|
||||
return normalizeSubHeaderText(
|
||||
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(() => {
|
||||
@@ -1410,18 +1414,16 @@ const groupedRows = computed(() => {
|
||||
: storeSchemaByKey
|
||||
|
||||
for (const row of rows) {
|
||||
const ana = (row?.urunAnaGrubu || 'GENEL')
|
||||
.toUpperCase()
|
||||
.trim()
|
||||
const yg = normalizeYetiskinGarsonToken(row)
|
||||
const ana = resolveUrunAnaGrubuForSubHeader(row)
|
||||
const kategori = resolveKategoriForSubHeader(row)
|
||||
const grpKey = String(row?.grpKey || 'tak').trim() || 'tak'
|
||||
const bucketKey = `${yg}::${ana}::${grpKey}`
|
||||
const bucketKey = `${kategori}::${ana}`
|
||||
|
||||
if (!buckets[bucketKey]) {
|
||||
buckets[bucketKey] = {
|
||||
name: ana,
|
||||
yg,
|
||||
displayName: `${yg} ${ana}`,
|
||||
kategori,
|
||||
displayName: `${kategori} ${ana}`,
|
||||
rows: [],
|
||||
toplamAdet: 0,
|
||||
toplamTutar: 0,
|
||||
@@ -1442,7 +1444,7 @@ const groupedRows = computed(() => {
|
||||
return order.map(bucketKey => {
|
||||
const grp = buckets[bucketKey]
|
||||
const schema = schemaMap?.[grp.grpKey]
|
||||
const displayName = `${grp.yg} ${grp.name}`.trim()
|
||||
const displayName = `${grp.kategori} ${grp.name}`.trim()
|
||||
|
||||
return {
|
||||
...grp,
|
||||
@@ -2287,7 +2289,9 @@ async function hydrateEditorFromRow(row, opts = {}) {
|
||||
...d,
|
||||
UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '',
|
||||
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 || '',
|
||||
YETISKIN_GARSON: d.YETISKIN_GARSON || d.YetiskinGarson || 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 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 rowAskili = row.askiliyan || row.AskiliYan || modelMeta?.AskiliYan || ''
|
||||
const rowYetiskinGarson =
|
||||
@@ -2319,7 +2323,9 @@ async function hydrateEditorFromRow(row, opts = {}) {
|
||||
const rowKategori =
|
||||
row.kategori ||
|
||||
row.Kategori ||
|
||||
row.ProductAtt44Desc ||
|
||||
modelMeta?.Kategori ||
|
||||
modelMeta?.ProductAtt44Desc ||
|
||||
''
|
||||
|
||||
/* -------------------------------------------------------
|
||||
@@ -2784,7 +2790,9 @@ async function onModelChange(modelCode) {
|
||||
ProductGroup: d.ProductGroup || d.UrunAnaGrubu || d.ProductAtt01Desc || '',
|
||||
ProductSubGroup: d.ProductSubGroup || d.UrunAltGrubu || d.ProductAtt02Desc || '',
|
||||
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]))
|
||||
}
|
||||
@@ -2799,7 +2807,7 @@ async function onModelChange(modelCode) {
|
||||
fit: d.Fit1 || d.Fit || '',
|
||||
urunIcerik: d.UrunIcerik || d.Fabric || '',
|
||||
drop: d.Drop || '',
|
||||
kategori: d.Kategori || '',
|
||||
kategori: d.Kategori || d.ProductAtt44Desc || d.YETISKIN_GARSON || d.YetiskinGarson || '',
|
||||
askiliyan: d.AskiliYan || '',
|
||||
yetiskinGarson: d.YETISKIN_GARSON || d.YetiskinGarson || d.AskiliYan || '',
|
||||
yasPayloadMap: {},
|
||||
|
||||
@@ -1050,7 +1050,9 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
...d,
|
||||
UrunAnaGrubu: d.UrunAnaGrubu || d.ProductGroup || d.ProductAtt01Desc || '',
|
||||
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 || '',
|
||||
YetiskinGarson: d.YetiskinGarson || d.YETISKIN_GARSON || d.AskiliYan || '',
|
||||
AskiliYan: d.AskiliYan || ''
|
||||
@@ -2463,8 +2465,8 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
groupedKey ||
|
||||
detectBedenGroup(
|
||||
null,
|
||||
raw.urunAnaGrubu || raw.UrunAnaGrubu || meta.UrunAnaGrubu || meta.ProductGroup || '',
|
||||
raw.kategori || raw.Kategori || meta.Kategori || '',
|
||||
raw.urunAnaGrubu || raw.UrunAnaGrubu || raw.ProductAtt01Desc || meta.UrunAnaGrubu || meta.ProductGroup || meta.ProductAtt01Desc || '',
|
||||
raw.kategori || raw.Kategori || raw.ProductAtt44Desc || meta.Kategori || meta.ProductAtt44Desc || '',
|
||||
raw.yetiskinGarson ||
|
||||
raw.YETISKIN_GARSON ||
|
||||
raw.YetiskinGarson ||
|
||||
@@ -2534,14 +2536,16 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
renk,
|
||||
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 || '',
|
||||
kategori:
|
||||
raw.Kategori ||
|
||||
raw.ProductAtt44Desc ||
|
||||
raw.YETISKIN_GARSON ||
|
||||
raw.YetiskinGarson ||
|
||||
raw.yetiskinGarson ||
|
||||
meta.Kategori ||
|
||||
meta.ProductAtt44Desc ||
|
||||
meta.YETISKIN_GARSON ||
|
||||
meta.YetiskinGarson ||
|
||||
'',
|
||||
|
||||
Reference in New Issue
Block a user