hidden product/sku code

This commit is contained in:
Timi
2026-09-21 14:55:35 +08:00
parent 8dc5ab2b54
commit 2fed94a25c
5 changed files with 45 additions and 42 deletions
+40 -20
View File
@@ -28,8 +28,9 @@
@click="viewStock"
/>
</t-cell-group>
<t-cell-group title="SKU 列表" theme="card" class="units" v-entrance-transition="210">
<t-cell-group title="SKU 列表" theme="card" class="skus" v-entrance-transition="210">
<t-cell
class="sku"
v-for="sku in product.skuList || []"
:key="sku.id || sku.code"
role="button"
@@ -38,14 +39,18 @@
hover
@click="openSkuDetail(sku)"
>
<template #leftIcon>
<t-image
v-if="getProductPhotoURL(sku)"
:src="getProductPhotoURL(sku)"
:alt="getSkuTitle(sku)"
fit="cover"
class="avatar"
/>
<div v-else class="avatar fallback" v-text="getSkuTitle(sku).slice(0, 1)" />
</template>
<template #title>
<div class="title">
<t-tag
class="code"
size="small"
variant="light"
:content="sku.code || '无编码'"
/>
<h5 class="name" v-text="getSkuTitle(sku)" />
</div>
</template>
@@ -162,7 +167,13 @@ import type { PhotoItem } from "@/types/Photo";
import type { Product, ProductSku, ProductSkuUnit } from "@/types/Product";
import { getAttachmentReadURL } from "@/utils/attachment";
import { getErrorMessage } from "@/utils/error";
import { formatProductAmount, getProductQuantityText, getProductSkuSpecEntries, getProductStatusText } from "@/utils/product";
import {
formatProductAmount,
getProductPhotoURL,
getProductQuantityText,
getProductSkuSpecEntries,
getProductStatusText
} from "@/utils/product";
import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission";
import { Text } from "timi-web";
@@ -317,22 +328,31 @@ onUnmounted(() => navBarStore.clearRight());
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
flex-direction: column;
.units {
.skus {
.title {
gap: .5rem;
display: flex;
align-items: center;
.sku {
padding: 10px;
.name {
margin: 0;
.avatar {
width: 3.5rem;
height: 3.5rem;
}
}
.tags {
gap: .5rem;
display: flex;
flex-wrap: wrap;
.title {
gap: .5rem;
display: flex;
align-items: center;
.name {
margin: 0;
}
}
.tags {
gap: .5rem;
display: flex;
flex-wrap: wrap;
}
}
}
}
-5
View File
@@ -68,11 +68,6 @@
</template>
<template #description>
<div class="description">
<t-tag
size="small"
variant="outline"
:content="item.code"
/>
<t-tag
size="small"
variant="outline"
+2 -8
View File
@@ -20,11 +20,11 @@
>
<t-cell-group v-if="productList.length" theme="card" class="list fix-last-cell-line">
<t-cell
class="item"
v-for="(item, index) in productList"
:key="item.productId"
:title="item.productName || '未命名产品'"
arrow
hover
class="item"
v-entrance-transition="index * 30"
@click="toSkuList(item)"
>
@@ -38,12 +38,6 @@
/>
<div v-else class="avatar fallback" v-text="(item.productName || '产').slice(0, 1)" />
</template>
<template #title>
<div class="title">
<strong v-text="item.productName || '未命名产品'" />
<t-tag size="small" variant="outline" :content="item.productCode || '无产品编码'" />
</div>
</template>
<template #description>
<div class="stock">
<span class="on-hand">
+1 -1
View File
@@ -71,7 +71,7 @@
<div class="description">
<pass-time-label :timestamp="record.occurredAt" underline />
<div class="delta">
<span>库存变更:</span>
<span>库存:</span>
<span
class="value"
:class="getDeltaClass(record.onHandDelta)"
+2 -8
View File
@@ -23,11 +23,11 @@
</t-cell-group>
<t-cell-group v-if="skuStockList.length" theme="card" class="list fix-last-cell-line">
<t-cell
class="item"
v-for="(item, index) in skuStockList"
:key="item.skuId || item.id"
:title="item.sku?.name || '未命名 SKU 明细'"
arrow
hover
class="item"
v-entrance-transition="index * 30"
@click="toDetail(item)"
>
@@ -41,12 +41,6 @@
/>
<div v-else class="avatar fallback" v-text="(item.sku?.name || 'S').slice(0, 1)" />
</template>
<template #title>
<div class="title">
<strong v-text="item.sku?.name || '未命名 SKU 明细'" />
<t-tag size="small" variant="outline" :content="item.sku?.code || '无 SKU 编码'" />
</div>
</template>
<template #description>
<div class="stock">
<span class="on-hand">