diff --git a/package.json b/package.json index 66ec7ee2..aac75b48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "app.salona", "private": true, - "version": "2.117.184", + "version": "2.117.188", "type": "module", "scripts": { "dev": "vite --host", diff --git a/src/apps/appointment/utils/types.ts b/src/apps/appointment/utils/types.ts index 804ee64d..406909be 100644 --- a/src/apps/appointment/utils/types.ts +++ b/src/apps/appointment/utils/types.ts @@ -86,6 +86,7 @@ export interface IAppointment { time: string; description: string; service: string; + service_name?:string; price: number; profile_picture?: string; send_reminder_sms: boolean; diff --git a/src/apps/new-ui/assets/report/defaultIcon.svg b/src/apps/new-ui/assets/report/defaultIcon.svg new file mode 100644 index 00000000..2d02e02b --- /dev/null +++ b/src/apps/new-ui/assets/report/defaultIcon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/apps/new-ui/components/AppointmentComponents/PersonnelServices.tsx b/src/apps/new-ui/components/AppointmentComponents/PersonnelServices.tsx index 540b16ae..7db860c7 100644 --- a/src/apps/new-ui/components/AppointmentComponents/PersonnelServices.tsx +++ b/src/apps/new-ui/components/AppointmentComponents/PersonnelServices.tsx @@ -82,7 +82,7 @@ const PersonnelServices = () => { useEffect(() => { const appointmentService = localStorage.getItem("editAppointmentService"); if (appointmentService) { - setSearchTerm(appointmentService); + setSearchTerm(""); } const foundCost = allServices.find((service: any) => service.service_name === appointmentService); diff --git a/src/apps/new-ui/components/AppointmentComponents/Services.tsx b/src/apps/new-ui/components/AppointmentComponents/Services.tsx index 3011cc7b..683337a9 100644 --- a/src/apps/new-ui/components/AppointmentComponents/Services.tsx +++ b/src/apps/new-ui/components/AppointmentComponents/Services.tsx @@ -50,7 +50,7 @@ const Services = () => { useEffect(() => { const appointmentService = localStorage.getItem("editAppointmentService"); if (appointmentService) { - setSearchTerm(appointmentService); + setSearchTerm(""); } const foundCost = allServices.find( diff --git a/src/apps/new-ui/components/Utilities.tsx b/src/apps/new-ui/components/Utilities.tsx index 96ec1c56..ad80adf9 100644 --- a/src/apps/new-ui/components/Utilities.tsx +++ b/src/apps/new-ui/components/Utilities.tsx @@ -14,8 +14,8 @@ import AddCustomer from "./AppointmentComponents/AddCustomer"; import { appointmentRoutes } from "@/apps/appointment/routes"; import LockWrapper from "./LockWrapper"; import { useGetUserInfo } from "../services/User"; -import personnelPic from "../assets/personnel.webp" -import personnelBG from "../assets/personnelBG.png" +import personnelPic from "../assets/personnel.webp"; +import personnelBG from "../assets/personnelBG.png"; const Utilities = () => { const [accountingMood] = useState(false); @@ -44,8 +44,9 @@ const Utilities = () => { userInformation?.user_abilities_list?.[5]?.active ); setIsUserAbilitiesRepair(userInformation?.user_abilities_list?.[0]?.active); - setIsUserAbilitiesPersonnel(userInformation?.user_abilities_list?.[6]?.active); - + setIsUserAbilitiesPersonnel( + userInformation?.user_abilities_list?.[6]?.active + ); }, [ userInformation?.user_abilities_list?.[5]?.active, userInformation?.user_abilities_list?.[3]?.active, @@ -53,232 +54,263 @@ const Utilities = () => { userInformation?.user_abilities_list?.[6]?.active, ]); - return ( -
-
- {/* ============ */} - - Utilities icon -

کاربردی‌ها

- - - - LoyaltyClub - LoyaltyClubContent -
- باشگاه مشتریان -
- - + return ( +
+
+ {/* ============ */} - smsKadeh - smsKadehContent -
- اس‌ام‌اس کده -
+ Utilities icon +

کاربردی‌ها

{ - if (!isUserAbilitiesPersonnel) { - e.preventDefault(); - localStorage.setItem("selectedProductId", "13"); - navigate("/purchase-summary"); - } - }} - className="mb-2 relative w-full h-40 cursor-pointer" + to={appointmentRoutes.customers} + className="mb-2 w-full h-40 relative cursor-pointer" > personnelBG personnelPic -
- مدیریت پرسنل + باشگاه مشتریان
-
-
- - Report - -
- گزارش -
-
- -
- { - if (!isUserAbilitiesRepair) { - e.preventDefault(); - localStorage.setItem("selectedProductId", "6"); - navigate("/purchase-summary"); - } - }} - className="w-full rounded-lg overflow-hidden relative" - > - Nail - - -
- ترمیم -
-
- -
- { - if (!isUserAbilitiesCashbackList) { - e.preventDefault(); // جلوگیری از تغییر لینک - localStorage.setItem("selectedProductId", "12"); - navigate("/purchase-summary"); - } - }} - className="w-full rounded-lg overflow-hidden relative" - > - Nail - - -
- بازگشت وجه -
-
-
- - {/*
*/} -
- Accounting Card - - {accountingMood ? ( -
-

- با اشتراک حسـابـداری -

-

- مدیریت آسان درآمدها و هزینه‌ها -

- -
- - خرید اشتراک - - - - question mark - -
-
- ) : ( -
{ - if (!isUserAbilitiesAccountantServiceList) { - localStorage.setItem("selectedProductId", "10"); - navigate("/purchase-summary"); - } - }} - className="absolute items-center inset-0 flex justify-center p-4 pr-[8%] sm:p-6 text-white" - > -
-

- حسـابـداری -

- e.stopPropagation()} - to={"/income-and-cost?title=income"} - className="bg-white text-[#067A57] px-3 py-2 rounded-full text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" - > - ثبت درآمد - - e.stopPropagation()} - to={"/income-and-cost?title=cost"} - className="bg-white text-[#C73A3A] px-3 py-2 rounded-full text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" - > - ثبت هزینه - -
-
- e.stopPropagation()} - to={"/factor"} - className="bg-transparent mt-2 text-white px-3 py-2 rounded-full border-white border-2 text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" - > - صورت حساب - -
-
- )} - - -
+
+ + smsKadeh + smsKadehContent +
+ اس‌ام‌اس کده
- {isCustomerOpen && ( -
-
-
setIsCustomerOpen(false)} - className="absolute cursor-pointer bg-[#dedee3] text-[#999999] text-2xl rounded-full px-3.5 py-1 top-2 right-2 " - > - X -
- setIsCustomerOpen(false)} /> -
-
- )} + + + { + if (!isUserAbilitiesPersonnel) { + e.preventDefault(); + localStorage.setItem("selectedProductId", "13"); + navigate("/purchase-summary"); + } + }} + className="relative w-full h-[185px] cursor-pointer" + > + personnelBG + personnelPic + +
+ مدیریت پرسنل +
+
- ); + +
+
+ + Report + +
+ گزارش +
+
+ +
+ { + if (!isUserAbilitiesRepair) { + e.preventDefault(); + localStorage.setItem("selectedProductId", "6"); + navigate("/purchase-summary"); + } + }} + className="w-full rounded-lg overflow-hidden relative" + > + Nail + + +
+ ترمیم +
+
+ +
+ { + if (!isUserAbilitiesCashbackList) { + e.preventDefault(); // جلوگیری از تغییر لینک + localStorage.setItem("selectedProductId", "12"); + navigate("/purchase-summary"); + } + }} + className="w-full rounded-lg overflow-hidden relative" + > + Nail + + +
+ بازگشت وجه +
+
+
+ + {/*
*/} +
+ Accounting Card + + {accountingMood ? ( +
+

+ با اشتراک حسـابـداری +

+

+ مدیریت آسان درآمدها و هزینه‌ها +

+ +
+ + خرید اشتراک + + + + question mark + +
+
+ ) : ( +
{ + if (!isUserAbilitiesAccountantServiceList) { + localStorage.setItem("selectedProductId", "10"); + navigate("/purchase-summary"); + } + }} + className="absolute items-center inset-0 flex justify-center p-4 pr-[8%] sm:p-6 text-white" + > +
+

+ حسـابـداری +

+ e.stopPropagation()} + to={"/income-and-cost?title=income"} + className="bg-white text-[#067A57] px-3 py-2 rounded-full text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" + > + ثبت درآمد + + e.stopPropagation()} + to={"/income-and-cost?title=cost"} + className="bg-white text-[#C73A3A] px-3 py-2 rounded-full text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" + > + ثبت هزینه + +
+
+ e.stopPropagation()} + to={"/factor"} + className="bg-transparent mt-2 text-white px-3 py-2 rounded-full border-white border-2 text-xs xs:text-sm s:text-base font-medium shadow-md w-[125px] sm:w-[200px] text-center" + > + صورت حساب + +
+
+ )} + + +
+
+ {isCustomerOpen && ( +
+
+
setIsCustomerOpen(false)} + className="absolute cursor-pointer bg-[#dedee3] text-[#999999] text-2xl rounded-full px-3.5 py-1 top-2 right-2 " + > + X +
+ setIsCustomerOpen(false)} /> +
+
+ )} +
+ ); }; export default Utilities; diff --git a/src/apps/new-ui/pages/CheckTimeSlotGeneral/+components/SecondStep.tsx b/src/apps/new-ui/pages/CheckTimeSlotGeneral/+components/SecondStep.tsx index a15b2625..30de6a75 100644 --- a/src/apps/new-ui/pages/CheckTimeSlotGeneral/+components/SecondStep.tsx +++ b/src/apps/new-ui/pages/CheckTimeSlotGeneral/+components/SecondStep.tsx @@ -120,7 +120,7 @@ export default function SecondStep({ onNextStep, service, setService }: any) {
e.preventDefault()} > { const filtered = personels.filter((p) => { const fullname = `${p.first_name ?? ""} ${p.last_name ?? ""}`.toLowerCase(); + const phone = p.phone_number const services = (p.services ?? []) .map((s: any) => s.name ?? "") .join(" ") @@ -34,6 +36,7 @@ const PersonnelPage: React.FC = () => { const q = searchTerm.toLowerCase(); return ( fullname.includes(q) || + phone.includes(q) || services.includes(q) || (p.type ?? "").toLowerCase().includes(q) ); @@ -133,12 +136,13 @@ const PersonnelPage: React.FC = () => {
{ personels.length > 0 && (
- setSearchTerm(e.target.value)} placeholder="جستجو با نام، خدمات یا دسته..." className="flex-1 border rounded-full py-2 px-4 shadow-sm focus:outline-none" - /> + /> */} + {/* به جای تازه‌سازی: دکمه افزودن پرسنل جدید */}