From c8f091a694b81e62a7847bd7128b86b5a2fdc9b5 Mon Sep 17 00:00:00 2001 From: reza karimi Date: Mon, 28 Sep 2026 13:33:01 +0330 Subject: [PATCH] add gallery --- .idea/.name | 1 + lib/api.js | 1 + pages/Gallery.js | 449 +++++-- pages/components/Layout/header.js | 12 +- pages/landing.js | 1042 +++++++++++++++ pages/medical-equipment/index.js | 26 - pages/recruitment/item/request/PersonData.js | 1116 ++++++++++------- .../images/gallery/IMG-20260910-WA0000.jpg | Bin 0 -> 38638 bytes .../images/gallery/IMG-20260910-WA0001.jpg | Bin 0 -> 41784 bytes .../images/gallery/IMG-20260910-WA0002.jpg | Bin 0 -> 66161 bytes .../images/gallery/IMG-20260910-WA0003.jpg | Bin 0 -> 57029 bytes .../images/gallery/IMG-20260910-WA0004.jpg | Bin 0 -> 47851 bytes .../images/gallery/IMG-20260910-WA0005.jpg | Bin 0 -> 76395 bytes .../images/gallery/IMG-20260910-WA0006.jpg | Bin 0 -> 37147 bytes .../images/gallery/IMG-20260910-WA0007.jpg | Bin 0 -> 55109 bytes .../images/gallery/IMG-20260910-WA0008.jpg | Bin 0 -> 44760 bytes .../images/gallery/IMG-20260910-WA0009.jpg | Bin 0 -> 50212 bytes .../images/gallery/IMG-20260910-WA0010.jpg | Bin 0 -> 44917 bytes .../images/gallery/IMG-20260910-WA0011.jpg | Bin 0 -> 42884 bytes .../images/gallery/IMG-20260910-WA0012.jpg | Bin 0 -> 42012 bytes .../images/gallery/IMG-20260910-WA0013.jpg | Bin 0 -> 43197 bytes .../images/gallery/IMG-20260910-WA0014.jpg | Bin 0 -> 45877 bytes .../images/gallery/IMG-20260910-WA0015.jpg | Bin 0 -> 45441 bytes .../images/gallery/IMG-20260910-WA0016.jpg | Bin 0 -> 33590 bytes .../images/gallery/IMG-20260910-WA0017.jpg | Bin 0 -> 44575 bytes .../images/gallery/IMG-20260910-WA0018.jpg | Bin 0 -> 49582 bytes .../images/gallery/IMG-20260910-WA0019.jpg | Bin 0 -> 47852 bytes .../images/gallery/IMG-20260910-WA0020.jpg | Bin 0 -> 64923 bytes .../images/gallery/IMG-20260910-WA0021.jpg | Bin 0 -> 51327 bytes .../images/gallery/IMG-20260910-WA0022.jpg | Bin 0 -> 69866 bytes .../images/gallery/IMG-20260910-WA0023.jpg | Bin 0 -> 83096 bytes .../images/gallery/IMG-20260910-WA0024.jpg | Bin 0 -> 45431 bytes .../images/gallery/IMG-20260910-WA0025.jpg | Bin 0 -> 98511 bytes .../images/gallery/IMG-20260910-WA0026.jpg | Bin 0 -> 49262 bytes .../images/gallery/IMG-20260910-WA0027(1).jpg | Bin 0 -> 36123 bytes .../images/gallery/IMG-20260910-WA0027.jpg | Bin 0 -> 36123 bytes .../images/gallery/IMG-20260910-WA0028.jpg | Bin 0 -> 62891 bytes .../images/gallery/IMG-20260910-WA0029.jpg | Bin 0 -> 40732 bytes .../images/gallery/IMG-20260910-WA0030.jpg | Bin 0 -> 50424 bytes .../images/gallery/IMG-20260910-WA0031.jpg | Bin 0 -> 38702 bytes .../images/gallery/IMG-20260910-WA0032.jpg | Bin 0 -> 38814 bytes .../images/gallery/IMG-20260910-WA0033.jpg | Bin 0 -> 41720 bytes .../images/gallery/IMG-20260910-WA0034.jpg | Bin 0 -> 58611 bytes .../images/gallery/IMG-20260910-WA0035.jpg | Bin 0 -> 87911 bytes .../images/gallery/IMG-20260910-WA0036.jpg | Bin 0 -> 56930 bytes .../images/gallery/IMG-20260910-WA0037.jpg | Bin 0 -> 42212 bytes .../images/gallery/IMG-20260910-WA0038.jpg | Bin 0 -> 44002 bytes .../images/gallery/IMG-20260910-WA0039.jpg | Bin 0 -> 88124 bytes .../images/gallery/IMG-20260910-WA0040.jpg | Bin 0 -> 61756 bytes .../images/gallery/IMG-20260910-WA0041.jpg | Bin 0 -> 82350 bytes .../images/gallery/IMG-20260910-WA0042.jpg | Bin 0 -> 31967 bytes .../images/gallery/IMG-20260910-WA0043.jpg | Bin 0 -> 57429 bytes .../images/gallery/IMG-20260910-WA0044.jpg | Bin 0 -> 69110 bytes .../images/gallery/IMG-20260910-WA0045.jpg | Bin 0 -> 46805 bytes .../images/gallery/IMG-20260910-WA0046.jpg | Bin 0 -> 55932 bytes .../images/gallery/IMG-20260910-WA0047.jpg | Bin 0 -> 36046 bytes .../images/gallery/IMG-20260910-WA0048.jpg | Bin 0 -> 30730 bytes .../images/gallery/IMG-20260910-WA0049.jpg | Bin 0 -> 33451 bytes .../images/gallery/IMG-20260910-WA0050.jpg | Bin 0 -> 61437 bytes .../images/gallery/IMG-20260910-WA0052.jpg | Bin 0 -> 65742 bytes .../images/gallery/IMG-20260910-WA0053.jpg | Bin 0 -> 38111 bytes .../images/gallery/IMG-20260910-WA0054.jpg | Bin 0 -> 78334 bytes .../images/gallery/IMG-20260910-WA0055.jpg | Bin 0 -> 61471 bytes .../images/gallery/IMG-20260910-WA0056.jpg | Bin 0 -> 54011 bytes .../images/gallery/IMG-20260910-WA0057.jpg | Bin 0 -> 48605 bytes .../images/gallery/IMG-20260910-WA0058.jpg | Bin 0 -> 43124 bytes .../images/gallery/IMG-20260910-WA0059.jpg | Bin 0 -> 42193 bytes 67 files changed, 2039 insertions(+), 608 deletions(-) create mode 100644 .idea/.name create mode 100644 pages/landing.js create mode 100644 public/resource/images/gallery/IMG-20260910-WA0000.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0001.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0002.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0003.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0004.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0005.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0006.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0007.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0008.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0009.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0010.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0011.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0012.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0013.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0014.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0015.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0016.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0017.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0018.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0019.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0020.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0021.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0022.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0023.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0024.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0025.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0026.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0027(1).jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0027.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0028.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0029.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0030.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0031.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0032.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0033.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0034.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0035.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0036.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0037.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0038.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0039.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0040.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0041.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0042.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0043.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0044.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0045.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0046.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0047.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0048.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0049.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0050.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0052.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0053.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0054.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0055.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0056.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0057.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0058.jpg create mode 100644 public/resource/images/gallery/IMG-20260910-WA0059.jpg diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..005449e --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +pjson.js \ No newline at end of file diff --git a/lib/api.js b/lib/api.js index f9d7624..3356ddc 100644 --- a/lib/api.js +++ b/lib/api.js @@ -20,3 +20,4 @@ export const AppFile = addr => { return `${serve}/${addr}` } export const AppProduction = 'https://mehriranianco.ir/api/' +// export const AppProduction = 'http://127.0.0.1:8000/api/' diff --git a/pages/Gallery.js b/pages/Gallery.js index 39dd3b7..935bfab 100644 --- a/pages/Gallery.js +++ b/pages/Gallery.js @@ -1,93 +1,356 @@ -import React, { useEffect, useState } from 'react' -import axios from 'axios' -import AppContainer from './appContainer' -import { AppFile, AppUrl } from '../lib/api' -import Image from 'next/image' -import dynamic from 'next/dynamic' -import { Suspense } from 'react' - -import { MDBBtn, MDBCol, MDBContainer, MDBRow } from 'mdb-react-ui-kit' -import { LightBox } from 'react-lightbox-pack' -import { Button, Divider, Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react' - -const APV = dynamic(() => import('./components/Videos'), { - ssr: false -}) -const shimmer = (w, h) => ` - - - - - - - - - - - -` - -const toBase64 = str => (typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str)) - -const Gallery = dataImage => { - const [Images, SetImages] = useState(dataImage) - const [justifyActive, setJustifyActive] = React.useState('tab1') - const [toggle, setToggle] = React.useState(false) - const [sIndex, setSIndex] = React.useState(0) - const [filterId, setFilterId] = React.useState(1) - const Parallax = ({ quality }) => { - return `../resource/parallax/Gallery.jpg` - } -// const Filter = async filter => { -// const res = await axios.get(AppUrl(`FilterGalleyImages/${filter}`)) -// SetImages({ dataImage: res.data }) -// setFilterId(filter) -// } - -// const AllImage = async () => { -// const res = await axios.get(AppUrl(`GetGalleyImages`)) -// SetImages({ dataImage: res.data }) -// } - - // Handler -// const lightBoxHandler = (state, sIndex) => { -// setToggle(state) -// setSIndex(sIndex) -// } - - const handleJustifyClick = value => { - if (value === justifyActive) { - return - } - - setJustifyActive(value) - } - return ( -
- - -
- ) -} -export async function getServerSideProps(context) { - // const res = await axios.get(AppUrl('GetGalleyImages')); - return { - props: { - dataImage: null - } // will be passed to the page component as props - } -} -export default Gallery +import fs from 'fs' +import path from 'path' +import React, { useEffect, useState } from 'react' +import Image from 'next/image' +import AppContainer from './appContainer' + +const shimmer = (width, height) => ` + + + + + + + + + + + +` + +const toBase64 = value => + typeof window === 'undefined' ? Buffer.from(value).toString('base64') : window.btoa(value) + +const galleryBannerLoader = () => '/resource/parallax/Gallery.jpg' + +const Gallery = ({ images }) => { + const [selectedImage, setSelectedImage] = useState(null) + + const closeLightbox = () => setSelectedImage(null) + + const showPreviousImage = () => { + setSelectedImage(current => (current === 0 ? images.length - 1 : current - 1)) + } + + const showNextImage = () => { + setSelectedImage(current => (current === images.length - 1 ? 0 : current + 1)) + } + + useEffect(() => { + if (selectedImage === null) return undefined + + const handleKeyDown = event => { + if (event.key === 'Escape') setSelectedImage(null) + if (event.key === 'ArrowRight') { + setSelectedImage(current => (current === images.length - 1 ? 0 : current + 1)) + } + if (event.key === 'ArrowLeft') { + setSelectedImage(current => (current === 0 ? images.length - 1 : current - 1)) + } + } + + const previousOverflow = document.body.style.overflow + document.body.style.overflow = 'hidden' + window.addEventListener('keydown', handleKeyDown) + + return () => { + document.body.style.overflow = previousOverflow + window.removeEventListener('keydown', handleKeyDown) + } + }, [selectedImage, images.length]) + + return ( + + + +
+

گالری بیمارستان

+ گالری بیمارستان مهر ایرانیان پرند +
+ +
+
+

گالری تصاویر

+

تصاویر بیمارستان مهر ایرانیان پرند

+
+ +
+ {images.map((image, index) => ( + + ))} +
+
+ + {selectedImage !== null && ( +
+ + + {images[selectedImage].title} event.stopPropagation()} + /> + +

+ {selectedImage + 1} از {images.length} +

+
+ )} +
+ ) +} + +export async function getStaticProps() { + const galleryDirectory = path.join(process.cwd(), 'public', 'resource', 'images', 'gallery') + const fileNames = fs + .readdirSync(galleryDirectory) + .filter(fileName => /\.(jpe?g|png|webp)$/i.test(fileName)) + .sort((first, second) => first.localeCompare(second, undefined, { numeric: true })) + + const images = fileNames.map((fileName, index) => ({ + id: fileName, + image: `/resource/images/gallery/${encodeURIComponent(fileName)}`, + title: `تصویر ${index + 1} از بیمارستان مهر ایرانیان پرند` + })) + + return { + props: { images } + } +} + +export default Gallery diff --git a/pages/components/Layout/header.js b/pages/components/Layout/header.js index 079045f..a1db894 100644 --- a/pages/components/Layout/header.js +++ b/pages/components/Layout/header.js @@ -215,7 +215,7 @@ export default function App() { */} - واحد تجهیزات پزشکی - - */} + {/* - {/* +
امور سهام
- */} -
+ +
*/} {/* { + return ( + + + +
+
+
+ بخش بستری بیمارستان مهر ایرانیان پرند +
+
+
+
+
+ + بیمارستان تخصصی در قلب شهر پرند +
+

+ همراه مطمئن شما، برای زندگی سالم‌تر +

+

+ بیمارستان مهر ایرانیان پرند با تکیه بر زیرساخت درمانی مدرن، بخش‌های تخصصی و فضای طراحی‌شده برای + آرامش بیماران، در مسیر تبدیل‌شدن به یکی از قطب‌های سلامت جنوب‌غرب تهران است. +

+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ فضای داخلی بیمارستان مهر ایرانیان پرند +
+
+ ۹۶ تخت + ظرفیت فاز نخست بیمارستان +
+
+ +
+ درباره مهر ایرانیان +

زیرساختی مدرن برای پاسخ به نیاز درمانی منطقه

+

+ بیمارستان تخصصی مهر ایرانیان در یکی از بهترین موقعیت‌های شهر پرند و در مجاورت بزرگ‌ترین فرودگاه + کشور قرار دارد. این مجموعه با فضای درمانی گسترده، بخش‌های تخصصی و فوق‌تخصصی و دسترسی مناسب، برای + خدمت‌رسانی به ساکنان پرند، رباط‌کریم، نسیم‌شهر و شهرهای پیرامون طراحی شده است. +

+
+
+ طراحی بیمارمحور +
+
+ تجهیزات تخصصی +
+
+ دسترسی شهری مناسب +
+
+ پوشش خدمات متنوع +
+
+ + + داستان بیمارستان را بخوانید + + +
+
+ +
+
+ ۲۱,۰۰۰ + مترمربع فضای درمانی +
+
+ ۴,۰۰۰ + مترمربع پارکینگ طبقاتی +
+
+ ۹۶ + تخت در فاز نخست +
+
+ ۱۴+ + بخش درمانی و تخصصی +
+
+
+
+ +
+
+
+
+ خدمات درمانی +

مراقبت تخصصی، در یک مجموعه یکپارچه

+
+ + + مشاهده همه بخش‌ها + + +
+ +
+ {departments.map(department => ( +
+
+ +
+

{department.title}

+

{department.description}

+
+ ))} +
+
+
+ +
+
+
+
+ فضای بیمارستان +

محیطی آرام، روشن و مجهز برای درمان

+
+ + + مشاهده گالری کامل + + +
+ +
+ {galleryImages.map(image => ( +
+ {image.alt} +
+ ))} +
+ +
+
+ + + +
+

مراقبت بیمارمحور

+

طراحی مسیر درمان با توجه به آرامش و نیازهای بیمار و همراهان

+
+
+
+ + + +
+

کیفیت و ایمنی

+

زیرساخت‌های درمانی مدرن برای ارائه خدمات ایمن و قابل‌اعتماد

+
+
+
+ + + +
+

دسترسی بهتر

+

موقعیت مناسب در پرند و دسترسی آسان برای شهرهای جنوب‌غرب تهران

+
+
+
+
+
+ +
+
+
+
+

برای راهنمایی و ارتباط با بیمارستان کنار شما هستیم

+

+ تهران، شهر جدید پرند، بلوار شهید قاسم سلیمانی، انتهای فاز ۵، نبش بلوار رسول اکرم (ص) +

+
+ +
+
+
+
+
+ ) +} + +export default Landing diff --git a/pages/medical-equipment/index.js b/pages/medical-equipment/index.js index eb71992..c754651 100644 --- a/pages/medical-equipment/index.js +++ b/pages/medical-equipment/index.js @@ -16,32 +16,6 @@ const MedicalEquipment = () => { height={2000} /> -
-
-
- - - - اگر به دنبال همکاری با بخش تجهیزات بیمارستان هستید، لطفا با یکی از شماره‌های زیر تماس حاصل نمایید تا - اطلاعات بیشتری در این خصوص از ما دریافت کنید - - - -
-
- 021-53457999 -
- 09194199420 -
- خانم زارعی -
-
-
) } diff --git a/pages/recruitment/item/request/PersonData.js b/pages/recruitment/item/request/PersonData.js index decea77..599bad8 100644 --- a/pages/recruitment/item/request/PersonData.js +++ b/pages/recruitment/item/request/PersonData.js @@ -1,537 +1,687 @@ -import React, { useContext, useEffect, useRef, useState } from 'react' -import { Box, Input, Radio, RadioGroup, Select, SimpleGrid, Stack, Textarea, UnorderedList } from '@chakra-ui/react' +import React, { useContext, useState } from 'react' +import { Box, Input, Radio, RadioGroup, Select, SimpleGrid, Stack, Textarea, FormControl, FormLabel, FormErrorMessage, InputGroup, InputLeftElement, InputRightElement } from '@chakra-ui/react' import { MDBBtn, - MDBCol, - MDBContainer, - MDBFile, - MDBRadio, MDBInputGroup, MDBInputGroupText, - MDBRow } from 'mdb-react-ui-kit' -import { FcApproval } from 'react-icons/fc' -import { FiCheck, FiUser } from 'react-icons/fi' -import { useForm } from 'react-hook-form' +import { FiUser, FiPhone, FiCalendar, FiHome, FiBriefcase, FiHeart } from 'react-icons/fi' +import { useForm, Controller } from 'react-hook-form' import { HandleFormReq } from '../../../../lib/HandleFormReq' import axios from 'axios' import { AppProduction } from '../../../../lib/api' +// آیکون سفارشی +const FieldIcon = ({ icon: Icon }) => ( + + + +) + +// کامپوننت فیلد ورودی +const FormField = ({ + label, + icon: Icon, + error, + children, + isRequired = false, + helpText +}) => ( + + + {label && ( + + {label} + + )} + + {Icon && ( + + + + )} + {children} + + {error && ( + + {error} + + )} + {helpText && !error && ( + + {helpText} + + )} + + +) + +// کامپوننت Select با Controller - حل مشکل theme +const FormSelect = ({ + label, + options, + error, + name, + control, + placeholder = "انتخاب کنید", + isRequired = false, + defaultValue = "" +}) => ( + + + {label && ( + + {label} + + )} + ( + + )} + /> + {error && ( + + {error} + + )} + + +) + +// کامپوننت Radio Group +const FormRadioGroup = ({ + label, + options, + name, + control, + error +}) => ( + + + {label && ( + + {label} + + )} + ( + + + {options.map(opt => ( + + {opt.label} + + ))} + + + )} + /> + {error && ( + + {error} + + )} + + +) + +// آپشن‌های عددی +const numberOptions = (min, max) => { + const options = [] + for (let i = min; i <= max; i++) { + options.push({ value: String(i), label: String(i) }) + } + return options +} + const PersonData = () => { const { setPage, personData, setpersondata } = useContext(HandleFormReq) - const [sex, setSex] = useState(personData.gender) - const [health, setHealth] = React.useState(personData.health) + const [sex, setSex] = useState(personData.gender || '1') + const [health, setHealth] = useState(personData.health || '1') + const [isSubmitting, setIsSubmitting] = useState(false) + const { register, handleSubmit, + control, watch, + setValue, formState: { errors } - } = useForm() - let hasErr = Object.keys(errors).length - const onSubmit = async data => { - console.log('dadadada', data) - if (hasErr === 0) { - axios - .post(`${AppProduction}public/jobrequest/nationalcode`, { - nationalcode: data.national_code - }) - .then(res => { - if (res.data.status === false) { - alert('کد ملی شما قبلا ثبت شده ') - } else { - setpersondata(data) - setPage(2) - } - }) - .catch(err => { - console.log('44324589091', err) - }) + } = useForm({ + defaultValues: { + firstname: personData.firstname || '', + lastname: personData.lastname || '', + fatherName: personData.fatherName || '', + wifeJob: personData.wifeJob || '', + childIndex: personData.childIndex ?? 0, + dependants: personData.dependants ?? 0, + Insurance: personData.Insurance || '', + national_code: personData.national_code || '', + placenational: personData.placenational || '', + phone: personData.phone || '', + mobile_number: personData.mobile_number || '', + birthday: personData.birthday || '', + gender: personData.gender || '1', + degree: personData.degree || '', + marital: personData.marital || '', + military: personData.military || '', + health: personData.health || '1', + healthreason: personData.healthreason || '', + address: personData.address || '', + } + }) - console.log('jsondataperson', JSON.stringify({ personData: personData, scc: personData })) - } else { - alert('مقادیر وارد شده معبتر نمی باشد') + // گزینه‌ها + const insuranceOptions = [ + { value: '1', label: 'بیمه تامین اجتماعی' }, + { value: '2', label: 'بیمه خدمات درمانی' }, + { value: '3', label: 'بیمه سلامت' }, + { value: '4', label: 'بیمه نیروهای مسلح' }, + { value: '5', label: 'بدون بیمه' }, + ] + + const educationOptions = [ + { value: '0', label: 'زیر دیپلم' }, + { value: '1', label: 'دیپلم' }, + { value: '5', label: 'فوق دیپلم' }, + { value: '2', label: 'لیسانس' }, + { value: '3', label: 'فوق لیسانس' }, + { value: '4', label: 'دکتری' }, + ] + + const maritalOptions = [ + { value: '1', label: 'مجرد' }, + { value: '2', label: 'متاهل' }, + ] + + const militaryOptions = [ + { value: '1', label: 'معافیت' }, + { value: '2', label: 'مشمول' }, + { value: '3', label: 'پایان خدمت' }, + ] + + const healthOptions = [ + { value: '1', label: 'ندارم' }, + { value: '2', label: 'دارم' }, + ] + + const onSubmit = async data => { + setIsSubmitting(true) + try { + const res = await axios.post(`${AppProduction}public/jobrequest/nationalcode`, { + nationalcode: data.national_code + }) + + if (res.data.status === false) { + alert('کد ملی شما قبلاً ثبت شده است') + } else { + setpersondata(data) + setPage(2) + } + } catch (err) { + console.error('خطا در ارسال فرم:', err) + alert('خطا در ارتباط با سرور. لطفاً دوباره تلاش کنید.') + } finally { + setIsSubmitting(false) } } - console.log('personData.lastname', typeof personData.lastname) + return ( -
-
- - -
- -
- - - +
+
+
+
اطلاعات فردی
+
+ + +
+ + {/* ===== بخش اطلاعات شخصی ===== */} +
+
+ + اطلاعات شخصی +
+ + + -
-

- {errors?.firstname?.type === 'required' &&

وارد کردن نام اجباری است

} - {errors?.firstname?.type === 'maxLength' &&

نام وارد شده معبتر نمی باشد

} -

- -
- - -
- -
- - - + + + -
-

- {errors?.lastname?.type === 'required' &&

وارد کردن نام خانوادگی اجباری است

} -

-
-
-
- -
- -
- - - + + + -
-

- {errors?.fatherName?.type === 'required' &&

وارد کردن نام پدر اجباری است

} -

-
-
-
- -
- -
- - - - -
- {/*

*/} - {/* {errors?.wifeJob?.type === "required" &&

وارد کردن شغل همسر اجباری است

}*/} - {/*

*/} -
-
-
- -
- -
- - - - -
- {/*

*/} - {/* {errors?.childIndex?.type === "required" &&

وارد کردن شغل همسر اجباری است

}*/} - {/*

*/} -
-
-
- -
- -
- - - - -
- {/*

*/} - {/* {errors?.dependants?.type === "required" &&

وارد کردن شغل همسر اجباری است

}*/} - {/*

*/} -
-
-
- -
- -
- - - - -
-

- {errors?.Insurance?.type === 'required' &&

وارد کردن وضعیت بیمه اجباری است

} -

-
-
-
- -
- -
- - - - -
-

- {errors?.national_code?.type === 'required' &&

وارد کردن کد ملی اجباری است

} - {errors?.national_code?.type === 'maxLength' &&

کد ملی وارد شده معبتر نمی باشد

} - {errors?.national_code?.type === 'minLength' &&

کد ملی وارد شده معبتر نمی باشد

} -

-
-
-
- -
- -
- - - - -
-

- {errors?.placenational?.type === 'required' &&

وارد کردن محل صدور شناسانه اجباری است

} -

-
-
-
- -
- -
- - - - -
-

- {errors?.phone?.type === 'required' &&

وارد کردن تلفن ثابت اجباری است

} -

-
-
-
- -
- -
- - - - -
-

- {errors?.mobile_number?.type === 'required' &&

وارد کردن شماره موبایل اجباری است

} - {errors?.mobile_number?.type === 'maxLength' &&

شماره موبایل وارد شده معبتر نمی باشد

} - {errors?.mobile_number?.type === 'minLength' &&

شماره موبایل وارد شده معبتر نمی باشد

} -

-
-
-
- -
- -
- - - + + + + + +
+ + {/* ===== بخش شناسایی ===== */} +
+
+ + اطلاعات شناسایی +
+ + + + + + + + + + + + + + + + + + +
+ + {/* ===== بخش وضعیت ===== */} +
+
+ + وضعیت شخصی +
+ + + + {/* جنسیت - با useState مدیریت می‌شود */} + + + + + + + + + + + + {/* نظام وظیفه - فقط برای مردان */} + {sex === '1' && ( +
+
-

- {errors?.birthday?.type === 'required' &&

وارد کردن تاریخ تولد اجباری است

} -

- -
- - {/*////*/} - - - - -
- جنسیت : -
- -
-
-

- {errors?.gender?.type === 'required' &&

وارد کردن نظام وظیفه اجباری است

} -

-
-
- - -
- وضعیت تحصیل : -
- -
-
-

- {errors?.degree?.type === 'required' &&

وضعیت تحصیل را مشخص کنید

} -

-
-
- - -
- وضعیت تاهل : -
- -
-
-

- {errors?.marital?.type === 'required' &&

وضعیت تاهل را مشخص کنید

} -

-
-
- - {sex === '1' ? ( - -
- وضعیت نظام وظیفه : -
- -
-
-
-

- {errors?.military?.type === 'required' &&

وضعیت سربازی را مشخص کنید

} -

-
-
- ) : ( - '' )} -
- - -
+ + {/* ===== بخش خانواده ===== */} +
+
+ + اطلاعات خانوادگی +
+ + + + + + + - سابقه بیماری : - -
- - ندارم - دارم - -
-
-
-
- {health === '2' && ( -
-
-
-
-
+ + + +
+ + {/* ===== بخش سلامت ===== */} +
+
+ + وضعیت سلامت +
+ +
+ + + {health === '2' && ( +
+ -
-

- {errors?.healthreason?.type === 'required' &&

نوع بیماری خود را وارد کنید

} -

-
-
- )} -
- - - + +
+ )} +
+
- {/*////*/} -
- - -