From d1790b7357e90520c45df66d3b653a1f338511d1 Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Fri, 13 Mar 2026 17:26:56 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ui/src/pages/ProductStockByAttributes.vue | 24 +++++++++++++++++------ ui/src/pages/ProductStockQuery.vue | 24 +++++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/ui/src/pages/ProductStockByAttributes.vue b/ui/src/pages/ProductStockByAttributes.vue index 68d8d90..8a51afe 100644 --- a/ui/src/pages/ProductStockByAttributes.vue +++ b/ui/src/pages/ProductStockByAttributes.vue @@ -476,6 +476,15 @@ function normalizeImageDim3(value) { return '' } +function resolvePhotoDim3(item, secondColorDisplay = '') { + return ( + normalizeImageDim3(item?.Renk2) || + normalizeImageDim3(item?.ItemDim3Code) || + normalizeImageDim3(secondColorDisplay) || + '' + ) +} + function buildDim3Candidates(secondColor) { const secondTrim = normalizeImageDim3(secondColor) if (!secondTrim) return [''] @@ -769,6 +778,7 @@ const level1Groups = computed(() => { const colorCode = String(item.Renk_Kodu || '').trim() const colorDesc = String(item.Renk_Aciklamasi || '').trim() const secondColor = String(item.Yaka || '').trim() + const photoDim3 = resolvePhotoDim3(item, secondColor) const depoKodu = String(item.Depo_Kodu || '').trim() const depoAdi = String(item.Depo_Adi || '').trim() const urunAnaGrubu = String(item.URUN_ANA_GRUBU || '').trim() @@ -798,13 +808,14 @@ const level1Groups = computed(() => { } l1.totalQty += qty - const l2Key = `${colorCode}|${secondColor}` + const l2Key = `${colorCode}|${secondColor}|${photoDim3}` if (!l1.childrenMap.has(l2Key)) { l1.childrenMap.set(l2Key, { key: `L2|${productCode}|${l2Key}`, colorCode, colorDesc, secondColor, + photoDim3, urunAnaGrubu, urunAltGrubu, urunIcerigi, @@ -1063,7 +1074,7 @@ async function fetchStockByAttributes() { function onLevel2Click(productCode, grp2) { toggleOpen(grp2.key) if (isOpen(grp2.key)) { - void ensureProductImage(productCode, grp2.colorCode, grp2.secondColor) + void ensureProductImage(productCode, grp2.colorCode, grp2.photoDim3 || grp2.secondColor) } } @@ -1071,12 +1082,13 @@ async function openProductCard(grp1, grp2) { const productCode = String(grp1?.productCode || '').trim() const colorCode = String(grp2?.colorCode || '').trim() const secondColor = String(grp2?.secondColor || '').trim() - const listKey = buildImageKey(productCode, colorCode, secondColor) + const photoDim3 = String(grp2?.photoDim3 || secondColor).trim() + const listKey = buildImageKey(productCode, colorCode, photoDim3) const codeTrim = String(productCode || '').trim().toUpperCase() const colorTrim = String(colorCode || '').trim().toUpperCase() - const secondTrim = String(secondColor || '').trim().toUpperCase() + const secondTrim = String(photoDim3 || '').trim().toUpperCase() - await ensureProductImage(productCode, colorCode, secondColor) + await ensureProductImage(productCode, colorCode, photoDim3) let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : [] console.info('[ProductStockByAttributes][openProductCard] request', { productCode, @@ -1120,7 +1132,7 @@ async function openProductCard(grp1, grp2) { const uniqueImages = Array.from(new Set(images)) if (!uniqueImages.length) { - const single = getProductImageUrl(productCode, colorCode, secondColor) + const single = getProductImageUrl(productCode, colorCode, photoDim3) if (single) uniqueImages.push(single) } diff --git a/ui/src/pages/ProductStockQuery.vue b/ui/src/pages/ProductStockQuery.vue index c51164d..b323f4c 100644 --- a/ui/src/pages/ProductStockQuery.vue +++ b/ui/src/pages/ProductStockQuery.vue @@ -469,6 +469,15 @@ function normalizeImageDim3(value) { return '' } +function resolvePhotoDim3(item, secondColorDisplay = '') { + return ( + normalizeImageDim3(item?.Renk2) || + normalizeImageDim3(item?.ItemDim3Code) || + normalizeImageDim3(secondColorDisplay) || + '' + ) +} + function buildDim3Candidates(secondColor) { const secondTrim = normalizeImageDim3(secondColor) if (!secondTrim) return [''] @@ -750,6 +759,7 @@ const level1Groups = computed(() => { const colorCode = String(item.Renk_Kodu || '').trim() const colorDesc = String(item.Renk_Aciklamasi || '').trim() const secondColor = String(item.Yaka || '').trim() + const photoDim3 = resolvePhotoDim3(item, secondColor) const depoKodu = String(item.Depo_Kodu || '').trim() const depoAdi = String(item.Depo_Adi || '').trim() const kategori = String(item.YETISKIN_GARSON || '').trim() @@ -780,13 +790,14 @@ const level1Groups = computed(() => { } l1.totalQty += qty - const l2Key = `${colorCode}|${secondColor}` + const l2Key = `${colorCode}|${secondColor}|${photoDim3}` if (!l1.childrenMap.has(l2Key)) { l1.childrenMap.set(l2Key, { key: `L2|${productCode}|${l2Key}`, colorCode, colorDesc, secondColor, + photoDim3, kategori, urunAnaGrubu, urunAltGrubu, @@ -935,7 +946,7 @@ async function fetchStockByCode() { function onLevel2Click(productCode, grp2) { toggleOpen(grp2.key) if (isOpen(grp2.key)) { - void ensureProductImage(productCode, grp2.colorCode, grp2.secondColor) + void ensureProductImage(productCode, grp2.colorCode, grp2.photoDim3 || grp2.secondColor) } } @@ -943,12 +954,13 @@ async function openProductCard(grp1, grp2) { const productCode = String(grp1?.productCode || '').trim() const colorCode = String(grp2?.colorCode || '').trim() const secondColor = String(grp2?.secondColor || '').trim() - const listKey = buildImageKey(productCode, colorCode, secondColor) + const photoDim3 = String(grp2?.photoDim3 || secondColor).trim() + const listKey = buildImageKey(productCode, colorCode, photoDim3) const codeTrim = String(productCode || '').trim().toUpperCase() const colorTrim = String(colorCode || '').trim().toUpperCase() - const secondTrim = String(secondColor || '').trim().toUpperCase() + const secondTrim = String(photoDim3 || '').trim().toUpperCase() - await ensureProductImage(productCode, colorCode, secondColor) + await ensureProductImage(productCode, colorCode, photoDim3) let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : [] console.info('[ProductStockQuery][openProductCard] request', { productCode, @@ -992,7 +1004,7 @@ async function openProductCard(grp1, grp2) { const uniqueImages = Array.from(new Set(images)) if (!uniqueImages.length) { - const single = getProductImageUrl(productCode, colorCode, secondColor) + const single = getProductImageUrl(productCode, colorCode, photoDim3) if (single) uniqueImages.push(single) }