add product sku
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<strong v-text="item.productNameSnapshot" />
|
||||
<strong v-text="getItemTitle(item)" />
|
||||
<span v-text="getItemDescription(item)" />
|
||||
</div>
|
||||
<div class="input">
|
||||
@@ -140,7 +140,12 @@ function getAvailableQuantity(item: GaoSalesOrderItem): string {
|
||||
}
|
||||
|
||||
function getItemDescription(item: GaoSalesOrderItem): string {
|
||||
return ` · 剩余 ${getAvailableQuantity(item)}`;
|
||||
return ` · ${item.unitSnapshot || "业务单位"} · 剩余 ${getAvailableQuantity(item)}`;
|
||||
}
|
||||
|
||||
function getItemTitle(item: GaoSalesOrderItem): string {
|
||||
const skuText = item.skuNameSnapshot || item.specSummarySnapshot;
|
||||
return `${item.productNameSnapshot || "未命名产品"}${skuText ? ` · ${skuText}` : ""}`;
|
||||
}
|
||||
|
||||
function fillAllQuantity(item: GaoSalesOrderItem): void {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
class="item"
|
||||
v-for="item in fulfillment.itemList || []"
|
||||
:key="item.id"
|
||||
:title="item.productNameSnapshot"
|
||||
:title="getItemTitle(item)"
|
||||
:description="`${item.quantity} ${item.unitSnapshot}`"
|
||||
:note="`待履约 ${item.reservedBefore || 0} → ${item.reservedAfter || 0}`"
|
||||
>
|
||||
@@ -174,6 +174,11 @@ const sourceItemType = computed<GaoSalesOrderItemType | undefined>(() => {
|
||||
const sourceOrderItemId = fulfillment.value?.itemList?.[0]?.sourceOrderItemId;
|
||||
return order.value?.itemList?.find(item => item.id === sourceOrderItemId)?.itemType;
|
||||
});
|
||||
|
||||
function getItemTitle(item: NonNullable<OrderFulfillment["itemList"]>[number]): string {
|
||||
const skuText = item.skuNameSnapshot || item.specSummarySnapshot;
|
||||
return `${item.productNameSnapshot || "未命名产品"}${skuText ? ` · ${skuText}` : ""}`;
|
||||
}
|
||||
async function loadData(): Promise<void> {
|
||||
const id = String(route.params.id || "");
|
||||
if (!id) return;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="items">
|
||||
<t-tag
|
||||
v-for="(item, index) in itemList"
|
||||
:key="item.id || `${item.productId}-${index}`"
|
||||
:key="item.id || `${item.skuId}-${item.skuUnitId}-${index}`"
|
||||
:content="getProductText(item)"
|
||||
theme="primary"
|
||||
variant="light"
|
||||
@@ -101,9 +101,10 @@ const productSummaryText = computed(() => `共 ${itemList.value.length} 项 ·
|
||||
|
||||
function getProductText(item: OrderFulfillmentItem): string {
|
||||
const productName = item.productNameSnapshot || "未命名产品";
|
||||
const skuText = item.skuNameSnapshot || item.specSummarySnapshot;
|
||||
const quantity = getPackageQuantityText(item.quantity);
|
||||
const unit = item.unitSnapshot ? ` ${item.unitSnapshot}` : "";
|
||||
return `${productName} × ${quantity}${unit}`;
|
||||
return `${productName}${skuText ? ` · ${skuText}` : ""} × ${quantity}${unit}`;
|
||||
}
|
||||
|
||||
function getUserName(user: OrderFulfillment["operator"], userId: string | undefined, fallback: string): string {
|
||||
|
||||
Reference in New Issue
Block a user