update ProductStockRecordDetail.vue style

This commit is contained in:
Timi
2026-09-03 22:37:41 +08:00
parent c593e404f6
commit 1df5748f54
2 changed files with 68 additions and 22 deletions
-7
View File
@@ -280,13 +280,6 @@ onUnmounted(() => {
.product-list { .product-list {
padding: var(--app-nav-height) 0 1rem; padding: var(--app-nav-height) 0 1rem;
.filters {
z-index: 10;
position: sticky;
box-shadow: var(--td-shadow-1);
background: var(--td-bg-color-page);
}
.filters { .filters {
top: var(--app-nav-height); top: var(--app-nav-height);
left: 0; left: 0;
+68 -15
View File
@@ -12,20 +12,27 @@
/> />
</template> </template>
</product-profile> </product-profile>
<t-cell-group title="库存流水" theme="card" v-entrance-transition="70"> <card-container description="库存变动信息">
<t-cell title="操作类型" :note="getStockOperationText(record.operationType)" /> <div class="data">
<t-cell title="业务数量" :note="getQuantityText(record)" /> <div class="card">
<t-cell title="基础单位数量" :note="getProductQuantityText(record.baseQuantity)" /> <span class="label">业务数量</span>
<t-cell title="实际库存变动"> <strong :class="getDeltaClass(record.quantity)" v-text="getQuantityText(record)" />
<template #note> </div>
<span :class="getDeltaClass(record.onHandDelta)" v-text="getDeltaText(record.onHandDelta)" /> <div class="card">
</template> <span class="label">基础单位数量</span>
</t-cell> <strong :class="getDeltaClass(record.baseQuantity)" v-text="getSignedQuantityText(record.baseQuantity)" />
<t-cell title="预占库存变动"> </div>
<template #note> <div class="card">
<span :class="getDeltaClass(record.reservedDelta)" v-text="getDeltaText(record.reservedDelta)" /> <span class="label">实际库存变动</span>
</template> <strong :class="getDeltaClass(record.onHandDelta)" v-text="getDeltaText(record.onHandDelta)" />
</t-cell> </div>
<div class="card">
<span class="label">预占库存变动</span>
<strong :class="getDeltaClass(record.reservedDelta)" v-text="getDeltaText(record.reservedDelta)" />
</div>
</div>
</card-container>
<t-cell-group title="库存快照" theme="card">
<t-cell title="实际库存"> <t-cell title="实际库存">
<template #note> <template #note>
<span class="balance"> <span class="balance">
@@ -46,6 +53,9 @@
</span> </span>
</template> </template>
</t-cell> </t-cell>
</t-cell-group>
<t-cell-group title="库存流水" theme="card" v-entrance-transition="70">
<t-cell title="操作类型" :note="getStockOperationText(record.operationType)" />
<t-cell title="业务类型" :note="getBizTypeText(record.bizType)" /> <t-cell title="业务类型" :note="getBizTypeText(record.bizType)" />
<t-cell title="发生时间"> <t-cell title="发生时间">
<template #note> <template #note>
@@ -156,6 +166,10 @@ function getOperationTheme(value?: number | string): "success" | "danger" | "def
} }
function getDeltaText(value?: number | string): string { function getDeltaText(value?: number | string): string {
return getSignedQuantityText(value);
}
function getSignedQuantityText(value?: number | string): string {
const amount = Number(value || 0); const amount = Number(value || 0);
const text = getProductQuantityText(String(value || "0").replace(/^-/, "")); const text = getProductQuantityText(String(value || "0").replace(/^-/, ""));
return `${0 < amount ? "+" : amount < 0 ? "-" : ""}${text}`; return `${0 < amount ? "+" : amount < 0 ? "-" : ""}${text}`;
@@ -167,7 +181,7 @@ function getDeltaClass(value?: number | string): string {
} }
function getQuantityText(item: StockRecord): string { function getQuantityText(item: StockRecord): string {
return `${getProductQuantityText(item.quantity)} ${item.unitSnapshot || "业务单位"}`; return `${getSignedQuantityText(item.quantity)} ${item.unitSnapshot || "业务单位"}`;
} }
function getBizTypeText(type?: StockBizType): string { function getBizTypeText(type?: StockBizType): string {
@@ -290,11 +304,50 @@ onUnmounted(() => navBarStore.clearRight());
} }
} }
.data {
gap: .75rem;
display: grid;
padding: .75rem;
grid-template-columns: repeat(2, minmax(0, 1fr));
.card {
gap: .25rem;
min-width: 0;
padding: .5rem .75rem;
display: flex;
background: var(--td-bg-color-secondarycontainer);
border-radius: .75rem;
flex-direction: column;
.label {
color: var(--td-text-color-secondary);
font-size: .75rem;
}
strong {
overflow: hidden;
font-size: 1.25rem;
word-break: break-all;
text-align: center;
line-height: 1.4;
}
}
}
.actions { .actions {
padding: 0 1rem; padding: 0 1rem;
} }
} }
:global(html.theme-dark) {
.product-stock-record-detail {
.data .card {
background: rgba(15, 23, 42, .72);
border-color: rgba(148, 163, 184, .16);
}
}
}
.revoke-popup { .revoke-popup {
padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0)); padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0));