|
@@ -16,6 +16,8 @@ import HelpModal from "./help-modal.vue";
|
|
|
import { initRouter } from "/@/router/utils";
|
|
|
import { useCompany } from "/@/hooks/core/useCompany";
|
|
|
import CryptoJS from "crypto-js";
|
|
|
+import { usePermissionStore } from "/@/store/modules/permission";
|
|
|
+import router from "/@/router";
|
|
|
|
|
|
const route = useRoute();
|
|
|
const { push } = useRouter();
|
|
@@ -24,9 +26,12 @@ const helpModalRef = ref<InstanceType<typeof HelpModal> | null>(null);
|
|
|
const systemNotifyRef = ref<InstanceType<typeof SystemNotify>>(null);
|
|
|
const { logout, toggleSideBar, pureApp, avatarsStyle } = useNav();
|
|
|
|
|
|
-const SuperCompanyRef = ref<InstanceType<typeof Super> | null>(null)
|
|
|
+const SuperCompanyRef = ref<InstanceType<typeof Super> | null>(null);
|
|
|
|
|
|
const { isSuperUser, userInfo, userLevel, setUserLevel } = useUserInfo();
|
|
|
+
|
|
|
+const menuData = computed(() => usePermissionStore().wholeMenus);
|
|
|
+
|
|
|
const { setCurrentCompany } = useCompany();
|
|
|
|
|
|
const switchAccountModeText = computed(() =>
|
|
@@ -57,11 +62,16 @@ function openPurchaseSystem() {
|
|
|
async function onSwitchAccountMode() {
|
|
|
const isSupplier = userLevel.value === "3";
|
|
|
setUserLevel(isSupplier ? "1" : "3");
|
|
|
+
|
|
|
await initRouter({ level: isSupplier ? "1" : "3" });
|
|
|
|
|
|
await nextTick(() => {
|
|
|
setCurrentCompany("");
|
|
|
SuperCompanyRef.value && SuperCompanyRef.value.selectAll();
|
|
|
+
|
|
|
+ router.push(
|
|
|
+ menuData.value[1].children[0].path + "?reload=" + userLevel.value
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
</script>
|