From 0861501f481c0d7f15d33a7409b869a03c05c792 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 25 Jan 2025 15:07:46 +0330 Subject: [PATCH] customers and service --- src/config/Pages.ts | 6 + src/langs/fa.json | 57 +++++++- src/pages/customer/Create.tsx | 153 ++++++++++++++++++++++ src/pages/customer/List.tsx | 124 ++++++++++++++++++ src/pages/service/AddService.tsx | 21 ++- src/pages/service/Category.tsx | 137 +++++++++++++++++++ src/pages/service/List.tsx | 110 ++++++++++++++++ src/router/Main.tsx | 9 ++ src/shared/SideBar.tsx | 5 +- src/shared/components/CustomerSubMenu.tsx | 45 +++++++ src/shared/components/ServicesSubMenu.tsx | 7 +- 11 files changed, 667 insertions(+), 7 deletions(-) create mode 100644 src/pages/customer/Create.tsx create mode 100644 src/pages/customer/List.tsx create mode 100644 src/pages/service/Category.tsx create mode 100644 src/pages/service/List.tsx create mode 100644 src/shared/components/CustomerSubMenu.tsx diff --git a/src/config/Pages.ts b/src/config/Pages.ts index f52051f..bf97d43 100644 --- a/src/config/Pages.ts +++ b/src/config/Pages.ts @@ -10,6 +10,8 @@ export const Pages = { other: "/other-service", detail: "/services/detail/", add: "/services/add", + list: "/services/list", + category: "/services/category", }, transactions: "/transactions", receipts: { @@ -58,4 +60,8 @@ export const Pages = { messages: { list: "/messages/list", }, + customer: { + list: "/customers/list", + create: "/customers/create", + }, }; diff --git a/src/langs/fa.json b/src/langs/fa.json index 221c169..7a8152d 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -70,7 +70,10 @@ }, "submenu": { "services_list": "لیست سرویس ها", - "add_service": "افزودن سرویس" + "add_service": "افزودن سرویس", + "service_category": "دسته بندی سرویس ها", + "customer_list": "لیست مشتریان", + "create_customer": "افزودن مشتری" }, "header": { "search": "جستجو" @@ -131,8 +134,24 @@ "service_icon": "آیکون سرویس", "upload_icon_service": "آیکون سرویس مورد نظر را آپلود کنید", "service_images": "تصاویر سرویس", - "upload_images_service": "تصاویر سرویس مورد نظر را آپلود کنید" + "upload_images_service": "تصاویر سرویس مورد نظر را آپلود کنید", + "submit_service": "ثبت سرویس", + "new_service": "سرویس جدید", + "list_service": "لیست سرویس ها", + "status": "وضعیت", + "publish_date": "تاریخ انتشار", + "cateory_services": "دسته بندی سرویس ها", + "parent_category": "دسته مادر", + "count_sub_category": "تعداد زیر دسته", + "count_service": "تعداد سرویس", + "add_category": "اضافه کردن دسته بندی", + "status_category": "وضعیت دسته بندی", + "title_category": "عنوان دسته بندی", + "category_parent_2": "دسته بندی مادر", + "icon_serice_category": "آیکون سرویس مورد نظر را آپلود کنید" }, + "save": "ذخیره", + "search": "جستجو", "upload": "آپلود", "select": "انتخاب", "footer": { @@ -324,5 +343,37 @@ "city": "شهر", "postal_code": "کد پستی" }, - "email": "ایمیل" + "email": "ایمیل", + "customer": { + "customer_list": "لیست مشتریان", + "add_cutomer": "افزودن مشتری", + "name": "نام", + "company": "سازمان / شرکت", + "email": "ایمیل", + "active_services": "سرویس های فعال", + "factor": "صورت حساب ها", + "tickets": "تیکت ها", + "detail": "جزییات", + "submit_customer": "ثبت مشتری", + "family": "نام خانوادگی", + "dateofbirth": "تاریخ تولد", + "national_code": "کد ملی", + "phone_number": "شماره تماس", + "information_legal": "اطلاعات حقوقی", + "economic_code": "کد اقتصادی", + "id_national": "شناسه ملی", + "enter_nation_code": "کد ملی خود را وارد کنید", + "enter_email": "ایمیل خود را وارد کنید", + "enter_phone_number": "شماره تماس خود را وارد کنید", + "enter_economic_code": "کد اقتصادی را وارد کنید", + "enter_id_nation": "شناسه ملی خود را وارد کنید", + "registeration_id": "شناسه ثبت", + "enter_registeration_id": "شناسه ثبت خود را وارد کنید", + "your_phone_fixed": "شماره تماس ثابت", + "enter_phone_fixed": "شماره تماس خود را وارد کنید", + "state": "استان", + "city": "شهر", + "password": "رمز عبور", + "reapeat_password": "تکرار رمز عبور" + } } diff --git a/src/pages/customer/Create.tsx b/src/pages/customer/Create.tsx new file mode 100644 index 0000000..edd784e --- /dev/null +++ b/src/pages/customer/Create.tsx @@ -0,0 +1,153 @@ +import { FC } from 'react' +import { useTranslation } from 'react-i18next' +import Input from '../../components/Input' +import UploadBoxDraggble from '../../components/UploadBoxDraggble'; +import Button from '../../components/Button'; +import { TickCircle } from 'iconsax-react'; +import DatePickerComponent from '../../components/DatePicker'; +import Select from '../../components/Select'; + +const AddCustomer: FC = () => { + + const { t } = useTranslation('global') + + return ( +
+
+
+ {t('customer.add_cutomer')} +
+
+ +
+
+
+
+ +
+
+ + + +
+ +
+ null} + placeholder='' + /> + +
+ +
+ + + +
+ +
+ {t('customer.information_legal')} +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+
{t('service.service_icon')}
+
+ null} + /> +
+
+
+
+
+ ) +} + +export default AddCustomer \ No newline at end of file diff --git a/src/pages/customer/List.tsx b/src/pages/customer/List.tsx new file mode 100644 index 0000000..26e3a06 --- /dev/null +++ b/src/pages/customer/List.tsx @@ -0,0 +1,124 @@ +import { FC } from 'react' +import { useTranslation } from 'react-i18next' +import Button from '../../components/Button' +import { Add, Eye } from 'iconsax-react' +import Select from '../../components/Select' +import Input from '../../components/Input' +import Td from '../../components/Td' +import { Link } from 'react-router-dom' +import { Pages } from '../../config/Pages' + +const CustomerList: FC = () => { + + const { t } = useTranslation('global') + + return ( +
+
+
+ {t('customer.customer_list')} +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + +
۳ صورت حساب
+
+
۴ تیکت
+
+ + + + +
+ + + + +
۳ صورت حساب
+
+
۴ تیکت
+
+ + + + +
+
+
+ ) +} + +export default CustomerList \ No newline at end of file diff --git a/src/pages/service/AddService.tsx b/src/pages/service/AddService.tsx index be8321b..26fe62b 100644 --- a/src/pages/service/AddService.tsx +++ b/src/pages/service/AddService.tsx @@ -6,6 +6,8 @@ import Quill from 'quill'; import SwitchComponent from '../../components/Switch'; import CheckBoxComponent from '../../components/CheckBoxComponent'; import UploadBoxDraggble from '../../components/UploadBoxDraggble'; +import Button from '../../components/Button'; +import { TickCircle } from 'iconsax-react'; const AddService: FC = () => { @@ -29,8 +31,23 @@ const AddService: FC = () => { return (
-
- {t('service.add_service')} +
+
+ {t('service.add_service')} +
+
+ +
diff --git a/src/pages/service/Category.tsx b/src/pages/service/Category.tsx new file mode 100644 index 0000000..d1514f2 --- /dev/null +++ b/src/pages/service/Category.tsx @@ -0,0 +1,137 @@ +import { FC } from 'react' +import { useTranslation } from 'react-i18next' +import Select from '../../components/Select' +import Input from '../../components/Input' +import Td from '../../components/Td' +import SwitchComponent from '../../components/Switch' +import UploadBoxDraggble from '../../components/UploadBoxDraggble' +import Button from '../../components/Button' +import { TickCircle } from 'iconsax-react' + +const Category: FC = () => { + + const { t } = useTranslation('global') + + return ( +
+
+ {t('service.cateory_services')} +
+ +
+
+
+
+ +
+
+
+
+ + + + + + + + + + + +
+ + + + + + +
+
+
+ + + + + null} + /> + +
+
+
+
+ +
+
+ {t('service.add_category')} +
+ +
+
+ {t('service.status_category')} +
+
+ { }} /> +
+
+ +
+ +
+
+ + +
+
+ +
+ + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + + + null} + /> + + + + + +
+
+
+ ) +} + +export default ListService \ No newline at end of file diff --git a/src/router/Main.tsx b/src/router/Main.tsx index c48ed2e..6493a99 100644 --- a/src/router/Main.tsx +++ b/src/router/Main.tsx @@ -25,6 +25,10 @@ import { clx } from '../helpers/utils' import { useSharedStore } from '../shared/store/sharedStore' import CreateReceipt from '../pages/receipts/Create' import AddService from '../pages/service/AddService' +import ListService from '../pages/service/List' +import Category from '../pages/service/Category' +import CustomerList from '../pages/customer/List' +import CreateCustomer from '../pages/customer/Create' const MainRouter: FC = () => { @@ -48,6 +52,8 @@ const MainRouter: FC = () => { } /> } /> } /> + } /> + } /> } /> } /> } /> @@ -62,6 +68,9 @@ const MainRouter: FC = () => { } /> } /> } /> + } /> + } /> +
diff --git a/src/shared/SideBar.tsx b/src/shared/SideBar.tsx index ac32e6b..cad6863 100644 --- a/src/shared/SideBar.tsx +++ b/src/shared/SideBar.tsx @@ -12,6 +12,7 @@ import ServicesSubMenu from './components/ServicesSubMenu' import { SideBarItemHasSubMenu } from '../config/SideBarSubMenu' import TransactionsSubMenu from './components/TransactionsSubMenu' import ReceiptSubMenu from './components/ReceiptSubMenu' +import CustomerSubMenu from './components/CustomerSubMenu' const SideBar: FC = () => { @@ -253,7 +254,9 @@ const SideBar: FC = () => { : subMenuName === 'receipts' ? - : null + : subMenuName === 'customers' ? + + : null }
} diff --git a/src/shared/components/CustomerSubMenu.tsx b/src/shared/components/CustomerSubMenu.tsx new file mode 100644 index 0000000..4d42a72 --- /dev/null +++ b/src/shared/components/CustomerSubMenu.tsx @@ -0,0 +1,45 @@ +import { People } from 'iconsax-react' +import { FC } from 'react' +import { useTranslation } from 'react-i18next' +import SubMenuItem from './SubMenuItem' +import { Pages } from '../../config/Pages' + +const CustomerSubMenu: FC = () => { + + const { t } = useTranslation('global') + + const isActive = (name: string) => { + return location.pathname.includes(name) + } + + return ( +
+
+ +
+ {t('sidebar.customers')} +
+
+ +
+ + +
+ +
+ ) +} + +export default CustomerSubMenu \ No newline at end of file diff --git a/src/shared/components/ServicesSubMenu.tsx b/src/shared/components/ServicesSubMenu.tsx index 9b36da7..47b9ae0 100644 --- a/src/shared/components/ServicesSubMenu.tsx +++ b/src/shared/components/ServicesSubMenu.tsx @@ -32,13 +32,18 @@ const ServicesSubMenu: FC = () => { +
)