fix ProductEdit.vue style

This commit is contained in:
Timi
2026-09-03 16:09:56 +08:00
parent 2acdf46d5d
commit 1e7441e5d7
11 changed files with 160 additions and 114 deletions
+8 -19
View File
@@ -1,8 +1,8 @@
<template>
<div v-can="permissionCodes.product.read" class="product-detail">
<t-loading v-if="isLoading" size="32px" />
<t-loading v-if="isLoading" class="loading" size="32px" />
<template v-if="product">
<card-container class="info">
<card-container class="info" v-entrance-transition>
<div class="content">
<div class="left">
<t-image
@@ -38,10 +38,9 @@
</div>
</div>
</card-container>
<t-cell-group title="基本信息" theme="card">
<t-cell-group title="基本信息" theme="card" v-entrance-transition="70">
<t-cell title="产品分类" :note="product.category?.name || '未分类'" />
<t-cell title="基础单位" :note="product.baseUnit || '-'" />
<t-cell title="参考成本" :note="formatProductAmount(product.referenceCost)" />
<t-cell title="基础单位" :note="getProductBaseUnitName(product) || '-'" />
<t-cell title="库存管理" :note="product.stockEnabled ? '启用' : '关闭'" />
<t-cell title="状态" :note="getProductStatusText(product.status)" />
<t-cell title="备注" :note="Text.display(product.remark)"></t-cell>
@@ -56,7 +55,7 @@
/>
</t-cell>
</t-cell-group>
<t-cell-group title="业务单位" theme="card" class="units">
<t-cell-group title="业务单位" theme="card" class="units" v-entrance-transition="140">
<t-cell
v-for="unit in product.unitList || []"
:key="unit.id || unit.name"
@@ -68,7 +67,7 @@
v-if="!unit.isBase"
theme="default"
size="small"
:content="`${unit.baseQuantityPerUnit} ${product.baseUnit}`"
:content="`${unit.baseQuantityPerUnit} ${getProductBaseUnitName(product)}`"
/>
</div>
</template>
@@ -119,11 +118,12 @@ import PhotoScroller from "@/components/PhotoScroller.vue";
import { useNavBarStore } from "@/store/navBarStore";
import type { NavBarAction } from "@/types/NavBarAction";
import type { PhotoItem } from "@/types/Photo";
import type { Product, ProductUnit } from "@/types/Product";
import type { Product } from "@/types/Product";
import { getAttachmentReadURL } from "@/utils/attachment";
import { getErrorMessage } from "@/utils/error";
import {
formatProductAmount,
getProductBaseUnitName,
getProductPhotoURL,
getProductStatusText,
getProductStatusTheme,
@@ -164,17 +164,6 @@ const actionList = computed<NavBarAction[]>(() => {
return list;
});
function getUnitUsageText(unit: ProductUnit): string {
const usage: string[] = [];
if (unit.allowSale) {
usage.push("可销售");
}
if (unit.allowPurchase) {
usage.push("可采购");
}
return usage.length ? usage.join("、") : "暂无业务用途";
}
async function load(): Promise<void> {
const id = String(route.params.id || "");
if (!id) {