Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user