add StoreDiary

This commit is contained in:
Timi
2026-08-31 17:32:01 +08:00
parent 95a400cd93
commit 1e83fdf883
9 changed files with 1288 additions and 1 deletions
+30
View File
@@ -34,6 +34,19 @@
<t-icon name="shop-3" />
</template>
</t-cell>
<t-cell
v-if="canManageStoreDiary"
class="action"
title="门店日记"
note="记录门店经营和护理过程"
arrow
hover
@click="goStoreDiaryManagement"
>
<template #leftIcon>
<t-icon name="file" />
</template>
</t-cell>
</t-cell-group>
</section>
<store-data-charts :key="`${currentStoreStore.currentStoreId}-${chartRefreshKey}`" />
@@ -79,6 +92,9 @@ const canManageStore = computed(() => userStore.hasRoles([
gaoRoleCodes.globalManager,
gaoRoleCodes.storeManager
], "or") && userStore.hasPermissions(permissionCodes.store.read));
const canManageStoreDiary = computed(() => userStore.hasRoles(gaoRoleCodes.storeManager)
&& !userStore.hasRoles(gaoRoleCodes.globalManager)
&& userStore.hasPermissions(permissionCodes.storeDiary.read));
// ---------- 门店切换 ----------
@@ -138,6 +154,20 @@ async function goStoreManagement(): Promise<void> {
await router.push(`/management/stores/${store.id}`);
}
async function goStoreDiaryManagement(): Promise<void> {
if (!canManageStoreDiary.value) {
return;
}
const store = await currentStoreStore.loadLoginStore();
if (!store?.id) {
Message.warning("未绑定所属门店");
return;
}
await router.push({ name: "StoreDiaryList" });
}
onMounted(async () => {
navBarStore.setRightIcon("refresh", refreshCharts);
if (canSelectStore.value) {