add StoreDiary
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user