Commit de3dccbb by linjinhong

fix:【工厂端】【podcn-待发货】:播种墙打单CB类订单图片不一致#1000641

parent 017d5a98
......@@ -52,6 +52,7 @@ export interface ProductList {
variantImage?: string
podJomallUsNo?: string
podJomallCnNo?: string
thirdSkuCode?: string
previewImgs?: { sort?: string | number; title?: string; url: string }[]
}
......
......@@ -463,7 +463,18 @@ watch(
(val) => {
if (val && val.productList?.length)
val.productList.forEach((el) => {
if (!el.previewImgs) el.previewImgs = JSON.parse(el.imageAry || '[]')
if (!el.previewImgs) {
if (
el.productMark === 'custom_normal' ||
el.productMark === 'normal'
) {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = el.imageAry
? JSON.parse(el.imageAry)
: [{ url: el.variantImage }]
}
}
})
},
{ deep: true },
......@@ -492,7 +503,13 @@ const renderItemBox = (bool: boolean) => {
if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem
data?.productList?.forEach((el) => {
if (!el.previewImgs) el.previewImgs = JSON.parse(el.imageAry || '[]')
if (!el.previewImgs || !el.previewImgs.length) {
if (el.productMark === 'custom_normal' || el.productMark === 'normal') {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = JSON.parse(el.imageAry || '[]')
}
}
})
if (!data) {
renderLock = false
......@@ -513,15 +530,23 @@ const renderItemBox = (bool: boolean) => {
}
}
if (currentCode) {
const parts = currentCode.split('_')
currentCode =
parts.length > 3 && parts[3].startsWith('CNPSC')
? parts[3]
: parts.length > 1
? parts[1]
: parts[0]
if (!currentCode.startsWith('JM')) {
const parts = currentCode.split('_')
currentCode =
parts.length > 3 && parts[3].startsWith('CNPSC')
? parts[3]
: parts.length > 1
? parts[1]
: parts[0]
}
console.log(540, currentCode)
for (const product of productList) {
if (product.podJomallCnNo === currentCode) {
if (
product.podJomallCnNo === currentCode ||
product.thirdSkuCode === currentCode
) {
coverImage.value = product.previewImgs?.[0]?.url || ''
nextTick(() => {
tableRef.value?.setCurrentRow(product)
......
......@@ -424,7 +424,10 @@ watch(
if (val && val.productList?.length)
val.productList.forEach((el) => {
if (!el.previewImgs) {
if (el.productMark === 'custom_normal') {
if (
el.productMark === 'custom_normal' ||
el.productMark === 'normal'
) {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = el.imageAry
......@@ -456,11 +459,11 @@ const renderItemBox = (bool: boolean) => {
if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem
data?.productList?.forEach((el) => {
if (!el.previewImgs) {
if (!el.previewImgs || !el.previewImgs.length) {
if (el.productMark === 'custom_normal' || el.productMark === 'normal') {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = JSON.parse(el.imageAry)
el.previewImgs = JSON.parse(el.imageAry || '[]')
}
}
})
......@@ -483,15 +486,21 @@ const renderItemBox = (bool: boolean) => {
}
}
if (currentCode) {
const parts = currentCode.split('_')
currentCode =
parts.length > 3 && parts[3].startsWith('USPSC')
? parts[3]
: parts.length > 1
? parts[1]
: parts[0]
if (!currentCode.startsWith('JM')) {
const parts = currentCode.split('_')
currentCode =
parts.length > 3 && parts[3].startsWith('USPSC')
? parts[3]
: parts.length > 1
? parts[1]
: parts[0]
}
console.log(540, currentCode)
for (const product of productList) {
if (product.podJomallUsNo === currentCode) {
if (
product.podJomallUsNo === currentCode ||
product.thirdSkuCode === currentCode
) {
coverImage.value = product.previewImgs?.[0]?.url || ''
console.log(441, coverImage.value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment