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
+29 -9
View File
@@ -28,8 +28,9 @@
@click="viewStock" @click="viewStock"
/> />
</t-cell-group> </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 <t-cell
class="sku"
v-for="sku in product.skuList || []" v-for="sku in product.skuList || []"
:key="sku.id || sku.code" :key="sku.id || sku.code"
role="button" role="button"
@@ -38,14 +39,18 @@
hover hover
@click="openSkuDetail(sku)" @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> <template #title>
<div class="title"> <div class="title">
<t-tag
class="code"
size="small"
variant="light"
:content="sku.code || '无编码'"
/>
<h5 class="name" v-text="getSkuTitle(sku)" /> <h5 class="name" v-text="getSkuTitle(sku)" />
</div> </div>
</template> </template>
@@ -162,7 +167,13 @@ import type { PhotoItem } from "@/types/Photo";
import type { Product, ProductSku, ProductSkuUnit } from "@/types/Product"; import type { Product, ProductSku, ProductSkuUnit } from "@/types/Product";
import { getAttachmentReadURL } from "@/utils/attachment"; import { getAttachmentReadURL } from "@/utils/attachment";
import { getErrorMessage } from "@/utils/error"; 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 { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission"; import { permissionCodes } from "@/utils/permission";
import { Text } from "timi-web"; import { Text } from "timi-web";
@@ -317,7 +328,15 @@ onUnmounted(() => navBarStore.clearRight());
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0; padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
flex-direction: column; flex-direction: column;
.units { .skus {
.sku {
padding: 10px;
.avatar {
width: 3.5rem;
height: 3.5rem;
}
.title { .title {
gap: .5rem; gap: .5rem;
@@ -335,6 +354,7 @@ onUnmounted(() => navBarStore.clearRight());
flex-wrap: wrap; flex-wrap: wrap;
} }
} }
}
} }
.sku-popup { .sku-popup {
-5
View File
@@ -68,11 +68,6 @@
</template> </template>
<template #description> <template #description>
<div class="description"> <div class="description">
<t-tag
size="small"
variant="outline"
:content="item.code"
/>
<t-tag <t-tag
size="small" size="small"
variant="outline" 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-group v-if="productList.length" theme="card" class="list fix-last-cell-line">
<t-cell <t-cell
class="item"
v-for="(item, index) in productList" v-for="(item, index) in productList"
:key="item.productId" :key="item.productId"
:title="item.productName || '未命名产品'"
arrow arrow
hover
class="item"
v-entrance-transition="index * 30" v-entrance-transition="index * 30"
@click="toSkuList(item)" @click="toSkuList(item)"
> >
@@ -38,12 +38,6 @@
/> />
<div v-else class="avatar fallback" v-text="(item.productName || '产').slice(0, 1)" /> <div v-else class="avatar fallback" v-text="(item.productName || '产').slice(0, 1)" />
</template> </template>
<template #title>
<div class="title">
<strong v-text="item.productName || '未命名产品'" />
<t-tag size="small" variant="outline" :content="item.productCode || '无产品编码'" />
</div>
</template>
<template #description> <template #description>
<div class="stock"> <div class="stock">
<span class="on-hand"> <span class="on-hand">
+1 -1
View File
@@ -71,7 +71,7 @@
<div class="description"> <div class="description">
<pass-time-label :timestamp="record.occurredAt" underline /> <pass-time-label :timestamp="record.occurredAt" underline />
<div class="delta"> <div class="delta">
<span>库存变更:</span> <span>库存:</span>
<span <span
class="value" class="value"
:class="getDeltaClass(record.onHandDelta)" :class="getDeltaClass(record.onHandDelta)"
+2 -8
View File
@@ -23,11 +23,11 @@
</t-cell-group> </t-cell-group>
<t-cell-group v-if="skuStockList.length" theme="card" class="list fix-last-cell-line"> <t-cell-group v-if="skuStockList.length" theme="card" class="list fix-last-cell-line">
<t-cell <t-cell
class="item"
v-for="(item, index) in skuStockList" v-for="(item, index) in skuStockList"
:key="item.skuId || item.id" :key="item.skuId || item.id"
:title="item.sku?.name || '未命名 SKU 明细'"
arrow arrow
hover
class="item"
v-entrance-transition="index * 30" v-entrance-transition="index * 30"
@click="toDetail(item)" @click="toDetail(item)"
> >
@@ -41,12 +41,6 @@
/> />
<div v-else class="avatar fallback" v-text="(item.sku?.name || 'S').slice(0, 1)" /> <div v-else class="avatar fallback" v-text="(item.sku?.name || 'S').slice(0, 1)" />
</template> </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> <template #description>
<div class="stock"> <div class="stock">
<span class="on-hand"> <span class="on-hand">