add viewStock

This commit is contained in:
Timi
2026-09-05 22:13:56 +08:00
parent 2eb18a1474
commit eeed486c51
+11 -5
View File
@@ -2,7 +2,7 @@
<div v-can="permissionCodes.product.read" class="product-detail"> <div v-can="permissionCodes.product.read" class="product-detail">
<t-loading v-if="isLoading" class="loading" size="32px" /> <t-loading v-if="isLoading" class="loading" size="32px" />
<template v-if="product"> <template v-if="product">
<product-profile :product="product" /> <product-profile :product="product" v-entrance-transition />
<t-cell-group title="基本信息" theme="card" v-entrance-transition="70"> <t-cell-group title="基本信息" theme="card" v-entrance-transition="70">
<t-cell title="产品分类" :note="product.category?.name || '未分类'" /> <t-cell title="产品分类" :note="product.category?.name || '未分类'" />
<t-cell title="库存管理" :note="product.stockEnabled ? '启用' : '关闭'" /> <t-cell title="库存管理" :note="product.stockEnabled ? '启用' : '关闭'" />
@@ -19,7 +19,16 @@
/> />
</t-cell> </t-cell>
</t-cell-group> </t-cell-group>
<t-cell-group title="业务单位" theme="card" class="units" v-entrance-transition="140"> <t-cell-group theme="card" v-entrance-transition="140">
<t-cell
v-if="product.stockEnabled && userStore.hasPermissions(permissionCodes.productStock.read)"
title="库存"
note="查看库存详情"
arrow
@click="viewStock"
/>
</t-cell-group>
<t-cell-group title="业务单位" theme="card" class="units" v-entrance-transition="210">
<t-cell <t-cell
v-for="unit in product.unitList || []" v-for="unit in product.unitList || []"
:key="unit.id || unit.name" :key="unit.id || unit.name"
@@ -120,9 +129,6 @@ const actionList = computed<NavBarAction[]>(() => {
list.push({ key: "disable", text: "停用产品", icon: "close", theme: "danger", action: disable }); list.push({ key: "disable", text: "停用产品", icon: "close", theme: "danger", action: disable });
} }
} }
if (product.value?.stockEnabled && userStore.hasPermissions(permissionCodes.productStock.read)) {
list.push({ key: "stock", text: "查看库存", icon: "wallet", theme: "default", action: viewStock });
}
return list; return list;
}); });