add product sku
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in config.itemList || []"
|
||||
:title="item.productNameSnapshot"
|
||||
:key="item.id || `${item.productId}-${item.productUnitId}`"
|
||||
:title="getItemTitle(item)"
|
||||
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
|
||||
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
|
||||
>
|
||||
<template #leftIcon>
|
||||
@@ -50,7 +50,7 @@
|
||||
</template>
|
||||
<template #description>
|
||||
<t-tag
|
||||
:content="getProductTypeText(item.product?.productType)"
|
||||
:content="item.skuCodeSnapshot || item.sku?.code || 'SKU'"
|
||||
theme="primary"
|
||||
variant="light"
|
||||
/>
|
||||
@@ -89,7 +89,7 @@ import { getErrorMessage } from "@/utils/error";
|
||||
import { formatPackageAmount, getPackageConfigStatusText } from "@/utils/package";
|
||||
import { Message } from "@/utils/message";
|
||||
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
import { getProductPhotoURL as getProductPhotoUrl, getProductTypeText } from "@/utils/product";
|
||||
import { getProductPhotoURL as getProductPhotoUrl } from "@/utils/product";
|
||||
|
||||
defineOptions({ name: "PackageConfigDetail" });
|
||||
|
||||
@@ -113,7 +113,12 @@ function getStatusTheme(status?: PackageConfigStatus): "success" | "warning" | "
|
||||
}
|
||||
|
||||
function getItemPhotoURL(item: PackageConfigItem): string {
|
||||
return getProductPhotoUrl(item.product || {});
|
||||
return getProductPhotoUrl(item.sku || {});
|
||||
}
|
||||
|
||||
function getItemTitle(item: PackageConfigItem): string {
|
||||
const skuText = item.skuNameSnapshot || item.specSummarySnapshot;
|
||||
return `${item.productNameSnapshot || "未命名产品"}${skuText ? ` · ${skuText}` : ""}`;
|
||||
}
|
||||
|
||||
async function loadData(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user