From 688c356e7dbf573e8aceb7e0c2b495385ee566fa Mon Sep 17 00:00:00 2001 From: MojtabaSoumi Date: Mon, 27 Apr 2026 18:18:05 +0330 Subject: [PATCH] 1405/02/07-add authentication card for garoosi --- src/api/customer.ts | 4 + .../BaseDatePicker/src/BaseDatePicker.vue | 6 +- src/core/router/index.ts | 1 + src/model/user.ts | 11 + .../customers/authentication/index.vue | 293 ++++++++++++++++++ src/router/index.ts | 3 + src/router/routes/customers.ts | 11 + 7 files changed, 327 insertions(+), 2 deletions(-) create mode 100644 src/pages/menuPages/customers/authentication/index.vue diff --git a/src/api/customer.ts b/src/api/customer.ts index ea2a234..e8628e2 100644 --- a/src/api/customer.ts +++ b/src/api/customer.ts @@ -1,6 +1,7 @@ import useAxios from '@core/utils/useAxios' import type { AddId, Customer } from '@/model/customer' import type { TableInput } from '@core/type/baseTable' +import type {CheckCardRequest, CheckCardResponse} from "@/model/user"; export const createCustomer = async (obj: Customer) => await useAxios.post(`/admin/customer`, obj) @@ -34,3 +35,6 @@ export const getSingleTable = async (params: TableInput) => export const getSingleArchiveTable = async (params: TableInput) => await useAxios.post>('/admin/customer/single/archive/table', params) +export const checkCard = async (data: CheckCardRequest) => { + return await useAxios.post('/admin/check_card', data) +} \ No newline at end of file diff --git a/src/core/components/BaseDatePicker/src/BaseDatePicker.vue b/src/core/components/BaseDatePicker/src/BaseDatePicker.vue index 339e1d7..4069082 100644 --- a/src/core/components/BaseDatePicker/src/BaseDatePicker.vue +++ b/src/core/components/BaseDatePicker/src/BaseDatePicker.vue @@ -1,6 +1,6 @@ @@ -14,6 +14,7 @@ interface Props { value?: string | Dayjs size?: string format?: string + inputReadOnly?:boolean } const attrs = useAttrs() @@ -25,7 +26,8 @@ const _attrs = computed(() => { const props = withDefaults(defineProps(), { value: '', - format: 'YYYY/MM/DD' + format: 'YYYY/MM/DD', + inputReadOnly:true }) const emit = defineEmits<{ diff --git a/src/core/router/index.ts b/src/core/router/index.ts index 1173af5..013a3b1 100644 --- a/src/core/router/index.ts +++ b/src/core/router/index.ts @@ -69,6 +69,7 @@ export function setupRouter(app: App) { const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: routerStore.routes, + /*scrollBehavior(to, from, savedPosition) { /!*if (savedPosition) { return savedPosition diff --git a/src/model/user.ts b/src/model/user.ts index e25bfee..0f88d16 100644 --- a/src/model/user.ts +++ b/src/model/user.ts @@ -21,3 +21,14 @@ export interface User { export interface AddId { id: number } +export interface CheckCardRequest { + birth_date: string + national_code: string + cart_number: string +} + +export interface CheckCardResponse { + success: boolean + message?: string + data?: any +} diff --git a/src/pages/menuPages/customers/authentication/index.vue b/src/pages/menuPages/customers/authentication/index.vue new file mode 100644 index 0000000..52a0ac7 --- /dev/null +++ b/src/pages/menuPages/customers/authentication/index.vue @@ -0,0 +1,293 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 7450ffa..25c23e8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -47,8 +47,11 @@ export function setupRoutes(permissionsKeys: string[], router?: Router) { function filterRoutesByApp(routes: RouteRecordRaw) { if (!routes.children) return routes.children = routes.children.filter((item) => { + if (item.name === 'discounts' && appName !== 'goldsun') return false if (item.name === 'banners' && appName !== 'garoosi') return false + if (item.name === 'authentication' && appName !== 'garoosi') return false + return true }) routes.children.forEach((child) => filterRoutesByApp(child)) diff --git a/src/router/routes/customers.ts b/src/router/routes/customers.ts index 9076f85..fbf0b1f 100644 --- a/src/router/routes/customers.ts +++ b/src/router/routes/customers.ts @@ -47,6 +47,17 @@ const Customers: RouteRecordRaw = { icon: 'vuesax-linear:save-2', title: 'بایگانی' } + }, + { + name: 'authentication', + path: 'authentication', + component: () => import('@/pages/menuPages/customers/authentication/index.vue'), + meta: { + // permissionsKey: 'user', + icon: 'vuesax-linear:card-tick', + title: 'احراز هویت', + + } } ] }