Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-13 17:26:56 +03:00
parent f9a864d63c
commit d1790b7357
2 changed files with 36 additions and 12 deletions

View File

@@ -476,6 +476,15 @@ function normalizeImageDim3(value) {
return '' return ''
} }
function resolvePhotoDim3(item, secondColorDisplay = '') {
return (
normalizeImageDim3(item?.Renk2) ||
normalizeImageDim3(item?.ItemDim3Code) ||
normalizeImageDim3(secondColorDisplay) ||
''
)
}
function buildDim3Candidates(secondColor) { function buildDim3Candidates(secondColor) {
const secondTrim = normalizeImageDim3(secondColor) const secondTrim = normalizeImageDim3(secondColor)
if (!secondTrim) return [''] if (!secondTrim) return ['']
@@ -769,6 +778,7 @@ const level1Groups = computed(() => {
const colorCode = String(item.Renk_Kodu || '').trim() const colorCode = String(item.Renk_Kodu || '').trim()
const colorDesc = String(item.Renk_Aciklamasi || '').trim() const colorDesc = String(item.Renk_Aciklamasi || '').trim()
const secondColor = String(item.Yaka || '').trim() const secondColor = String(item.Yaka || '').trim()
const photoDim3 = resolvePhotoDim3(item, secondColor)
const depoKodu = String(item.Depo_Kodu || '').trim() const depoKodu = String(item.Depo_Kodu || '').trim()
const depoAdi = String(item.Depo_Adi || '').trim() const depoAdi = String(item.Depo_Adi || '').trim()
const urunAnaGrubu = String(item.URUN_ANA_GRUBU || '').trim() const urunAnaGrubu = String(item.URUN_ANA_GRUBU || '').trim()
@@ -798,13 +808,14 @@ const level1Groups = computed(() => {
} }
l1.totalQty += qty l1.totalQty += qty
const l2Key = `${colorCode}|${secondColor}` const l2Key = `${colorCode}|${secondColor}|${photoDim3}`
if (!l1.childrenMap.has(l2Key)) { if (!l1.childrenMap.has(l2Key)) {
l1.childrenMap.set(l2Key, { l1.childrenMap.set(l2Key, {
key: `L2|${productCode}|${l2Key}`, key: `L2|${productCode}|${l2Key}`,
colorCode, colorCode,
colorDesc, colorDesc,
secondColor, secondColor,
photoDim3,
urunAnaGrubu, urunAnaGrubu,
urunAltGrubu, urunAltGrubu,
urunIcerigi, urunIcerigi,
@@ -1063,7 +1074,7 @@ async function fetchStockByAttributes() {
function onLevel2Click(productCode, grp2) { function onLevel2Click(productCode, grp2) {
toggleOpen(grp2.key) toggleOpen(grp2.key)
if (isOpen(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 productCode = String(grp1?.productCode || '').trim()
const colorCode = String(grp2?.colorCode || '').trim() const colorCode = String(grp2?.colorCode || '').trim()
const secondColor = String(grp2?.secondColor || '').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 codeTrim = String(productCode || '').trim().toUpperCase()
const colorTrim = String(colorCode || '').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] : [] let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
console.info('[ProductStockByAttributes][openProductCard] request', { console.info('[ProductStockByAttributes][openProductCard] request', {
productCode, productCode,
@@ -1120,7 +1132,7 @@ async function openProductCard(grp1, grp2) {
const uniqueImages = Array.from(new Set(images)) const uniqueImages = Array.from(new Set(images))
if (!uniqueImages.length) { if (!uniqueImages.length) {
const single = getProductImageUrl(productCode, colorCode, secondColor) const single = getProductImageUrl(productCode, colorCode, photoDim3)
if (single) uniqueImages.push(single) if (single) uniqueImages.push(single)
} }

View File

@@ -469,6 +469,15 @@ function normalizeImageDim3(value) {
return '' return ''
} }
function resolvePhotoDim3(item, secondColorDisplay = '') {
return (
normalizeImageDim3(item?.Renk2) ||
normalizeImageDim3(item?.ItemDim3Code) ||
normalizeImageDim3(secondColorDisplay) ||
''
)
}
function buildDim3Candidates(secondColor) { function buildDim3Candidates(secondColor) {
const secondTrim = normalizeImageDim3(secondColor) const secondTrim = normalizeImageDim3(secondColor)
if (!secondTrim) return [''] if (!secondTrim) return ['']
@@ -750,6 +759,7 @@ const level1Groups = computed(() => {
const colorCode = String(item.Renk_Kodu || '').trim() const colorCode = String(item.Renk_Kodu || '').trim()
const colorDesc = String(item.Renk_Aciklamasi || '').trim() const colorDesc = String(item.Renk_Aciklamasi || '').trim()
const secondColor = String(item.Yaka || '').trim() const secondColor = String(item.Yaka || '').trim()
const photoDim3 = resolvePhotoDim3(item, secondColor)
const depoKodu = String(item.Depo_Kodu || '').trim() const depoKodu = String(item.Depo_Kodu || '').trim()
const depoAdi = String(item.Depo_Adi || '').trim() const depoAdi = String(item.Depo_Adi || '').trim()
const kategori = String(item.YETISKIN_GARSON || '').trim() const kategori = String(item.YETISKIN_GARSON || '').trim()
@@ -780,13 +790,14 @@ const level1Groups = computed(() => {
} }
l1.totalQty += qty l1.totalQty += qty
const l2Key = `${colorCode}|${secondColor}` const l2Key = `${colorCode}|${secondColor}|${photoDim3}`
if (!l1.childrenMap.has(l2Key)) { if (!l1.childrenMap.has(l2Key)) {
l1.childrenMap.set(l2Key, { l1.childrenMap.set(l2Key, {
key: `L2|${productCode}|${l2Key}`, key: `L2|${productCode}|${l2Key}`,
colorCode, colorCode,
colorDesc, colorDesc,
secondColor, secondColor,
photoDim3,
kategori, kategori,
urunAnaGrubu, urunAnaGrubu,
urunAltGrubu, urunAltGrubu,
@@ -935,7 +946,7 @@ async function fetchStockByCode() {
function onLevel2Click(productCode, grp2) { function onLevel2Click(productCode, grp2) {
toggleOpen(grp2.key) toggleOpen(grp2.key)
if (isOpen(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 productCode = String(grp1?.productCode || '').trim()
const colorCode = String(grp2?.colorCode || '').trim() const colorCode = String(grp2?.colorCode || '').trim()
const secondColor = String(grp2?.secondColor || '').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 codeTrim = String(productCode || '').trim().toUpperCase()
const colorTrim = String(colorCode || '').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] : [] let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
console.info('[ProductStockQuery][openProductCard] request', { console.info('[ProductStockQuery][openProductCard] request', {
productCode, productCode,
@@ -992,7 +1004,7 @@ async function openProductCard(grp1, grp2) {
const uniqueImages = Array.from(new Set(images)) const uniqueImages = Array.from(new Set(images))
if (!uniqueImages.length) { if (!uniqueImages.length) {
const single = getProductImageUrl(productCode, colorCode, secondColor) const single = getProductImageUrl(productCode, colorCode, photoDim3)
if (single) uniqueImages.push(single) if (single) uniqueImages.push(single)
} }