diff --git a/src/ThemeConfig.vue b/src/ThemeConfig.vue new file mode 100644 index 00000000..51c38607 --- /dev/null +++ b/src/ThemeConfig.vue @@ -0,0 +1,100 @@ + \ No newline at end of file diff --git a/src/components/displays/boxes/ButtonsBox.vue b/src/components/displays/boxes/ButtonsBox.vue new file mode 100644 index 00000000..94451a6e --- /dev/null +++ b/src/components/displays/boxes/ButtonsBox.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/src/components/displays/boxes/WhiteBox.vue b/src/components/displays/boxes/WhiteBox.vue new file mode 100644 index 00000000..881f2c81 --- /dev/null +++ b/src/components/displays/boxes/WhiteBox.vue @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/src/components/displays/department/pos/steps/PosDepartmentStep1.vue b/src/components/displays/department/pos/steps/PosDepartmentStep1.vue index b521fd1d..3397f2f0 100644 --- a/src/components/displays/department/pos/steps/PosDepartmentStep1.vue +++ b/src/components/displays/department/pos/steps/PosDepartmentStep1.vue @@ -8,6 +8,9 @@ import PosNotes from "@/components/displays/department/pos/PosNotes.vue"; import PosSelectedCustomer from "@/components/displays/department/pos/PosSelectedCustomer.vue"; import Cancel from "@/components/forms/department/pos/buttons/Cancel.vue"; import { clearCache } from "@/components/shop/POSDepartmentProcess.vue"; +import WhiteBox from "@/components/displays/boxes/WhiteBox.vue"; +import ButtonsBox from "@/components/displays/boxes/ButtonsBox.vue"; +import { isCustomerSelected } from "@/components/shop/POSDepartmentProcess.vue"; // Clear cache clearCache(); @@ -17,18 +20,39 @@ clearCache();
-
- +
+ + + + +
+ +
+
-
- - +
+ + + + + + -
+ - -
+ +
diff --git a/src/components/displays/user/UserNavigationTop.vue b/src/components/displays/user/UserNavigationTop.vue new file mode 100644 index 00000000..70506992 --- /dev/null +++ b/src/components/displays/user/UserNavigationTop.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/src/components/forms/department/pos/buttons/Cancel.vue b/src/components/forms/department/pos/buttons/Cancel.vue index 4bb60d92..0fff3f24 100644 --- a/src/components/forms/department/pos/buttons/Cancel.vue +++ b/src/components/forms/department/pos/buttons/Cancel.vue @@ -1,9 +1,16 @@ \ No newline at end of file diff --git a/src/components/menus/admin/AdminLeftMenu.vue b/src/components/menus/admin/AdminLeftMenu.vue new file mode 100644 index 00000000..b609db36 --- /dev/null +++ b/src/components/menus/admin/AdminLeftMenu.vue @@ -0,0 +1,116 @@ + + + + + \ No newline at end of file diff --git a/src/components/page/wrappers/DefaultPageWrapper.vue b/src/components/page/wrappers/DefaultPageWrapper.vue index f7393afc..ce241323 100644 --- a/src/components/page/wrappers/DefaultPageWrapper.vue +++ b/src/components/page/wrappers/DefaultPageWrapper.vue @@ -4,7 +4,7 @@ import '@sweetalert2/theme-bulma/bulma.scss'; diff --git a/src/components/session/token/SessionUser.vue b/src/components/session/token/SessionUser.vue index 50d09e01..7666c2ef 100644 --- a/src/components/session/token/SessionUser.vue +++ b/src/components/session/token/SessionUser.vue @@ -16,6 +16,7 @@ import {EconomicProducts} from "@/components/session/token/SessionUser/Objects/e import {Roles} from "@/components/session/token/SessionUser/Objects/Roles.vue"; import {Permissions} from "@/components/session/token/SessionUser/Objects/Permissions.vue"; import {ObjectsGlobal} from "@/components/session/token/SessionUser/Objects/ObjectsGlobal.vue"; +import {useRouter} from "vue-router"; /** * Initiate the user session on app start @@ -68,6 +69,7 @@ export const getSessionData = async () => { SessionUser.user.group_id.value = response.data.data.group_id; SessionUser.user.created_at.value = response.data.data.created_at; SessionUser.user.updated_at.value = response.data.data.updated_at; + SessionUser.user.display_name.value = response.data.data.display_name; // Set the last cached time to now, this is used to determine if the user's data is outdated SessionUser.user.cached_at.value = new Date(); SessionUser.permissions.value = response.data.data.permissions; @@ -75,6 +77,10 @@ export const getSessionData = async () => { if (response.data.data.economic_customer.length > 0) { SessionUser.economicData.customerNumber.value = response.data.data.economic_customer.customerNumber; SessionUser.economicData.name.value = response.data.data.economic_customer.name; + // Set the display name to the e-conomic name if it's empty + if (SessionUser.user.display_name.value === null) { + SessionUser.user.display_name.value = response.data.data.economic_customer.name; + } SessionUser.economicData.address.value = response.data.data.economic_customer.address; SessionUser.economicData.zip.value = response.data.data.economic_customer.zip; SessionUser.economicData.city.value = response.data.data.economic_customer.city; @@ -251,6 +257,42 @@ export const SessionUser = { /** reCAPTCHA */ reCAPTCHA: reCAPTCHA, }, + functions: { + /** Get the department id from the url */ + getDepartmentIdFromUrl: () => { + // Check if the department id is in the route + const router = useRouter(); + return router.currentRoute.value.params.departmentId; + }, + /** Redirect to */ + redirectTo: { + /** + * Redirect to a department + * @note This will redirect the user to '/admin/:department(/:path)' + * @param department The department id + * @param path The path to redirect to (Optional) + */ + department: (department, path = null) => { + window.location.href = '/admin/' + department + (path !== null ? '/' + path : ''); + }, + /** + * Redirect to a superuser page + * @note This will redirect the user to '/superuser(/:path)' + * @param path The path to redirect to (Optional) + */ + superUser: (path = null) => { + window.location.href = '/superuser' + (path !== null ? path : ''); + }, + /** + * Redirect to a user page + * @note This will redirect the user to '/user(/:path)' + * @param path The path to redirect to (Optional) + */ + user: (path = null) => { + window.location.href = '/user' + (path !== null ? path : ''); + }, + } + }, request: authenticatedRequest, editField: EditFieldForm, getSessionData: getSessionData, diff --git a/src/main.js b/src/main.js index 43590a78..3441960d 100644 --- a/src/main.js +++ b/src/main.js @@ -9,6 +9,7 @@ import { createApp } from 'vue' import App from './App.vue' import store from './store/user.vue' import {router} from "@/router.js"; +import {Colors} from "./ThemeConfig.vue"; import applyMiddleware from '@/middleware/index.js'; applyMiddleware(router); @@ -16,4 +17,5 @@ applyMiddleware(router); createApp(App) .use(store) .use(router) + .provide('Colors', Colors) .mount('#app') diff --git a/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue b/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue index 9796171b..c4be97b3 100644 --- a/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue +++ b/src/views/dashboards/departmentDashboard/DepartmentDashboardHero.vue @@ -13,8 +13,8 @@ const departmentId = ref(router.currentRoute.value.params.departmentId); diff --git a/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue b/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue new file mode 100644 index 00000000..1308b3de --- /dev/null +++ b/src/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue b/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue index ba0eb5a9..57f307d6 100644 --- a/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue +++ b/src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPos.vue @@ -6,14 +6,23 @@ import PosDepartmentMVP from "@/components/displays/department/pos/PosDepartment import DepartmentPosNavigation from "@/views/dashboards/departmentDashboard/modules/Pos/DepartmentPosNavigation.vue"; import RestrictedPageWrapper from "@/components/page/wrappers/RestrictedPageWrapper.vue"; import { SessionUser } from "@/components/session/token/SessionUser.vue"; +import DepartmentDashboardPageWrapper from "@/views/dashboards/departmentDashboard/DepartmentDashboardPageWrapper.vue"; +import PageTitle from "@/components/global/PageTitle.vue";