Merge branch 'feature/amin_change_passenger_boss' into 'develop'
change approved amount title delete interest rate and history facility and... See merge request witel-front-end/loan-facilities/expert-v2!3
This commit is contained in:
@@ -43,7 +43,6 @@
|
|||||||
"sidebar": {
|
"sidebar": {
|
||||||
"dashboard": "داشبورد",
|
"dashboard": "داشبورد",
|
||||||
"reports": "گزارشات",
|
"reports": "گزارشات",
|
||||||
"passenger-office-chief": "اداره مسافر",
|
|
||||||
"admin-setting": "تنظیمات ",
|
"admin-setting": "تنظیمات ",
|
||||||
"machinery-expert": "کارتابل کارشناسی",
|
"machinery-expert": "کارتابل کارشناسی",
|
||||||
"passenger-boss": "کارتابل کارگروه",
|
"passenger-boss": "کارتابل کارگروه",
|
||||||
@@ -67,7 +66,6 @@
|
|||||||
"reserve-loan": "وام های رزرو"
|
"reserve-loan": "وام های رزرو"
|
||||||
},
|
},
|
||||||
"secondary": {
|
"secondary": {
|
||||||
"passenger-office": "توزیع درخواست",
|
|
||||||
"passenger-boss": "کارگروه",
|
"passenger-boss": "کارگروه",
|
||||||
"refahi-province-manager": "رفاهی",
|
"refahi-province-manager": "رفاهی",
|
||||||
"refahi-loan-management": "رفاهی",
|
"refahi-loan-management": "رفاهی",
|
||||||
@@ -115,9 +113,7 @@
|
|||||||
"change_password": "تغییر رمز عبور",
|
"change_password": "تغییر رمز عبور",
|
||||||
"province_manager_page": "بررسی وام های تبصره 18",
|
"province_manager_page": "بررسی وام های تبصره 18",
|
||||||
"province_head_expert": "کارشناس ستادی",
|
"province_head_expert": "کارشناس ستادی",
|
||||||
"passenger_office_page": "اداره مسافر",
|
|
||||||
"loan_management_page": "مدیریت وام",
|
"loan_management_page": "مدیریت وام",
|
||||||
"machinary_office_page": "کارتابل کارشناسی",
|
|
||||||
"reserve_loans": "وام های رزرو",
|
"reserve_loans": "وام های رزرو",
|
||||||
"development_assistant_page": "معاون توسعه",
|
"development_assistant_page": "معاون توسعه",
|
||||||
"inspector_expert_page": "بازدید کارشناس",
|
"inspector_expert_page": "بازدید کارشناس",
|
||||||
@@ -182,25 +178,6 @@
|
|||||||
"success_static_text": "عملیات شما با موفقیت انجام شد",
|
"success_static_text": "عملیات شما با موفقیت انجام شد",
|
||||||
"pending": "در حال انجام..."
|
"pending": "در حال انجام..."
|
||||||
},
|
},
|
||||||
"PassengerOffice": {
|
|
||||||
"name": "نام",
|
|
||||||
"shenase_meli": "شناسه ملی",
|
|
||||||
"is_legal_person": "نوع شخص",
|
|
||||||
"haghighi": "حقیقی",
|
|
||||||
"hoghoghi": "حقوقی",
|
|
||||||
"id": "کد یکتا",
|
|
||||||
"national_id": "کد ملی",
|
|
||||||
"phone_number": "موبایل",
|
|
||||||
"created_at": "تاریخ درخواست",
|
|
||||||
"updated_at": "تاریخ بروزرسانی",
|
|
||||||
"navgan_id": "کد ناوگان",
|
|
||||||
"vehicle_type": "نوع ماشین",
|
|
||||||
"state_name": "وضعیت درخواست",
|
|
||||||
"confirm": "ارجاع به کارشناس ماشین آلات",
|
|
||||||
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
|
|
||||||
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
|
||||||
"excel_report": "گزارش اکسل"
|
|
||||||
},
|
|
||||||
"CommercialChief": {
|
"CommercialChief": {
|
||||||
"name": "نام",
|
"name": "نام",
|
||||||
"id": "کد یکتا",
|
"id": "کد یکتا",
|
||||||
@@ -215,7 +192,14 @@
|
|||||||
"NavganProvinceManager": {
|
"NavganProvinceManager": {
|
||||||
"name": "نام",
|
"name": "نام",
|
||||||
"id": "کد یکتا",
|
"id": "کد یکتا",
|
||||||
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
|
"repayment_period": "دوره باز پرداخت",
|
||||||
|
"committed_employment": "اشتغال ایجاد شده",
|
||||||
|
"existing_employment": "اشتغال موجود",
|
||||||
"city_name": "شهرستان",
|
"city_name": "شهرستان",
|
||||||
|
"facility_bank": "سهم بانک",
|
||||||
|
"facility_gov": "سهم دولت",
|
||||||
|
"facility_person": "سهم متقاضی",
|
||||||
"plate_number": "پلاک",
|
"plate_number": "پلاک",
|
||||||
"statement_count": "تعداد صورت وضعیت",
|
"statement_count": "تعداد صورت وضعیت",
|
||||||
"shenase_meli": "شناسه ملی",
|
"shenase_meli": "شناسه ملی",
|
||||||
@@ -228,7 +212,7 @@
|
|||||||
"national_id": "کد ملی",
|
"national_id": "کد ملی",
|
||||||
"phone_number": "موبایل",
|
"phone_number": "موبایل",
|
||||||
"proposed_amount": "مبلغ پیشنهادی",
|
"proposed_amount": "مبلغ پیشنهادی",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"created_at": "تاریخ درخواست",
|
"created_at": "تاریخ درخواست",
|
||||||
"updated_at": "تاریخ بروزرسانی",
|
"updated_at": "تاریخ بروزرسانی",
|
||||||
"navgan_id": "کد ناوگان",
|
"navgan_id": "کد ناوگان",
|
||||||
@@ -312,6 +296,16 @@
|
|||||||
"excel_report": "گزارش اکسل",
|
"excel_report": "گزارش اکسل",
|
||||||
"city_name": "شهرستان",
|
"city_name": "شهرستان",
|
||||||
"plate_number": "پلاک",
|
"plate_number": "پلاک",
|
||||||
|
"existing_employment": "اشتغال موجود",
|
||||||
|
"bank_facility": "سهم بانک",
|
||||||
|
"facility_bank": "سهم بانک",
|
||||||
|
"government_facility": "سهم دولت",
|
||||||
|
"facility_gov": "سهم دولت",
|
||||||
|
"user_facility": "سهم متقاضی",
|
||||||
|
"facility_person": "سهم متقاضی",
|
||||||
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
|
"repayment_period": "دوره باز پرداخت",
|
||||||
|
"committed_employment": "اشتغال ایجاد شده",
|
||||||
"statement_count": "تعداد صورت وضعیت",
|
"statement_count": "تعداد صورت وضعیت",
|
||||||
"score": "اولویت",
|
"score": "اولویت",
|
||||||
"navgan_capacity": "ظرفیت",
|
"navgan_capacity": "ظرفیت",
|
||||||
@@ -326,7 +320,7 @@
|
|||||||
"tanafos_period": "دوره تنفس",
|
"tanafos_period": "دوره تنفس",
|
||||||
"province_name": "استان",
|
"province_name": "استان",
|
||||||
"proposed_amount": "مبلغ پیشنهادی",
|
"proposed_amount": "مبلغ پیشنهادی",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"created_at": "تاریخ درخواست",
|
"created_at": "تاریخ درخواست",
|
||||||
"updated_at": "تاریخ بروزرسانی",
|
"updated_at": "تاریخ بروزرسانی",
|
||||||
"navgan_id": "کد ناوگان",
|
"navgan_id": "کد ناوگان",
|
||||||
@@ -360,6 +354,13 @@
|
|||||||
"city_name": "شهرستان",
|
"city_name": "شهرستان",
|
||||||
"plate_number": "پلاک",
|
"plate_number": "پلاک",
|
||||||
"id": "کد یکتا",
|
"id": "کد یکتا",
|
||||||
|
"facility_bank": "سهم بانک",
|
||||||
|
"facility_gov": "سهم دولت",
|
||||||
|
"facility_person": "سهم متقاضی",
|
||||||
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
|
"repayment_period": "دوره باز پرداخت",
|
||||||
|
"committed_employment": "اشتغال ایجاد شده",
|
||||||
|
"existing_employment": "اشتغال موجود",
|
||||||
"statement_count": "تعداد صورت وضعیت",
|
"statement_count": "تعداد صورت وضعیت",
|
||||||
"shenase_meli": "شناسه ملی",
|
"shenase_meli": "شناسه ملی",
|
||||||
"is_legal_person": "نوع شخص",
|
"is_legal_person": "نوع شخص",
|
||||||
@@ -371,7 +372,7 @@
|
|||||||
"national_id": "کد ملی",
|
"national_id": "کد ملی",
|
||||||
"phone_number": "موبایل",
|
"phone_number": "موبایل",
|
||||||
"proposed_amount": "مبلغ پیشنهادی",
|
"proposed_amount": "مبلغ پیشنهادی",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"created_at": "تاریخ درخواست",
|
"created_at": "تاریخ درخواست",
|
||||||
"updated_at": "تاریخ بروزرسانی",
|
"updated_at": "تاریخ بروزرسانی",
|
||||||
"navgan_id": "کد ناوگان",
|
"navgan_id": "کد ناوگان",
|
||||||
@@ -394,12 +395,28 @@
|
|||||||
"vehicle_type": "نوع ماشین",
|
"vehicle_type": "نوع ماشین",
|
||||||
"state_name": "وضعیت درخواست"
|
"state_name": "وضعیت درخواست"
|
||||||
},
|
},
|
||||||
"MachinaryOffice": {
|
"ReserveLoan": {
|
||||||
"name": "نام",
|
"name": "نام",
|
||||||
|
"hoghoghi": "حقوقی",
|
||||||
|
"haghighi": "حقیقی",
|
||||||
"city_name": "شهرستان",
|
"city_name": "شهرستان",
|
||||||
"plate_number": "پلاک",
|
"plate_number": "پلاک",
|
||||||
"statement_count": "تعداد صورت وضعیت",
|
|
||||||
"id": "کد یکتا",
|
"id": "کد یکتا",
|
||||||
|
"existing_employment": "اشتغال موجود",
|
||||||
|
"approved_amount": "مبلغ مصوب",
|
||||||
|
"sakht_period": "دوره ساخت",
|
||||||
|
"tanafos_period": "دوره تنفس",
|
||||||
|
"bank_facility": "سهم بانک",
|
||||||
|
"facility_bank": "سهم بانک",
|
||||||
|
"government_facility": "سهم دولت",
|
||||||
|
"facility_gov": "سهم دولت",
|
||||||
|
"user_facility": "سهم متقاضی",
|
||||||
|
"facility_person": "سهم متقاضی",
|
||||||
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
|
"repayment_period": "دوره باز پرداخت",
|
||||||
|
"committed_employment": "اشتغال ایجاد شده",
|
||||||
|
"available_jobs": "اشتغال موجود",
|
||||||
|
"statement_count": "تعداد صورت وضعیت",
|
||||||
"score": "اولویت",
|
"score": "اولویت",
|
||||||
"navgan_capacity": "ظرفیت",
|
"navgan_capacity": "ظرفیت",
|
||||||
"manufacture_date": "سال ساخت",
|
"manufacture_date": "سال ساخت",
|
||||||
@@ -427,9 +444,7 @@
|
|||||||
"description-reserve-loan-first": "آیا از رزرو وام به کد یکتا",
|
"description-reserve-loan-first": "آیا از رزرو وام به کد یکتا",
|
||||||
"description-reserve-loan-second": "اطمینان دارید؟",
|
"description-reserve-loan-second": "اطمینان دارید؟",
|
||||||
"button-reserve-cancel": "بستن",
|
"button-reserve-cancel": "بستن",
|
||||||
"button-reserve-confirm": "رزرو"
|
"button-reserve-confirm": "رزرو",
|
||||||
},
|
|
||||||
"ReserveLoan": {
|
|
||||||
"title": "بازگردانی",
|
"title": "بازگردانی",
|
||||||
"description-loan-first": "آیا از بازگردانی وام به کد یکتا",
|
"description-loan-first": "آیا از بازگردانی وام به کد یکتا",
|
||||||
"description-loan-second": "اطمینان دارید؟",
|
"description-loan-second": "اطمینان دارید؟",
|
||||||
@@ -441,7 +456,7 @@
|
|||||||
"id": "کد یکتا",
|
"id": "کد یکتا",
|
||||||
"national_serial_number": "سریال پشت کارت ملی",
|
"national_serial_number": "سریال پشت کارت ملی",
|
||||||
"birthday": "تاریخ تولد",
|
"birthday": "تاریخ تولد",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"branch_name": "نام شعبه",
|
"branch_name": "نام شعبه",
|
||||||
"bank_state": "وضعیت پیگیری بانک",
|
"bank_state": "وضعیت پیگیری بانک",
|
||||||
"state_name": "وضعیت درخواست",
|
"state_name": "وضعیت درخواست",
|
||||||
@@ -478,12 +493,12 @@
|
|||||||
"context": "آیا از تایید این آیتم اطمینان دارید؟",
|
"context": "آیا از تایید این آیتم اطمینان دارید؟",
|
||||||
"button-cancel": "بستن",
|
"button-cancel": "بستن",
|
||||||
"button-confirm": "ارجاع",
|
"button-confirm": "ارجاع",
|
||||||
"bank_facility": "تسهیلات سهم بانک",
|
"facility_bank": "تسهیلات سهم بانک",
|
||||||
"user_facility": "تسهیلات سهم متقاضی",
|
"facility_person": "تسهیلات سهم متقاضی",
|
||||||
"government_facility": "تسهیلات سهم دولت",
|
"facility_gov": "تسهیلات سهم دولت",
|
||||||
"committed_employment": "تعداد اشتغال تعهد شده",
|
"committed_employment": "تعداد اشتغال تعهد شده",
|
||||||
"history_facilities": "سابقه استفاده از تسهیلات تکلیفی",
|
"history_facilities": "سابقه استفاده از تسهیلات تکلیفی",
|
||||||
"available_jobs": "تعداد اشتغال موجود",
|
"existing_employment": "تعداد اشتغال موجود",
|
||||||
"physical_progress": "درصد پیشرفت فیزیکی",
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
"interest_rate": "نرخ بهره",
|
"interest_rate": "نرخ بهره",
|
||||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||||
@@ -493,32 +508,32 @@
|
|||||||
"choose_file": "انتخاب فایل",
|
"choose_file": "انتخاب فایل",
|
||||||
"repayment_period": "دوره باز پرداخت",
|
"repayment_period": "دوره باز پرداخت",
|
||||||
"participation_period": "دوره مشارکت",
|
"participation_period": "دوره مشارکت",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"sakht_period": "دوره ساخت",
|
"sakht_period": "دوره ساخت",
|
||||||
"tanafos_period": "دوره تنفس",
|
"tanafos_period": "دوره تنفس",
|
||||||
"approved_amount_error": "وارد کردن مبلغ تصویب شده الزامیست",
|
"approved_amount_error": "وارد کردن مبلغ مصوب الزامیست",
|
||||||
"bank_facility_error": "وارد کردن تسهیلات سهم بانک الزامیست",
|
"facility_bank_error": "وارد کردن تسهیلات سهم بانک الزامیست",
|
||||||
"government_facility_error": "وارد کردن تسهیلات سهم دولت الزامیست",
|
"facility_gov_error": "وارد کردن تسهیلات سهم دولت الزامیست",
|
||||||
"committed_employment_error": "وارد کردن تعداد اشتغال تعهد شده الزامیست",
|
"committed_employment_error": "وارد کردن تعداد اشتغال تعهد شده الزامیست",
|
||||||
"history_facilities_error": "وارد کردن سابقه استفاده از تسهیلات تکلیفی الزامیست",
|
"history_facilities_error": "وارد کردن سابقه استفاده از تسهیلات تکلیفی الزامیست",
|
||||||
"available_jobs_error": "وارد کردن تعداد اشتغال موجود الزامیست",
|
"existing_employment_error": "وارد کردن تعداد اشتغال موجود الزامیست",
|
||||||
"sakht_period_error": "وارد کردن دوره ساخت الزامیست",
|
"sakht_period_error": "وارد کردن دوره ساخت الزامیست",
|
||||||
"tanafos_period_error": "وارد کردن دوره تنفس الزامیست",
|
"tanafos_period_error": "وارد کردن دوره تنفس الزامیست",
|
||||||
"approved_amount_positive": "مبلغ تصویب شده باید مثبت باشد",
|
"approved_amount_positive": "مبلغ مصوب باید مثبت باشد",
|
||||||
"bank_facility_positive": "تسهیلات سهم بانک باید مثبت باشد",
|
"facility_bank_positive": "تسهیلات سهم بانک باید مثبت باشد",
|
||||||
"repayment_period_positive": "دوره باز پرداخت باید مثبت باشد",
|
"repayment_period_positive": "دوره باز پرداخت باید مثبت باشد",
|
||||||
"participation_period_positive": "دوره مشارکت باید مثبت باشد",
|
"participation_period_positive": "دوره مشارکت باید مثبت باشد",
|
||||||
"government_facility_positive": "تسهیلات سهم دولت باید مثبت باشد",
|
"facility_gov_positive": "تسهیلات سهم دولت باید مثبت باشد",
|
||||||
"committed_employment_positive": "تعداد اشتغال تعهد شده باید مثبت باشد",
|
"committed_employment_positive": "تعداد اشتغال تعهد شده باید مثبت باشد",
|
||||||
"history_facilities_positive": "سابقه استفاده از تسهیلات تکلیفی باید مثبت باشد",
|
"history_facilities_positive": "سابقه استفاده از تسهیلات تکلیفی باید مثبت باشد",
|
||||||
"available_jobs_positive": "تعدلد اشتغال موجود باید مثبت باشد",
|
"existing_employment_positive": "تعدلد اشتغال موجود باید مثبت باشد",
|
||||||
"approved_amount_number": "مبلغ تصویب شده باید عدد باشد",
|
"approved_amount_number": "مبلغ مصوب باید عدد باشد",
|
||||||
"bank_facility_number": "تسهیلات سهم بانک باید عدد باشد",
|
"facility_bank_number": "تسهیلات سهم بانک باید عدد باشد",
|
||||||
"interest_rate_number": "نرخ بهره باید عدد باشد",
|
"interest_rate_number": "نرخ بهره باید عدد باشد",
|
||||||
"government_facility_number": "تسهیلات سهم دولت باید عدد باشد",
|
"facility_gov_number": "تسهیلات سهم دولت باید عدد باشد",
|
||||||
"committed_employment_number": "تعداد سابقه استفاده از تسهیلات تکلیفی باید عدد باشد",
|
"committed_employment_number": "تعداد سابقه استفاده از تسهیلات تکلیفی باید عدد باشد",
|
||||||
"history_facilities_number": "تعداد اشتغال تعهد شده باید عدد باشد",
|
"history_facilities_number": "تعداد اشتغال تعهد شده باید عدد باشد",
|
||||||
"available_jobs_number": "تعداد اشتغال موجود باید عدد باشد",
|
"existing_employment_number": "تعداد اشتغال موجود باید عدد باشد",
|
||||||
"sakht_period_positive": "دوره ساخت باید مثبت باشد",
|
"sakht_period_positive": "دوره ساخت باید مثبت باشد",
|
||||||
"interest_rate_positive": "نرخ بهره باید مثبت باشد",
|
"interest_rate_positive": "نرخ بهره باید مثبت باشد",
|
||||||
"tanafos_period_positive": "دوره تنفس باید مثبت باشد",
|
"tanafos_period_positive": "دوره تنفس باید مثبت باشد",
|
||||||
@@ -527,11 +542,15 @@
|
|||||||
"participation_period_number": "دوره مشارکت باید عدد باشد",
|
"participation_period_number": "دوره مشارکت باید عدد باشد",
|
||||||
"tanafos_period_number": "دوره تنفس باید عدد باشد",
|
"tanafos_period_number": "دوره تنفس باید عدد باشد",
|
||||||
"toman": "میلیون تومان",
|
"toman": "میلیون تومان",
|
||||||
"bank_facility_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
"facility_bank_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
||||||
"government_facility_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
"facility_gov_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
||||||
"tanafos_period_month": "ماه",
|
"tanafos_period_month": "ماه",
|
||||||
"approved_amount_title": "مبلغ تصویب شده کارگروه",
|
"repayment_period_month": "ماه",
|
||||||
"sakht_period_day": "روز",
|
"approved_amount_title": "مبلغ مصوب کارگروه",
|
||||||
|
"facility_bank_title": "سهم بانک",
|
||||||
|
"facility_gov_title": "سهم دولت",
|
||||||
|
"facility_person_title": "سهم متقاضی",
|
||||||
|
"sakht_period_day": "ماه",
|
||||||
"proposed_amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
|
"proposed_amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
|
||||||
"repayment_period_error": "وارد کردن دوره باز پرداخت الزامیست",
|
"repayment_period_error": "وارد کردن دوره باز پرداخت الزامیست",
|
||||||
"participation_period_error": "وارد کردن دوره مشارکت الزامیست",
|
"participation_period_error": "وارد کردن دوره مشارکت الزامیست",
|
||||||
@@ -562,18 +581,18 @@
|
|||||||
"choose_file": "انتخاب فایل"
|
"choose_file": "انتخاب فایل"
|
||||||
},
|
},
|
||||||
"EditDialog": {
|
"EditDialog": {
|
||||||
"edit_approved_amount": "ویرایش مبلغ تصویب شده",
|
"edit_approved_amount": "ویرایش مبلغ مصوب",
|
||||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||||
"optional": " (اختیاری)",
|
"optional": " (اختیاری)",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"button-cancel": "بستن",
|
"button-cancel": "بستن",
|
||||||
"button-edit": "ویرایش",
|
"button-edit": "ویرایش",
|
||||||
"edit_approved_amount_required": "وارد کردن مبلغ تصویب شده الزامیست",
|
"edit_approved_amount_required": "وارد کردن مبلغ مصوب الزامیست",
|
||||||
"unit": " (میلیون ریال)",
|
"unit": " (میلیون ریال)",
|
||||||
"button-revise": "ارسال",
|
"button-revise": "ارسال",
|
||||||
"approved_amount_positive": "مبلغ تصویب شده باید مثبت باشد",
|
"approved_amount_positive": "مبلغ مصوب باید مثبت باشد",
|
||||||
"max_amount": "حداکثر مبلغ تصویب شده {value} میلیون ریال می باشد",
|
"max_amount": "حداکثر مبلغ مصوب {value} میلیون ریال می باشد",
|
||||||
"approved_amount_number": "مبلغ تصویب شده باید عدد باشد",
|
"approved_amount_number": "مبلغ مصوب باید عدد باشد",
|
||||||
"description": "توضیحات خود را وارد نمائید"
|
"description": "توضیحات خود را وارد نمائید"
|
||||||
},
|
},
|
||||||
"UpdateDialog": {
|
"UpdateDialog": {
|
||||||
@@ -773,6 +792,16 @@
|
|||||||
"statement_count": "تعداد صورت وضعیت",
|
"statement_count": "تعداد صورت وضعیت",
|
||||||
"name": "نام",
|
"name": "نام",
|
||||||
"score": "اولویت",
|
"score": "اولویت",
|
||||||
|
"existing_employment": "اشتغال موجود",
|
||||||
|
"bank_facility": "سهم بانک",
|
||||||
|
"facility_bank": "سهم بانک",
|
||||||
|
"government_facility": "سهم دولت",
|
||||||
|
"facility_gov": "سهم دولت",
|
||||||
|
"user_facility": "سهم متقاضی",
|
||||||
|
"facility_person": "سهم متقاضی",
|
||||||
|
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||||
|
"committed_employment": "اشتغال ایجاد شده",
|
||||||
|
"available_jobs": "اشتغال موجود",
|
||||||
"navgan_capacity": "ظرفیت",
|
"navgan_capacity": "ظرفیت",
|
||||||
"manufacture_date": "سال ساخت",
|
"manufacture_date": "سال ساخت",
|
||||||
"shenase_meli": "شناسه ملی",
|
"shenase_meli": "شناسه ملی",
|
||||||
@@ -780,12 +809,13 @@
|
|||||||
"haghighi": "حقیقی",
|
"haghighi": "حقیقی",
|
||||||
"hoghoghi": "حقوقی",
|
"hoghoghi": "حقوقی",
|
||||||
"tanafos_period": "دوره تنفس",
|
"tanafos_period": "دوره تنفس",
|
||||||
|
"repayment_period": "دوره بازپرداخت",
|
||||||
"sakht_period": "دوره ساخت",
|
"sakht_period": "دوره ساخت",
|
||||||
"national_id": "کد ملی",
|
"national_id": "کد ملی",
|
||||||
"postal_code": "کد پستی",
|
"postal_code": "کد پستی",
|
||||||
"phone_number": "موبایل",
|
"phone_number": "موبایل",
|
||||||
"proposed_amount": "مبلغ پیشنهادی",
|
"proposed_amount": "مبلغ پیشنهادی",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ مصوب",
|
||||||
"created_at": "تاریخ درخواست",
|
"created_at": "تاریخ درخواست",
|
||||||
"updated_at": "تاریخ بروزرسانی",
|
"updated_at": "تاریخ بروزرسانی",
|
||||||
"navgan_id": "کد ناوگان",
|
"navgan_id": "کد ناوگان",
|
||||||
|
|||||||
@@ -304,25 +304,6 @@ function DashboardLoanHistoryComponent() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorFn: (row) => row.proposed_amount,
|
|
||||||
id: "proposed_amount",
|
|
||||||
header: t("LoanHistory.proposed_amount"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.approved_amount,
|
accessorFn: (row) => row.approved_amount,
|
||||||
id: "approved_amount",
|
id: "approved_amount",
|
||||||
@@ -342,6 +323,101 @@ function DashboardLoanHistoryComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_bank,
|
||||||
|
id: "facility_bank",
|
||||||
|
header: t("LoanHistory.facility_bank"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_gov,
|
||||||
|
id: "facility_gov",
|
||||||
|
header: t("LoanHistory.facility_gov"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_person,
|
||||||
|
id: "facility_person",
|
||||||
|
header: t("LoanHistory.facility_person"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.physical_progress,
|
||||||
|
id: "physical_progress",
|
||||||
|
header: t("LoanHistory.physical_progress"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.repayment_period,
|
||||||
|
id: "repayment_period",
|
||||||
|
header: t("LoanHistory.repayment_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.sakht_period,
|
accessorFn: (row) => row.sakht_period,
|
||||||
id: "sakht_period",
|
id: "sakht_period",
|
||||||
@@ -370,6 +446,44 @@ function DashboardLoanHistoryComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.committed_employment,
|
||||||
|
id: "committed_employment",
|
||||||
|
header: t("LoanHistory.committed_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.existing_employment,
|
||||||
|
id: "existing_employment",
|
||||||
|
header: t("LoanHistory.existing_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.state_name,
|
accessorFn: (row) => row.state_name,
|
||||||
id: "state_name",
|
id: "state_name",
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
import {Button, CircularProgress} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useMemo, useState} from "react";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {EXPORT_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import moment from "jalali-moment";
|
|
||||||
import FileSaver from 'file-saver';
|
|
||||||
import DescriptionIcon from '@mui/icons-material/Description';
|
|
||||||
|
|
||||||
const PrintExcel = ({table}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [loading, setLoading] = useState(false)
|
|
||||||
const requestServer = useRequest({auth: true, pending: false, success: {notification: {show: false}}})
|
|
||||||
const {columnFilters, columnFilterFns, sorting} = table.getState()
|
|
||||||
const columns = table.getAllColumns()
|
|
||||||
|
|
||||||
const filterParams = useMemo(() => {
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
const filters = columnFilters.map((filter) => {
|
|
||||||
let datatype;
|
|
||||||
for (const i in columns) {
|
|
||||||
if (columns[i].id == filter.id) {
|
|
||||||
datatype = columns[i].columnDef.datatype;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
...filter, fn: columnFilterFns[filter.id], datatype: datatype,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
params.set("start", '0');
|
|
||||||
params.set("filters", JSON.stringify(filters ?? []));
|
|
||||||
params.set("sorting", JSON.stringify(sorting ?? []));
|
|
||||||
return params;
|
|
||||||
}, [columnFilters, columnFilterFns, sorting, columns,]);
|
|
||||||
|
|
||||||
|
|
||||||
const clickHandler = () => {
|
|
||||||
setLoading(true)
|
|
||||||
requestServer(`${EXPORT_MACHINARY_OFFICE}?${filterParams}`, 'get', {
|
|
||||||
auth: true,
|
|
||||||
requestOptions: {responseType: 'blob'}
|
|
||||||
}).then((response) => {
|
|
||||||
const filename = `خروجی کارتابل کارشناسی تاریخ_${moment().format('jYYYY_jMM_jDD')}.xlsx`;
|
|
||||||
FileSaver.saveAs(response.data, filename);
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setLoading(false)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
variant="contained"
|
|
||||||
size="small"
|
|
||||||
disabled={loading}
|
|
||||||
sx={{textTransform: "unset", alignSelf: "center"}}
|
|
||||||
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <DescriptionIcon/>}
|
|
||||||
onClick={clickHandler}
|
|
||||||
>
|
|
||||||
{t("MachinaryOffice.excel_report")}
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PrintExcel
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import PrintIcon from "@mui/icons-material/Print";
|
|
||||||
import {Button, CircularProgress} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useRouter} from "next/router";
|
|
||||||
import {useState} from "react";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {GET_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import usePrint from "@/lib/app/hooks/usePrint";
|
|
||||||
|
|
||||||
const PrintReport = () => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const router = useRouter()
|
|
||||||
const [loading, setLoading] = useState(false)
|
|
||||||
const requestServer = useRequest({auth: true, pending: false, success: {notification: {show: false}}})
|
|
||||||
const {setPrintPage, setPrintTitle} = usePrint()
|
|
||||||
const clickHandler = () => {
|
|
||||||
setLoading(true)
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("start", '0');
|
|
||||||
params.set("filters", '[]');
|
|
||||||
params.set("sorting", '[]');
|
|
||||||
requestServer(`${GET_MACHINARY_OFFICE}?${params}`, 'get').then((response) => {
|
|
||||||
const _data = response.data.data
|
|
||||||
setPrintPage(_data.length)
|
|
||||||
setPrintTitle(t('MachinaryOffice.print_report'))
|
|
||||||
sessionStorage.setItem('report-print', JSON.stringify(_data))
|
|
||||||
router.push('/dashboard/machinery-expert/prints/report')
|
|
||||||
}).catch(() => {
|
|
||||||
setLoading(false)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
variant="contained"
|
|
||||||
size="small"
|
|
||||||
disabled={loading}
|
|
||||||
sx={{textTransform: "unset", alignSelf: "center"}}
|
|
||||||
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <PrintIcon/>}
|
|
||||||
onClick={clickHandler}
|
|
||||||
>
|
|
||||||
{t("MachinaryOffice.print_report")}
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PrintReport
|
|
||||||
@@ -1,378 +0,0 @@
|
|||||||
import UploadSystem from "@/core/components/UploadSystem";
|
|
||||||
import useNotification from "@/lib/app/hooks/useNotification";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
FormHelperText,
|
|
||||||
Grid,
|
|
||||||
LinearProgress,
|
|
||||||
Stack,
|
|
||||||
TextField,
|
|
||||||
Typography
|
|
||||||
} from "@mui/material"
|
|
||||||
import {useFormik} from "formik";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {CONFIRM_MACHINARY_OFFICE, CONFIRM_MACHINARY_OFFICE_DETAILS} from "@/core/data/apiRoutes";
|
|
||||||
import {useEffect, useState} from "react";
|
|
||||||
import PriceField from "@/core/components/PriceField";
|
|
||||||
import * as Yup from "yup";
|
|
||||||
import CustomAccordion from "@/core/components/CustomAccordion";
|
|
||||||
import ImageContent from "@/core/components/ImageContent";
|
|
||||||
import SelectBox from "@/core/components/SelectBox";
|
|
||||||
|
|
||||||
const vehicle_amount = {
|
|
||||||
"اتوبوس": 7000,
|
|
||||||
"مینی بوس": 2000,
|
|
||||||
}
|
|
||||||
const ConfirmContent = ({mutate, setOpenConfirmDialog, rowId, vehicle_type, handleSizeChangeClick}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
|
||||||
const [fileType, setfileType] = useState(null);
|
|
||||||
const [fileName, setfileName] = useState(null);
|
|
||||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
|
||||||
const requestServer = useRequest({auth: true, notification: false})
|
|
||||||
const {update_notification} = useNotification()
|
|
||||||
const [accordionStates, setAccordionStates] = useState([]);
|
|
||||||
const [hasImageShown, setHasImageShown] = useState(false);
|
|
||||||
const [imageLink, setImageLink] = useState(null);
|
|
||||||
const [detailsList, setDetailsData] = useState(null);
|
|
||||||
const [loading, setLoading] = useState(true);
|
|
||||||
const [isSkeleton, setIsSkeleton] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
requestServer(`${CONFIRM_MACHINARY_OFFICE_DETAILS}/${rowId}`, 'get')
|
|
||||||
.then((response) => {
|
|
||||||
const booleanData = Array.from({length: response.data.data.attachment_files.length}, () => false);
|
|
||||||
setAccordionStates(booleanData);
|
|
||||||
setDetailsData(response.data)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setLoading(false);
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleAccordionChange = (index) => {
|
|
||||||
const newAccordionStates = accordionStates.map((state, i) => i === index ? !state : false);
|
|
||||||
setAccordionStates(newAccordionStates);
|
|
||||||
|
|
||||||
if (!newAccordionStates[index]) {
|
|
||||||
handleSizeChangeClick('sm');
|
|
||||||
setHasImageShown(false);
|
|
||||||
setIsSkeleton(false)
|
|
||||||
} else {
|
|
||||||
handleSizeChangeClick('xl');
|
|
||||||
setHasImageShown(true);
|
|
||||||
setImageLink(detailsList.data.attachment_files[index])
|
|
||||||
setIsSkeleton(true)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
|
||||||
proposed_amount: Yup.mixed()
|
|
||||||
.test(
|
|
||||||
"is-number",
|
|
||||||
`${t("ConfirmDialog.proposed_amount_number")}`,
|
|
||||||
(value) => !isNaN(value)
|
|
||||||
)
|
|
||||||
.test("max-amount", `${t("MachinaryOffice.max_amount", {value: parseInt(vehicle_amount[vehicle_type]).toLocaleString('en')})}`,
|
|
||||||
(value) => value <= vehicle_amount[vehicle_type])
|
|
||||||
.test("positive", `${t("ConfirmDialog.proposed_amount_positive")}`, (value) => value >= 0)
|
|
||||||
.required(t("ConfirmDialog.proposed_amount_error")),
|
|
||||||
sakht_period: Yup.mixed()
|
|
||||||
.test("is-number", `${t("ConfirmDialog.sakht_period_number")}`,
|
|
||||||
(value) => !isNaN(value))
|
|
||||||
.test("positive", `${t("ConfirmDialog.sakht_period_positive")}`, (value) => value > 0)
|
|
||||||
.required(t("ConfirmDialog.sakht_period_error")),
|
|
||||||
tanafos_period: Yup.mixed()
|
|
||||||
.test("is-number", `${t("ConfirmDialog.tanafos_period_number")}`,
|
|
||||||
(value) => !isNaN(value))
|
|
||||||
.test("positive", `${t("ConfirmDialog.tanafos_period_positive")}`, (value) => value > 0)
|
|
||||||
.required(t("ConfirmDialog.tanafos_period_error")),
|
|
||||||
confirm_img: Yup.mixed()
|
|
||||||
.required(t("MachinaryOffice.upload_file_required"))
|
|
||||||
.test('fileSize', `${t("MachinaryOffice.upload_file_unit")}`, (value) => {
|
|
||||||
return value.size <= 5 * 1024 * 1024;
|
|
||||||
})
|
|
||||||
.test('fileType', `${t("MachinaryOffice.upload_file_format")}`, (value) => {
|
|
||||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
|
|
||||||
return allowedTypes.includes(value.type);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
const formik = useFormik({
|
|
||||||
initialValues: {
|
|
||||||
description: "",
|
|
||||||
proposed_amount: "",
|
|
||||||
sakht_period: "",
|
|
||||||
tanafos_period: "",
|
|
||||||
confirm_img: null
|
|
||||||
}, validationSchema,
|
|
||||||
onSubmit: (values, {setSubmitting}) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("proposed_amount", values.proposed_amount);
|
|
||||||
formData.append("sakht_period", values.sakht_period);
|
|
||||||
formData.append("tanafos_period", values.tanafos_period);
|
|
||||||
if (values.description != "") formData.append("expert_description", values.description);
|
|
||||||
if (values.confirm_img != null) {
|
|
||||||
const attachments = [
|
|
||||||
{
|
|
||||||
title: "فایل ضمیمه کارتابل قیمت گذاری",
|
|
||||||
file: values.confirm_img
|
|
||||||
}
|
|
||||||
];
|
|
||||||
attachments.forEach((attachment, index) => {
|
|
||||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
|
||||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
requestServer(`${CONFIRM_MACHINARY_OFFICE}/${rowId}`, 'post', {
|
|
||||||
data: formData,
|
|
||||||
notification: true
|
|
||||||
}).then((response) => {
|
|
||||||
setOpenConfirmDialog(false)
|
|
||||||
mutate()
|
|
||||||
update_notification()
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setSubmitting(false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleDescriptionChange = (event) => {
|
|
||||||
formik.setFieldValue("description", event.target.value)
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUploadChange = (event) => {
|
|
||||||
const uploadedFile = event.target?.files?.[0];
|
|
||||||
if (uploadedFile) {
|
|
||||||
const fileType = event.target?.files?.[0].type;
|
|
||||||
const fileName = event.target?.files?.[0].name;
|
|
||||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
|
||||||
setfileType(fileType);
|
|
||||||
setfileName(fileName);
|
|
||||||
formik.setFieldValue("confirm_img", uploadedFile).then(() => {
|
|
||||||
formik.setFieldTouched("confirm_img", true);
|
|
||||||
})
|
|
||||||
setShowAddIcon(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleAmountChange = (event) => {
|
|
||||||
if (!isNaN(event.target.value)) {
|
|
||||||
formik.setFieldValue("proposed_amount", event.target.value)
|
|
||||||
} else {
|
|
||||||
formik.setFieldValue("proposed_amount", formik.values.proposed_amount)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const renderCustomAccordions = () => {
|
|
||||||
if (detailsList && detailsList.data && detailsList.data.attachment_files) {
|
|
||||||
return detailsList.data.attachment_files.map((file, index) => (
|
|
||||||
<CustomAccordion
|
|
||||||
key={index}
|
|
||||||
title={`${file.title}`}
|
|
||||||
hasOpened={accordionStates[index]}
|
|
||||||
hasAccordionOpened={null}
|
|
||||||
handleAccordionChange={() => handleAccordionChange(index)}
|
|
||||||
accordionIndex={index}
|
|
||||||
downloadFile={file.attachment}
|
|
||||||
/>
|
|
||||||
));
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DialogContent>
|
|
||||||
<Grid container spacing={2}>
|
|
||||||
<Grid item xs={hasImageShown ? 6 : 12}>
|
|
||||||
{loading ? <LinearProgress/> : renderCustomAccordions()}
|
|
||||||
<Stack spacing={2}>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="description"
|
|
||||||
multiline
|
|
||||||
rows={8}
|
|
||||||
label={<>
|
|
||||||
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
|
||||||
value={formik.values.description}
|
|
||||||
onChange={handleDescriptionChange}
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
sx={{mt: 1}}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<PriceField
|
|
||||||
name="proposed_amount"
|
|
||||||
label={<>
|
|
||||||
<span>{t("ConfirmDialog.proposed_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
|
||||||
type="text"
|
|
||||||
inputProps={{
|
|
||||||
inputMode: "number",
|
|
||||||
min: 0,
|
|
||||||
pattern: "[0-9]*",
|
|
||||||
}}
|
|
||||||
variant="outlined"
|
|
||||||
value={formik.values.proposed_amount}
|
|
||||||
onChange={handleAmountChange}
|
|
||||||
onBlur={formik.handleBlur("proposed_amount")}
|
|
||||||
error={
|
|
||||||
formik.touched.proposed_amount &&
|
|
||||||
Boolean(formik.errors.proposed_amount)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.proposed_amount && formik.errors.proposed_amount
|
|
||||||
}
|
|
||||||
sx={{mt: 1}}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<SelectBox
|
|
||||||
name="sakht_period"
|
|
||||||
label={t("ConfirmDialog.sakht_period")}
|
|
||||||
size="small"
|
|
||||||
value={formik.values.sakht_period}
|
|
||||||
selectType="sakht_period"
|
|
||||||
selectors={[
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
value: "30",
|
|
||||||
name: "1 ماه - 30 روز"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
value: "60",
|
|
||||||
name: "2 ماه - 60 روز"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
value: "90",
|
|
||||||
name: "3 ماه - 90 روز"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
value: "120",
|
|
||||||
name: "4 ماه - 120 روز"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
value: "150",
|
|
||||||
name: "5 ماه - 150 روز"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
value: "180",
|
|
||||||
name: "6 ماه - 180 روز"
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
schema={{value: 'value', name: 'name'}}
|
|
||||||
select={formik.values.sakht_period}
|
|
||||||
handleChange={(event) => {
|
|
||||||
formik.setFieldValue('sakht_period', event.target.value)
|
|
||||||
}}
|
|
||||||
setFieldTouched={formik.setFieldTouched}
|
|
||||||
error={formik.touched.sakht_period && Boolean(formik.errors.sakht_period)}
|
|
||||||
helperText={formik.touched.sakht_period && formik.errors.sakht_period}
|
|
||||||
onBlur={formik.handleBlur("sakht_period")}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<SelectBox
|
|
||||||
name="tanafos_period"
|
|
||||||
label={t("ConfirmDialog.tanafos_period")}
|
|
||||||
size="small"
|
|
||||||
value={formik.values.tanafos_period}
|
|
||||||
selectType="tanafos_period"
|
|
||||||
selectors={[
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
value: "1",
|
|
||||||
name: "1 ماه"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
value: "2",
|
|
||||||
name: "2 ماه"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
value: "3",
|
|
||||||
name: "3 ماه"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
value: "4",
|
|
||||||
name: "4 ماه"
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
schema={{value: 'value', name: 'name'}}
|
|
||||||
select={formik.values.tanafos_period}
|
|
||||||
handleChange={(event) => {
|
|
||||||
formik.setFieldValue('tanafos_period', event.target.value)
|
|
||||||
}}
|
|
||||||
setFieldTouched={formik.setFieldTouched}
|
|
||||||
error={formik.touched.tanafos_period && Boolean(formik.errors.tanafos_period)}
|
|
||||||
helperText={formik.touched.tanafos_period && formik.errors.tanafos_period}
|
|
||||||
onBlur={formik.handleBlur("tanafos_period")}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<Typography>{t("MachinaryOffice.upload_file")}</Typography>
|
|
||||||
<UploadSystem
|
|
||||||
selectedImage={selectedImage}
|
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
|
||||||
setselectedImage={setSelectedImage}
|
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
|
||||||
fieldname="confirm_img"
|
|
||||||
fileType={fileType}
|
|
||||||
fileName={fileName}
|
|
||||||
imageAlt={t("app_name")}
|
|
||||||
imageSize={[250, 150]}
|
|
||||||
onBlur={formik.handleBlur("confirm_img")}
|
|
||||||
error={
|
|
||||||
formik.touched.confirm_img &&
|
|
||||||
Boolean(formik.errors.confirm_img)
|
|
||||||
}
|
|
||||||
setShowAddIcon={setShowAddIcon}
|
|
||||||
showAddIcon={showAddIcon}
|
|
||||||
/>
|
|
||||||
<FormHelperText
|
|
||||||
error={Boolean(formik.errors.confirm_img)}
|
|
||||||
>
|
|
||||||
{formik.touched.confirm_img && formik.errors.confirm_img}
|
|
||||||
</FormHelperText>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6}>
|
|
||||||
<Stack sx={{
|
|
||||||
display: hasImageShown ? 'flex' : 'none',
|
|
||||||
alignItems: 'center',
|
|
||||||
gap: 0.5,
|
|
||||||
justifyContent: 'center'
|
|
||||||
}}>
|
|
||||||
<ImageContent imageLink={imageLink} isSkeleton={isSkeleton} setIsSkeleton={setIsSkeleton}/>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary"
|
|
||||||
disabled={formik.isSubmitting} autoFocus>
|
|
||||||
{t("ConfirmDialog.button-cancel")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
|
||||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}>
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
export default ConfirmContent
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
import {Dialog, DialogTitle, IconButton, Tooltip} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useEffect, useState} from "react";
|
|
||||||
import ConfirmContent from "./ConfirmContent";
|
|
||||||
import CallMadeIcon from '@mui/icons-material/CallMade';
|
|
||||||
|
|
||||||
const Confirm = ({rowId, mutate, vehicle_type}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
|
||||||
const [dialogSize, setDialogSize] = useState('sm');
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!openConfirmDialog) {
|
|
||||||
setDialogSize('sm');
|
|
||||||
}
|
|
||||||
}, [openConfirmDialog]);
|
|
||||||
|
|
||||||
const handleSizeChangeClick = (size) => {
|
|
||||||
setDialogSize(size);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Tooltip title={t("ConfirmDialog.confirm")}>
|
|
||||||
<IconButton
|
|
||||||
color="primary"
|
|
||||||
onClick={() => {
|
|
||||||
setOpenConfirmDialog(true)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CallMadeIcon/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Dialog fullWidth open={openConfirmDialog}
|
|
||||||
PaperProps={{
|
|
||||||
sx: {
|
|
||||||
transition: 'all .3s',
|
|
||||||
boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'
|
|
||||||
}
|
|
||||||
}} maxWidth={dialogSize}>
|
|
||||||
<DialogTitle>{t("MachinaryOffice.confirm")}</DialogTitle>
|
|
||||||
<ConfirmContent mutate={mutate} rowId={rowId} setOpenConfirmDialog={setOpenConfirmDialog}
|
|
||||||
handleSizeChangeClick={handleSizeChangeClick}
|
|
||||||
vehicle_type={vehicle_type}/>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
export default Confirm;
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
import UploadSystem from "@/core/components/UploadSystem"
|
|
||||||
import useNotification from "@/lib/app/hooks/useNotification";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {Button, DialogActions, DialogContent, FormHelperText, Stack, TextField, Typography} from "@mui/material"
|
|
||||||
import {useFormik} from "formik";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import * as Yup from "yup";
|
|
||||||
import {REJECT_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
|
|
||||||
const RejectContent = ({rowId, mutate, setOpenRejectDialog}) => {
|
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
|
||||||
const [fileType, setfileType] = useState(null);
|
|
||||||
const [fileName, setfileName] = useState(null);
|
|
||||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
|
||||||
const t = useTranslations();
|
|
||||||
const requestServer = useRequest({auth: true})
|
|
||||||
const {update_notification} = useNotification()
|
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
|
||||||
description: Yup.string().required(t("RejectDialog.description_error")),
|
|
||||||
reject_img: Yup.mixed().notRequired(t("RejectDialog.choose_file"))
|
|
||||||
.test('fileSize', `${t("MachinaryOffice.upload_file_unit")}`, (value) => {
|
|
||||||
return !value || (value.size && value.size <= 5 * 1024 * 1024);
|
|
||||||
})
|
|
||||||
.test('fileType', `${t("MachinaryOffice.upload_file_format")}`, (value) => {
|
|
||||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types
|
|
||||||
return !value || (value.type && allowedTypes.includes(value.type));
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const formik = useFormik({
|
|
||||||
initialValues: {
|
|
||||||
description: "",
|
|
||||||
reject_img: null
|
|
||||||
},
|
|
||||||
validationSchema,
|
|
||||||
onSubmit: (values, {setSubmitting}) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("expert_description", values.description);
|
|
||||||
if (values.reject_img != null) {
|
|
||||||
const attachments = [
|
|
||||||
{
|
|
||||||
title: "فایل ضمیمه کارتابل قیمت گذاری",
|
|
||||||
file: values.reject_img
|
|
||||||
}
|
|
||||||
];
|
|
||||||
attachments.forEach((attachment, index) => {
|
|
||||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
|
||||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
requestServer(`${REJECT_MACHINARY_OFFICE}/${rowId}`, 'post', {
|
|
||||||
data: formData,
|
|
||||||
}).then((response) => {
|
|
||||||
setOpenRejectDialog(false)
|
|
||||||
mutate()
|
|
||||||
update_notification()
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setSubmitting(false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleDescriptionChange = (event) => {
|
|
||||||
formik.setFieldValue("description", event.target.value);
|
|
||||||
formik.handleChange(event);
|
|
||||||
};
|
|
||||||
const handleUploadChange = (event) => {
|
|
||||||
const uploadedFile = event.target?.files?.[0];
|
|
||||||
if (uploadedFile) {
|
|
||||||
const fileType = event.target?.files?.[0].type;
|
|
||||||
const fileName = event.target?.files?.[0].name;
|
|
||||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
|
||||||
setfileType(fileType);
|
|
||||||
setfileName(fileName);
|
|
||||||
formik.setFieldValue("reject_img", uploadedFile).then(() => {
|
|
||||||
formik.setFieldTouched("reject_img", true);
|
|
||||||
})
|
|
||||||
setShowAddIcon(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DialogContent>
|
|
||||||
<Stack spacing={2}>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="description"
|
|
||||||
multiline
|
|
||||||
rows={8}
|
|
||||||
label={t("RejectDialog.description")}
|
|
||||||
value={formik.values.description}
|
|
||||||
onChange={handleDescriptionChange}
|
|
||||||
onBlur={formik.handleBlur("description")}
|
|
||||||
error={
|
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
|
||||||
}
|
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
sx={{mt: 1}}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
|
||||||
<UploadSystem
|
|
||||||
selectedImage={selectedImage}
|
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
|
||||||
setselectedImage={setSelectedImage}
|
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
|
||||||
fieldname="reject_img"
|
|
||||||
fileType={fileType}
|
|
||||||
fileName={fileName}
|
|
||||||
imageAlt={t("app_name")}
|
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
|
||||||
setShowAddIcon={setShowAddIcon}
|
|
||||||
showAddIcon={showAddIcon}
|
|
||||||
onBlur={() => formik.handleBlur("reject_img")}
|
|
||||||
error={
|
|
||||||
formik.touched.reject_img &&
|
|
||||||
Boolean(formik.errors.reject_img)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<FormHelperText
|
|
||||||
error={Boolean(formik.errors.reject_img)}
|
|
||||||
>
|
|
||||||
{formik.touched.reject_img && formik.errors.reject_img}
|
|
||||||
</FormHelperText>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => setOpenRejectDialog(false)} variant="outlined" color="secondary"
|
|
||||||
disabled={formik.isSubmitting} autoFocus>
|
|
||||||
{t("RejectDialog.button-cancel")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
|
||||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}>
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default RejectContent
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import {Dialog, DialogTitle, IconButton, Tooltip} from "@mui/material"
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import RejectContent from "./RejectContent";
|
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
|
||||||
|
|
||||||
const Reject = ({rowId, mutate}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [openRejectDialog, setOpenRejectDialog] = useState(false);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Tooltip title={t("RejectDialog.reject")}>
|
|
||||||
<IconButton color="primary" onClick={() => setOpenRejectDialog(true)}>
|
|
||||||
<ThumbDownIcon/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Dialog fullWidth open={openRejectDialog}
|
|
||||||
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
|
||||||
<RejectContent mutate={mutate} rowId={rowId} setOpenRejectDialog={setOpenRejectDialog}/>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default Reject
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import {
|
|
||||||
Button,
|
|
||||||
Dialog,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
DialogTitle,
|
|
||||||
IconButton,
|
|
||||||
Tooltip, Typography
|
|
||||||
} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import RepartitionIcon from '@mui/icons-material/Repartition';
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import useNotification from "@/lib/app/hooks/useNotification";
|
|
||||||
import {RESERVE_MACHINARY_LOAN} from "@/core/data/apiRoutes";
|
|
||||||
|
|
||||||
const ReserveForm = ({rowId, mutate}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
|
||||||
const requestServer = useRequest({auth: true, notification: true});
|
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
||||||
const {update_notification} = useNotification()
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
|
||||||
setIsSubmitting(true)
|
|
||||||
requestServer(`${RESERVE_MACHINARY_LOAN}/${rowId}`, 'post').then((response) => {
|
|
||||||
setOpenConfirmDialog(false)
|
|
||||||
mutate()
|
|
||||||
update_notification()
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setIsSubmitting(false)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Tooltip title={t("MachinaryOffice.button-reserve-confirm")}>
|
|
||||||
<IconButton
|
|
||||||
color="primary"
|
|
||||||
onClick={() => {
|
|
||||||
setOpenConfirmDialog(true)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<RepartitionIcon/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Dialog
|
|
||||||
open={openConfirmDialog}
|
|
||||||
PaperProps={{
|
|
||||||
sx: {
|
|
||||||
transition: 'all .3s',
|
|
||||||
boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
maxWidth="sm"
|
|
||||||
>
|
|
||||||
<DialogTitle>
|
|
||||||
{t("MachinaryOffice.reserve-loan-title")}
|
|
||||||
</DialogTitle>
|
|
||||||
<DialogContent>
|
|
||||||
<Typography> {t("MachinaryOffice.description-reserve-loan-first")} {rowId} {t("MachinaryOffice.description-reserve-loan-second")}</Typography>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary" disabled={isSubmitting}>{t("MachinaryOffice.button-reserve-cancel")}</Button>
|
|
||||||
<Button onClick={() => handleSubmit()} variant="contained" color="primary" disabled={isSubmitting}>
|
|
||||||
{t("MachinaryOffice.button-reserve-confirm")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
export default ReserveForm;
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
import PrintablePage from "@/core/components/PrintablePage";
|
|
||||||
import {Box, Stack, Typography} from "@mui/material";
|
|
||||||
|
|
||||||
const Content = ({data}) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<PrintablePage key={data.id} header={true} footer={true}>
|
|
||||||
<Box sx={{mt: 6}}>
|
|
||||||
<Typography
|
|
||||||
sx={{
|
|
||||||
fontFamily: 'Bnazanin',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
fontSize: '1.2rem',
|
|
||||||
textAlign: 'center'
|
|
||||||
}}> {'گزارش کارشناسی ماشین آلات'} </Typography>
|
|
||||||
</Box>
|
|
||||||
<Box textAlign={'justify'} sx={{lineHeight: '1.8', mt: 2}}>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', pl: 4}}> {'با توجه به نامه شماره'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'معاون محترم برنامه ریزی سازمان راهداری و حمل و نقل جاده ای در خصوص تسهیلات بند (الف) تبصره (18) قانون بودجه سال'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'موضوع بازسازی ناوگان اتوبوس و مینی بوس و نیز تصویب آن درشورای برنامه ریزی و توسعه استان'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و نامه شماره'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>35482</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'مورخ'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'اداره کل راهداری و حمل و نقل جاده ای'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'در خصوص استفاده از ظرفیت انجمن های صنفی رانندگان در تاریخ'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>1402/08/20</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'از ناوگان اتوبوس/مینی بوس به شماره پلاک انتظامی'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>25پ4582</Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}> {'و شماره هوشمند ناوگان'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>5875698725</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'به مالکیت آقای'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>امیرحسین محمودی</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'با کد ملی'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>0311318897</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'و شماره تماس'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>09120630655</Typography>
|
|
||||||
<Typography component={'span'} sx={{fontFamily: 'Bnazanin'}}> {'ساکن شهرستان'} </Typography>
|
|
||||||
<Typography component={'span'}
|
|
||||||
sx={{fontFamily: 'Bnazanin', fontWeight: 'bold'}}>تهران</Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}
|
|
||||||
component={'span'}> {'در جلسه مطرح شد که نتیجه آن به شرح ذیل مورد تایید می باشد.'} </Typography>
|
|
||||||
</Box>
|
|
||||||
<Box sx={{border: 1, borderRadius: 1, mt: 3, p: 2}}>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}> {'مبلغ پیشنهادی به عدد .............................................. ریال و به حروف ...................................................................... ریال می باشد.'} </Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{
|
|
||||||
lineBreak: 'anywhere',
|
|
||||||
fontFamily: 'Bnazanin',
|
|
||||||
}}> {'توضیحات : ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................'} </Typography>
|
|
||||||
<Stack direction={'row'} justifyContent={'space-between'}>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}> {'نام و نام خانوادگی کارشناس:'} </Typography>
|
|
||||||
<Typography
|
|
||||||
sx={{fontFamily: 'Bnazanin'}}> {'تاریخ و امضاء'} </Typography>
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
</PrintablePage>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Content
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
import {useEffect, useState} from "react";
|
|
||||||
import CenterLayout from "@/layouts/CenterLayout";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {Stack, Typography} from "@mui/material";
|
|
||||||
import Content from "@/components/dashboard/machinary-office/Prints/report/Content";
|
|
||||||
|
|
||||||
const ReportComponent = () => {
|
|
||||||
const t = useTranslations()
|
|
||||||
const [data, setData] = useState(null)
|
|
||||||
const [loading, setLoading] = useState(true)
|
|
||||||
const [isNotData, setIsNotData] = useState(true)
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (sessionStorage.getItem('report-print') === null) {
|
|
||||||
setLoading(false)
|
|
||||||
setIsNotData(true)
|
|
||||||
sessionStorage.setItem('report-print', 'seen')
|
|
||||||
} else if (sessionStorage.getItem('report-print') === 'seen') {
|
|
||||||
setLoading(false)
|
|
||||||
setData(null)
|
|
||||||
setIsNotData(true)
|
|
||||||
} else if (data) {
|
|
||||||
setLoading(false)
|
|
||||||
sessionStorage.setItem('report-print', 'seen')
|
|
||||||
setIsNotData(false)
|
|
||||||
} else {
|
|
||||||
setLoading(true)
|
|
||||||
setData(JSON.parse(sessionStorage.getItem('report-print')))
|
|
||||||
setIsNotData(true)
|
|
||||||
}
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack sx={{bgcolor: '#efefef', width: isNotData ? '100%' : 'auto', height: isNotData ? '100%' : 'auto'}}>
|
|
||||||
{loading ? (
|
|
||||||
<CenterLayout>
|
|
||||||
<Stack>
|
|
||||||
<Typography variant={'h5'}>
|
|
||||||
{t('print_loading')}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
</CenterLayout>
|
|
||||||
) : !data ? (
|
|
||||||
<CenterLayout>
|
|
||||||
<Typography variant={'h5'}>
|
|
||||||
{t('data_not_found')}
|
|
||||||
</Typography>
|
|
||||||
</CenterLayout>
|
|
||||||
) : !data.length ? (
|
|
||||||
<CenterLayout>
|
|
||||||
<Typography variant={'h5'}>
|
|
||||||
{t('data_not_found')}
|
|
||||||
</Typography>
|
|
||||||
</CenterLayout>
|
|
||||||
) : data.map(item => <Content key={item.id} data={item}/>)}
|
|
||||||
</Stack>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ReportComponent
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import {Box} from "@mui/material";
|
|
||||||
import Confirm from "./Form/ConfirmForm";
|
|
||||||
import Reject from "./Form/RejectForm";
|
|
||||||
import ReserveForm from "@/components/dashboard/machinary-office/Form/ReserveForm";
|
|
||||||
|
|
||||||
const TableRow = ({row, mutate}) => {
|
|
||||||
return (
|
|
||||||
<Box sx={{display: "flex", flexWrap: "nowrap", gap: "8px"}}>
|
|
||||||
<Confirm
|
|
||||||
rowId={row.getValue("id")}
|
|
||||||
vehicle_type={row.original.vehicle_type}
|
|
||||||
mutate={mutate}
|
|
||||||
/>
|
|
||||||
<ReserveForm
|
|
||||||
rowId={row.getValue("id")}
|
|
||||||
mutate={mutate}
|
|
||||||
/>
|
|
||||||
<Reject
|
|
||||||
rowId={row.getValue("id")}
|
|
||||||
mutate={mutate}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default TableRow;
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import {Stack} from "@mui/material";
|
|
||||||
import PrintExcel from "@/components/dashboard/machinary-office/Buttons/printExcel";
|
|
||||||
|
|
||||||
const TableToolbar = ({table}) => {
|
|
||||||
return (
|
|
||||||
<Stack direction={"row"} spacing={2}>
|
|
||||||
{/*<PrintReport/>*/}
|
|
||||||
<PrintExcel table={table}/>
|
|
||||||
</Stack>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TableToolbar
|
|
||||||
@@ -1,331 +0,0 @@
|
|||||||
import {Box, Stack, Typography} from "@mui/material";
|
|
||||||
import {useMemo} from "react";
|
|
||||||
import {GET_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import TableRowActions from "./TableRowActions";
|
|
||||||
import moment from "jalali-moment";
|
|
||||||
import DataTable from "@/core/components/DataTable";
|
|
||||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
|
||||||
import TableToolbar from "@/components/dashboard/machinary-office/TableToolbar";
|
|
||||||
|
|
||||||
function DashboardMachinaryOfficeComponent() {
|
|
||||||
const t = useTranslations();
|
|
||||||
const columns = useMemo(
|
|
||||||
() => [
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.id,
|
|
||||||
id: "id",
|
|
||||||
header: t("MachinaryOffice.id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.score,
|
|
||||||
id: "score",
|
|
||||||
header: t("MachinaryOffice.score"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.is_legal_person,
|
|
||||||
id: "is_legal_person",
|
|
||||||
header: t("MachinaryOffice.is_legal_person"),
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: ["equals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography
|
|
||||||
variant="body2">{renderedCellValue === 1 ? `${t("MachinaryOffice.hoghoghi")}` : `${t("MachinaryOffice.haghighi")}`}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.navgan_id,
|
|
||||||
id: "navgan_id",
|
|
||||||
header: t("MachinaryOffice.navgan_id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.name,
|
|
||||||
id: "name",
|
|
||||||
header: t("MachinaryOffice.name"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.national_id,
|
|
||||||
id: "national_id",
|
|
||||||
header: t("MachinaryOffice.national_id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.shenase_meli,
|
|
||||||
id: "shenase_meli",
|
|
||||||
header: t("MachinaryOffice.shenase_meli"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.province_name,
|
|
||||||
id: "province_name",
|
|
||||||
header: t("MachinaryOffice.province_name"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.city_name,
|
|
||||||
id: "city_name",
|
|
||||||
header: t("MachinaryOffice.city_name"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) =>
|
|
||||||
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
|
|
||||||
id: "created_at",
|
|
||||||
header: t("MachinaryOffice.created_at"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "date",
|
|
||||||
filterFn: "lessThan",
|
|
||||||
columnFilterModeOptions: ["lessThan", "greaterThan"],
|
|
||||||
Cell: ({renderedCellValue}) => {
|
|
||||||
return <Typography variant="body2">{renderedCellValue}</Typography>;
|
|
||||||
},
|
|
||||||
Header: ({column}) => <>{column.columnDef.header}</>,
|
|
||||||
Filter: ({column}) => {
|
|
||||||
return (
|
|
||||||
<MuiDatePicker column={column}/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.phone_number,
|
|
||||||
id: "phone_number",
|
|
||||||
header: t("MachinaryOffice.phone_number"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.statement_count,
|
|
||||||
id: "statement_count",
|
|
||||||
header: t("MachinaryOffice.statement_count"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.navgan_capacity,
|
|
||||||
id: "navgan_capacity",
|
|
||||||
header: t("MachinaryOffice.navgan_capacity"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.manufacture_date,
|
|
||||||
id: "manufacture_date",
|
|
||||||
header: t("MachinaryOffice.manufacture_date"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.vehicle_type,
|
|
||||||
id: "vehicle_type",
|
|
||||||
header: t("MachinaryOffice.vehicle_type"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.plate_number,
|
|
||||||
id: "plate_number",
|
|
||||||
header: t("MachinaryOffice.plate_number"),
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Stack sx={{border: 1, borderColor: "divider", borderRadius: 1}} direction={'row'}>
|
|
||||||
<Stack sx={{borderRight: 1, borderColor: "divider", textAlign: 'center', width: "40%"}}>
|
|
||||||
{renderedCellValue.split('-')[3]}
|
|
||||||
</Stack>
|
|
||||||
<Stack direction={'row'} sx={{width: "100%", px: 0.5}}>
|
|
||||||
<Stack sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%"
|
|
||||||
}}>{renderedCellValue.split('-')[2]}</Stack>
|
|
||||||
<Stack sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%"
|
|
||||||
}}>{renderedCellValue.split('-')[1]}</Stack>
|
|
||||||
<Stack sx={{
|
|
||||||
textAlign: "center",
|
|
||||||
width: "100%"
|
|
||||||
}}>{renderedCellValue.split('-')[0]}</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.state_name,
|
|
||||||
id: "state_id",
|
|
||||||
header: t("MachinaryOffice.state_name"),
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "numeric",
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<Box sx={{px: 3}}>
|
|
||||||
<DataTable
|
|
||||||
tableUrl={GET_MACHINARY_OFFICE}
|
|
||||||
columns={columns}
|
|
||||||
selectableRow={false}
|
|
||||||
enableCustomToolbar={true}
|
|
||||||
CustomToolbar={TableToolbar}
|
|
||||||
enableLastUpdate={true}
|
|
||||||
sorting={[{
|
|
||||||
id: 'score', desc: false
|
|
||||||
}]}
|
|
||||||
enablePinning={true}
|
|
||||||
enableDensityToggle={false}
|
|
||||||
initialState={{density: 'compact'}} //compact (small) //comfortable (medium) //spacious (large)
|
|
||||||
enableColumnFilters={true}
|
|
||||||
enableHiding={true}
|
|
||||||
enableFullScreenToggle={false}
|
|
||||||
enableGlobalFilter={false}
|
|
||||||
enableColumnResizing={false} // if you want true this you shold change renderRowActions props ** see https://www.material-react-table.com/docs/guides/row-actions
|
|
||||||
enableRowActions={true}
|
|
||||||
TableRowAction={TableRowActions}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default DashboardMachinaryOfficeComponent;
|
|
||||||
@@ -289,25 +289,6 @@ function DashboardNavganLoanManagementComponent() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorFn: (row) => row.proposed_amount,
|
|
||||||
id: "proposed_amount",
|
|
||||||
header: t("NavganLoanManagement.proposed_amount"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.approved_amount,
|
accessorFn: (row) => row.approved_amount,
|
||||||
id: "approved_amount",
|
id: "approved_amount",
|
||||||
@@ -327,6 +308,101 @@ function DashboardNavganLoanManagementComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_bank,
|
||||||
|
id: "facility_bank",
|
||||||
|
header: t("NavganLoanManagement.facility_bank"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_gov,
|
||||||
|
id: "facility_gov",
|
||||||
|
header: t("NavganLoanManagement.facility_gov"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_person,
|
||||||
|
id: "facility_person",
|
||||||
|
header: t("NavganLoanManagement.facility_person"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.physical_progress,
|
||||||
|
id: "physical_progress",
|
||||||
|
header: t("NavganLoanManagement.physical_progress"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.repayment_period,
|
||||||
|
id: "repayment_period",
|
||||||
|
header: t("NavganLoanManagement.repayment_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.sakht_period,
|
accessorFn: (row) => row.sakht_period,
|
||||||
id: "sakht_period",
|
id: "sakht_period",
|
||||||
@@ -355,6 +431,44 @@ function DashboardNavganLoanManagementComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.committed_employment,
|
||||||
|
id: "committed_employment",
|
||||||
|
header: t("NavganLoanManagement.committed_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.existing_employment,
|
||||||
|
id: "existing_employment",
|
||||||
|
header: t("NavganLoanManagement.existing_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.state_name,
|
accessorFn: (row) => row.state_name,
|
||||||
id: "state_name",
|
id: "state_name",
|
||||||
|
|||||||
@@ -169,13 +169,23 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
|||||||
{loading ? <LinearProgress/> :
|
{loading ? <LinearProgress/> :
|
||||||
<>
|
<>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
showNumber={(detailsList?.data?.proposed_amount) / 1000000}
|
showNumber={(detailsList?.data?.approved_amount) / 1000000}
|
||||||
headerTitle={t("ConfirmDialog.proposed_amount")}
|
headerTitle={t("ConfirmDialog.approved_amount_title")}
|
||||||
unitTitle={t("ConfirmDialog.unit")}
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
/>
|
/>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
showNumber={(detailsList?.data?.approved_amount) / 1000000}
|
showNumber={(detailsList?.data?.bank_facility) / 1000000}
|
||||||
headerTitle={t("ConfirmDialog.approved_amount_title")}
|
headerTitle={t("ConfirmDialog.bank_facility_title")}
|
||||||
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={(detailsList?.data?.government_facility) / 1000000}
|
||||||
|
headerTitle={t("ConfirmDialog.government_facility_title")}
|
||||||
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={(detailsList?.data?.user_facility) / 1000000}
|
||||||
|
headerTitle={t("ConfirmDialog.user_facility_title")}
|
||||||
unitTitle={t("ConfirmDialog.unit")}
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
/>
|
/>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
@@ -188,6 +198,11 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
|||||||
headerTitle={t("ConfirmDialog.tanafos_period")}
|
headerTitle={t("ConfirmDialog.tanafos_period")}
|
||||||
unitTitle={t("ConfirmDialog.tanafos_period_month")}
|
unitTitle={t("ConfirmDialog.tanafos_period_month")}
|
||||||
/>
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={detailsList?.data?.repayment_period}
|
||||||
|
headerTitle={t("ConfirmDialog.repayment_period")}
|
||||||
|
unitTitle={t("ConfirmDialog.repayment_period_month")}
|
||||||
|
/>
|
||||||
{renderCustomAccordions()}
|
{renderCustomAccordions()}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,25 +232,6 @@ function DashboardNavganProvinceManagerComponent() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorFn: (row) => row.proposed_amount,
|
|
||||||
id: "proposed_amount",
|
|
||||||
header: t("NavganProvinceManager.proposed_amount"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.approved_amount,
|
accessorFn: (row) => row.approved_amount,
|
||||||
id: "approved_amount",
|
id: "approved_amount",
|
||||||
@@ -270,6 +251,101 @@ function DashboardNavganProvinceManagerComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_bank,
|
||||||
|
id: "facility_bank",
|
||||||
|
header: t("NavganProvinceManager.facility_bank"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_gov,
|
||||||
|
id: "facility_gov",
|
||||||
|
header: t("NavganProvinceManager.facility_gov"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_person,
|
||||||
|
id: "facility_person",
|
||||||
|
header: t("NavganProvinceManager.facility_person"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.physical_progress,
|
||||||
|
id: "physical_progress",
|
||||||
|
header: t("NavganProvinceManager.physical_progress"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.repayment_period,
|
||||||
|
id: "repayment_period",
|
||||||
|
header: t("NavganProvinceManager.repayment_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.sakht_period,
|
accessorFn: (row) => row.sakht_period,
|
||||||
id: "sakht_period",
|
id: "sakht_period",
|
||||||
@@ -298,6 +374,44 @@ function DashboardNavganProvinceManagerComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.committed_employment,
|
||||||
|
id: "committed_employment",
|
||||||
|
header: t("NavganProvinceManager.committed_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.existing_employment,
|
||||||
|
id: "existing_employment",
|
||||||
|
header: t("NavganProvinceManager.existing_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.state_name,
|
accessorFn: (row) => row.state_name,
|
||||||
id: "state_id",
|
id: "state_id",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {useState} from "react";
|
|||||||
import PriceField from "@/core/components/PriceField";
|
import PriceField from "@/core/components/PriceField";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import SelectBox from "@/core/components/SelectBox";
|
import SelectBox from "@/core/components/SelectBox";
|
||||||
|
import {useConfig} from "@/lib/app/hooks/useConfig";
|
||||||
|
|
||||||
const vehicle_amount = {
|
const vehicle_amount = {
|
||||||
"اتوبوس": 7000,
|
"اتوبوس": 7000,
|
||||||
@@ -25,17 +26,13 @@ const vehicle_amount = {
|
|||||||
|
|
||||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) => {
|
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
|
||||||
const [expertImg, setExpertImg] = useState("");
|
const [expertImg, setExpertImg] = useState("");
|
||||||
const [fileType, setFileType] = useState(null);
|
|
||||||
const [fileName, setFileName] = useState(null);
|
|
||||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
|
||||||
const [expertFileType, setExpertFileType] = useState(null);
|
const [expertFileType, setExpertFileType] = useState(null);
|
||||||
const [expertFileName, setExpertFileName] = useState(null);
|
const [expertFileName, setExpertFileName] = useState(null);
|
||||||
const [showExpertAddIcon, setShowExpertAddIcon] = useState(true);
|
const [showExpertAddIcon, setShowExpertAddIcon] = useState(true);
|
||||||
const requestServer = useRequest({auth: true, notification: false})
|
const requestServer = useRequest({auth: true, notification: false})
|
||||||
const {update_notification} = useNotification();
|
const {update_notification} = useNotification();
|
||||||
const [showFacility, setShowFacility] = useState(false)
|
const {config} = useConfig()
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
approved_amount: Yup.mixed().test(
|
approved_amount: Yup.mixed().test(
|
||||||
@@ -46,55 +43,24 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
(value) => value <= vehicle_amount[vehicle_type])
|
(value) => value <= vehicle_amount[vehicle_type])
|
||||||
.test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
|
.test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
|
||||||
.required(t("ConfirmDialog.approved_amount_error")),
|
.required(t("ConfirmDialog.approved_amount_error")),
|
||||||
bank_facility: Yup.mixed().test(
|
|
||||||
"is-number",
|
|
||||||
`${t("ConfirmDialog.bank_facility_number")}`,
|
|
||||||
(value) => !isNaN(value)
|
|
||||||
).test("positive", `${t("ConfirmDialog.bank_facility_positive")}`, (value) => value >= 0)
|
|
||||||
.test("max_bank", `${t("ConfirmDialog.bank_facility_max_amount")}`, function (value) {
|
|
||||||
const government_facility = this.parent.government_facility || 0;
|
|
||||||
const max_amount = (this.parent.approved_amount || 0) - government_facility;
|
|
||||||
return value <= max_amount;
|
|
||||||
})
|
|
||||||
.required(t("ConfirmDialog.bank_facility_error")),
|
|
||||||
government_facility: Yup.mixed()
|
|
||||||
.test(
|
|
||||||
"is-number",
|
|
||||||
`${t("ConfirmDialog.government_facility_number")}`,
|
|
||||||
(value) => !isNaN(value)
|
|
||||||
)
|
|
||||||
.test("positive", `${t("ConfirmDialog.government_facility_positive")}`, (value) => value >= 0)
|
|
||||||
.test("max_government", `${t("ConfirmDialog.government_facility_max_amount")}`, function (value) {
|
|
||||||
const bank_facility = this.parent.bank_facility || 0;
|
|
||||||
const max_amount = (this.parent.approved_amount || 0) - bank_facility;
|
|
||||||
return value <= max_amount;
|
|
||||||
})
|
|
||||||
.required(t("ConfirmDialog.government_facility_error")),
|
|
||||||
repayment_period: Yup.mixed().test(
|
repayment_period: Yup.mixed().test(
|
||||||
"is-number",
|
"is-number",
|
||||||
`${t("ConfirmDialog.repayment_period_number")}`,
|
`${t("ConfirmDialog.repayment_period_number")}`,
|
||||||
(value) => !isNaN(value)
|
(value) => !isNaN(value)
|
||||||
).test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
|
).test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
|
||||||
.required(t("ConfirmDialog.repayment_period_error")),
|
.required(t("ConfirmDialog.repayment_period_error")),
|
||||||
participation_period: Yup.mixed().test(
|
|
||||||
"is-number",
|
|
||||||
`${t("ConfirmDialog.participation_period_number")}`,
|
|
||||||
(value) => !isNaN(value)
|
|
||||||
).test("positive", `${t("ConfirmDialog.participation_period_positive")}`, (value) => value >= 0)
|
|
||||||
.required(t("ConfirmDialog.participation_period_error")),
|
|
||||||
|
|
||||||
committed_employment: Yup.mixed().test(
|
committed_employment: Yup.mixed().test(
|
||||||
"is-number",
|
"is-number",
|
||||||
`${t("ConfirmDialog.committed_employment_number")}`,
|
`${t("ConfirmDialog.committed_employment_number")}`,
|
||||||
(value) => !isNaN(value)
|
(value) => !isNaN(value)
|
||||||
).test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
|
).test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
|
||||||
.required(t("ConfirmDialog.committed_employment_error")),
|
.required(t("ConfirmDialog.committed_employment_error")),
|
||||||
available_jobs: Yup.mixed().test(
|
existing_employment: Yup.mixed().test(
|
||||||
"is-number",
|
"is-number",
|
||||||
`${t("ConfirmDialog.available_jobs_number")}`,
|
`${t("ConfirmDialog.existing_employment_number")}`,
|
||||||
(value) => !isNaN(value)
|
(value) => !isNaN(value)
|
||||||
).test("positive", `${t("ConfirmDialog.available_jobs_positive")}`, (value) => value >= 0)
|
).test("positive", `${t("ConfirmDialog.existing_employment_positive")}`, (value) => value >= 0)
|
||||||
.required(t("ConfirmDialog.available_jobs_error")),
|
.required(t("ConfirmDialog.existing_employment_error")),
|
||||||
sakht_period: Yup.mixed()
|
sakht_period: Yup.mixed()
|
||||||
.test("is-number", `${t("ConfirmDialog.sakht_period_number")}`,
|
.test("is-number", `${t("ConfirmDialog.sakht_period_number")}`,
|
||||||
(value) => !isNaN(value))
|
(value) => !isNaN(value))
|
||||||
@@ -105,21 +71,6 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
(value) => !isNaN(value))
|
(value) => !isNaN(value))
|
||||||
.test("positive", `${t("ConfirmDialog.tanafos_period_positive")}`, (value) => value > 0)
|
.test("positive", `${t("ConfirmDialog.tanafos_period_positive")}`, (value) => value > 0)
|
||||||
.required(t("ConfirmDialog.tanafos_period_error")),
|
.required(t("ConfirmDialog.tanafos_period_error")),
|
||||||
interest_rate: Yup.mixed()
|
|
||||||
.test("is-number", `${t("ConfirmDialog.interest_rate_number")}`,
|
|
||||||
(value) => !isNaN(value))
|
|
||||||
.test("positive", `${t("ConfirmDialog.interest_rate_positive")}`, (value) => value > 0)
|
|
||||||
.required(t("ConfirmDialog.interest_rate_error")),
|
|
||||||
confirm_img: Yup.mixed().notRequired(t("ConfirmDialog.approved_amount_error"))
|
|
||||||
.test('fileSize', `${t("PassengerBoss.upload_file_unit")}`, (value) => {
|
|
||||||
if (!value) return true
|
|
||||||
return value.size <= 5 * 1024 * 1024;
|
|
||||||
})
|
|
||||||
.test('fileType', `${t("PassengerBoss.upload_file_format")}`, (value) => {
|
|
||||||
if (!value) return true
|
|
||||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
|
|
||||||
return allowedTypes.includes(value.type);
|
|
||||||
}),
|
|
||||||
expert_img: Yup.mixed()
|
expert_img: Yup.mixed()
|
||||||
.required(t("PassengerBoss.upload_expert_file_required"))
|
.required(t("PassengerBoss.upload_expert_file_required"))
|
||||||
.test('fileSize', `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
|
.test('fileSize', `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
|
||||||
@@ -135,50 +86,31 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
initialValues: {
|
initialValues: {
|
||||||
description: "",
|
description: "",
|
||||||
approved_amount: "",
|
approved_amount: "",
|
||||||
bank_facility: "0",
|
facility_bank: "",
|
||||||
government_facility: "0",
|
facility_gov: "",
|
||||||
user_facility: "0",
|
facility_person: "",
|
||||||
physical_progress: "",
|
physical_progress: "",
|
||||||
repayment_period: "",
|
repayment_period: "",
|
||||||
participation_period: "",
|
|
||||||
interest_rate: "",
|
|
||||||
committed_employment: "",
|
committed_employment: "",
|
||||||
sakht_period: "",
|
sakht_period: "",
|
||||||
tanafos_period: "",
|
tanafos_period: "",
|
||||||
history_facilities: "0",
|
existing_employment: "",
|
||||||
available_jobs: "",
|
|
||||||
expert_img: null,
|
expert_img: null,
|
||||||
confirm_img: null,
|
|
||||||
}, validationSchema,
|
}, validationSchema,
|
||||||
onSubmit: (values, {setSubmitting}) => {
|
onSubmit: (values, {setSubmitting}) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("approved_amount", values.approved_amount);
|
formData.append("approved_amount", Number(values.approved_amount) * 1000000);
|
||||||
formData.append("bank_facility", values.bank_facility);
|
formData.append("facility_bank", Number(values.facility_bank) * 1000000);
|
||||||
formData.append("government_facility", values.government_facility);
|
formData.append("facility_gov", Number(values.facility_gov) * 1000000);
|
||||||
formData.append("user_facility", values.user_facility);
|
formData.append("facility_person", Number(values.facility_person) * 1000000);
|
||||||
formData.append("repayment_period", values.repayment_period);
|
formData.append("repayment_period", values.repayment_period);
|
||||||
formData.append("participation_period", values.participation_period);
|
|
||||||
formData.append("interest_rate", values.interest_rate);
|
|
||||||
formData.append("committed_employment", values.committed_employment);
|
formData.append("committed_employment", values.committed_employment);
|
||||||
formData.append("available_jobs", values.available_jobs);
|
formData.append("existing_employment", values.existing_employment);
|
||||||
formData.append("sakht_period", values.sakht_period);
|
formData.append("sakht_period", values.sakht_period);
|
||||||
formData.append("tanafos_period", values.tanafos_period);
|
formData.append("tanafos_period", values.tanafos_period);
|
||||||
formData.append("history_facilities", values.history_facilities);
|
|
||||||
|
|
||||||
if (values.description != "") formData.append("expert_description", values.description);
|
if (values.description != "") formData.append("expert_description", values.description);
|
||||||
if (values.physical_progress != "") formData.append("physical_progress", values.physical_progress);
|
if (values.physical_progress != "") formData.append("physical_progress", values.physical_progress);
|
||||||
if (values.confirm_img != null) {
|
|
||||||
const attachments = [
|
|
||||||
{
|
|
||||||
title: "فایل ضمیمه کارتابل کارگروه",
|
|
||||||
file: values.confirm_img
|
|
||||||
}
|
|
||||||
];
|
|
||||||
attachments.forEach((attachment, index) => {
|
|
||||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
|
||||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (values.expert_img != null) {
|
if (values.expert_img != null) {
|
||||||
const attachments = [
|
const attachments = [
|
||||||
{
|
{
|
||||||
@@ -206,20 +138,6 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleUploadChange = (event) => {
|
|
||||||
const uploadedFile = event.target?.files?.[0];
|
|
||||||
if (uploadedFile) {
|
|
||||||
const fileType = event.target?.files?.[0].type;
|
|
||||||
const fileName = event.target?.files?.[0].name;
|
|
||||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
|
||||||
setFileType(fileType);
|
|
||||||
setFileName(fileName);
|
|
||||||
formik.setFieldValue("confirm_img", uploadedFile).then(() => {
|
|
||||||
formik.setFieldTouched("confirm_img", true);
|
|
||||||
})
|
|
||||||
setShowAddIcon(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleExpertFileChange = (event) => {
|
const handleExpertFileChange = (event) => {
|
||||||
const uploadedFile = event.target?.files?.[0];
|
const uploadedFile = event.target?.files?.[0];
|
||||||
if (uploadedFile) {
|
if (uploadedFile) {
|
||||||
@@ -237,12 +155,12 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
const handleAmountChange = (event) => {
|
const handleAmountChange = (event) => {
|
||||||
if (!isNaN(event.target.value)) {
|
if (!isNaN(event.target.value)) {
|
||||||
formik.setFieldValue("approved_amount", event.target.value).then(() => {
|
formik.setFieldValue("approved_amount", event.target.value).then(() => {
|
||||||
formik.setFieldValue("user_facility", Number(event.target.value) - (Number(formik.values.bank_facility) + Number(formik.values.government_facility)))
|
formik.setFieldValue("facility_bank", (config.facility_bank / 100) * event.target.value)
|
||||||
|
formik.setFieldValue("facility_gov", (config.facility_gov / 100) * event.target.value)
|
||||||
|
formik.setFieldValue("facility_person", (config.facility_person / 100) * event.target.value)
|
||||||
})
|
})
|
||||||
event.target.value !== "" ? setShowFacility(true) : setShowFacility(false)
|
|
||||||
} else {
|
} else {
|
||||||
formik.setFieldValue("approved_amount", formik.values.approved_amount)
|
formik.setFieldValue("approved_amount", formik.values.approved_amount)
|
||||||
setShowFacility(false)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -292,9 +210,9 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<PriceField
|
<PriceField
|
||||||
name="bank_facility"
|
name="facility_bank"
|
||||||
label={<>
|
label={<>
|
||||||
<span>{t("ConfirmDialog.bank_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
<span>{t("ConfirmDialog.facility_bank")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||||
type="text"
|
type="text"
|
||||||
inputProps={{
|
inputProps={{
|
||||||
inputMode: "number",
|
inputMode: "number",
|
||||||
@@ -302,33 +220,16 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
pattern: "[0-9]*",
|
pattern: "[0-9]*",
|
||||||
}}
|
}}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={formik.values.bank_facility}
|
value={formik.values.facility_bank}
|
||||||
onChange={(event) => {
|
|
||||||
if (!isNaN(event.target.value)) {
|
|
||||||
formik.setFieldValue("bank_facility", event.target.value).then(() => {
|
|
||||||
formik.setFieldValue("user_facility", Number(formik.values.approved_amount) - (Number(event.target.value) + Number(formik.values.government_facility)))
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
formik.setFieldValue("bank_facility", formik.values.bank_facility)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onBlur={formik.handleBlur("bank_facility")}
|
|
||||||
error={
|
|
||||||
formik.touched.bank_facility &&
|
|
||||||
Boolean(formik.errors.bank_facility)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.bank_facility && formik.errors.bank_facility
|
|
||||||
}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
disabled={!showFacility}
|
disabled
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<PriceField
|
<PriceField
|
||||||
name="government_facility"
|
name="facility_gov"
|
||||||
label={<>
|
label={<>
|
||||||
<span>{t("ConfirmDialog.government_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
<span>{t("ConfirmDialog.facility_gov")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||||
type="text"
|
type="text"
|
||||||
inputProps={{
|
inputProps={{
|
||||||
inputMode: "number",
|
inputMode: "number",
|
||||||
@@ -336,35 +237,18 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
pattern: "[0-9]*",
|
pattern: "[0-9]*",
|
||||||
}}
|
}}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={formik.values.government_facility}
|
value={formik.values.facility_gov}
|
||||||
onChange={(event) => {
|
disabled
|
||||||
if (!isNaN(event.target.value)) {
|
|
||||||
formik.setFieldValue("government_facility", event.target.value).then(() => {
|
|
||||||
formik.setFieldValue("user_facility", Number(formik.values.approved_amount) - (Number(formik.values.bank_facility) + Number(event.target.value)))
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
formik.setFieldValue("government_facility", formik.values.government_facility)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onBlur={formik.handleBlur("government_facility")}
|
|
||||||
error={
|
|
||||||
formik.touched.government_facility &&
|
|
||||||
Boolean(formik.errors.government_facility)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.government_facility && formik.errors.government_facility
|
|
||||||
}
|
|
||||||
disabled={!showFacility}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<PriceField
|
<PriceField
|
||||||
name="user_facility"
|
name="facility_person"
|
||||||
label={<>
|
label={<>
|
||||||
<span>{t("ConfirmDialog.user_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
<span>{t("ConfirmDialog.facility_person")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={formik.values.user_facility}
|
value={formik.values.facility_person}
|
||||||
disabled
|
disabled
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
@@ -394,93 +278,28 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextField
|
<SelectBox
|
||||||
name="interest_rate"
|
|
||||||
label={t("ConfirmDialog.interest_rate")}
|
|
||||||
type="text"
|
|
||||||
inputProps={{
|
|
||||||
inputMode: "number",
|
|
||||||
min: 0,
|
|
||||||
pattern: "[0-9]*",
|
|
||||||
}}
|
|
||||||
variant="outlined"
|
|
||||||
value={formik.values.interest_rate}
|
|
||||||
onChange={(event) => {
|
|
||||||
if (isNaN(event.target.value) || event.target.value > 100) formik.setFieldValue("interest_rate", formik.values.interest_rate)
|
|
||||||
else
|
|
||||||
formik.setFieldValue("interest_rate", event.target.value)
|
|
||||||
}}
|
|
||||||
onBlur={formik.handleBlur("interest_rate")}
|
|
||||||
error={
|
|
||||||
formik.touched.interest_rate &&
|
|
||||||
Boolean(formik.errors.interest_rate)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.interest_rate && formik.errors.interest_rate
|
|
||||||
}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="repayment_period"
|
name="repayment_period"
|
||||||
label={<>
|
label={<>
|
||||||
<span>{t("ConfirmDialog.repayment_period")}</span> <small>{t("ConfirmDialog.month")}</small></>}
|
<span>{t("ConfirmDialog.repayment_period")}</span> <small>{t("ConfirmDialog.month")}</small></>}
|
||||||
type="text"
|
selectType="repayment_period"
|
||||||
inputProps={{
|
selectors={[
|
||||||
inputMode: "number",
|
{id : 0, value : "12", name : "12 ماه"},
|
||||||
min: 0,
|
{id : 1, value : "24", name : "24 ماه"},
|
||||||
pattern: "[0-9]*",
|
{id : 2, value : "36", name : "36 ماه"},
|
||||||
}}
|
{id : 3, value : "48", name : "48 ماه"},
|
||||||
variant="outlined"
|
{id : 4, value : "60", name : "60 ماه"}
|
||||||
|
]}
|
||||||
|
schema={{value: "value", name: "name"}}
|
||||||
|
select={formik.values.repayment_period}
|
||||||
value={formik.values.repayment_period}
|
value={formik.values.repayment_period}
|
||||||
onChange={(event) => {
|
handleChange={(event) => {
|
||||||
if (!isNaN(event.target.value)) {
|
formik.setFieldValue("repayment_period", event.target.value);
|
||||||
formik.setFieldValue("repayment_period", event.target.value)
|
|
||||||
} else {
|
|
||||||
formik.setFieldValue("repayment_period", formik.values.repayment_period)
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
setFieldTouched={formik.setFieldTouched}
|
||||||
|
error={formik.touched.repayment_period && Boolean(formik.errors.repayment_period)}
|
||||||
|
helperText={formik.touched.repayment_period && formik.errors.repayment_period}
|
||||||
onBlur={formik.handleBlur("repayment_period")}
|
onBlur={formik.handleBlur("repayment_period")}
|
||||||
error={
|
|
||||||
formik.touched.repayment_period &&
|
|
||||||
Boolean(formik.errors.repayment_period)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.repayment_period && formik.errors.repayment_period
|
|
||||||
}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="participation_period"
|
|
||||||
label={<>
|
|
||||||
<span>{t("ConfirmDialog.participation_period")}</span> <small>{t("ConfirmDialog.month")}</small></>}
|
|
||||||
type="text"
|
|
||||||
inputProps={{
|
|
||||||
inputMode: "number",
|
|
||||||
min: 0,
|
|
||||||
pattern: "[0-9]*",
|
|
||||||
}}
|
|
||||||
variant="outlined"
|
|
||||||
value={formik.values.participation_period}
|
|
||||||
onChange={(event) => {
|
|
||||||
if (!isNaN(event.target.value)) {
|
|
||||||
formik.setFieldValue("participation_period", event.target.value)
|
|
||||||
} else {
|
|
||||||
formik.setFieldValue("participation_period", formik.values.participation_period)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onBlur={formik.handleBlur("participation_period")}
|
|
||||||
error={
|
|
||||||
formik.touched.participation_period &&
|
|
||||||
Boolean(formik.errors.participation_period)
|
|
||||||
}
|
|
||||||
helperText={
|
|
||||||
formik.touched.participation_period && formik.errors.participation_period
|
|
||||||
}
|
|
||||||
fullWidth
|
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -605,8 +424,8 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextField
|
<TextField
|
||||||
name="available_jobs"
|
name="existing_employment"
|
||||||
label={t("ConfirmDialog.available_jobs")}
|
label={t("ConfirmDialog.existing_employment")}
|
||||||
type="text"
|
type="text"
|
||||||
inputProps={{
|
inputProps={{
|
||||||
inputMode: "number",
|
inputMode: "number",
|
||||||
@@ -614,44 +433,25 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
pattern: "[0-9]*",
|
pattern: "[0-9]*",
|
||||||
}}
|
}}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={formik.values.available_jobs}
|
value={formik.values.existing_employment}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
if (!isNaN(event.target.value)) {
|
if (!isNaN(event.target.value)) {
|
||||||
formik.setFieldValue("available_jobs", event.target.value)
|
formik.setFieldValue("existing_employment", event.target.value)
|
||||||
} else {
|
} else {
|
||||||
formik.setFieldValue("available_jobs", formik.values.available_jobs)
|
formik.setFieldValue("existing_employment", formik.values.existing_employment)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onBlur={formik.handleBlur("available_jobs")}
|
onBlur={formik.handleBlur("existing_employment")}
|
||||||
error={
|
error={
|
||||||
formik.touched.available_jobs &&
|
formik.touched.existing_employment &&
|
||||||
Boolean(formik.errors.available_jobs)
|
Boolean(formik.errors.existing_employment)
|
||||||
}
|
}
|
||||||
helperText={
|
helperText={
|
||||||
formik.touched.available_jobs && formik.errors.available_jobs
|
formik.touched.existing_employment && formik.errors.existing_employment
|
||||||
}
|
}
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
|
||||||
<SelectBox
|
|
||||||
name="history_facilities"
|
|
||||||
label={t("ConfirmDialog.history_facilities")}
|
|
||||||
size={'medium'}
|
|
||||||
value={formik.values.history_facilities}
|
|
||||||
selectType="history_facilities"
|
|
||||||
selectors={[{id: 1, value: "1", name: "دارد"}, {id: 0, value: "0", name: "ندارد"}]}
|
|
||||||
schema={{value: 'value', name: 'name'}}
|
|
||||||
select={formik.values.history_facilities}
|
|
||||||
handleChange={(event) => {
|
|
||||||
formik.setFieldValue('history_facilities', event.target.value)
|
|
||||||
}}
|
|
||||||
setFieldTouched={formik.setFieldTouched}
|
|
||||||
error={formik.touched.history_facilities && Boolean(formik.errors.history_facilities)}
|
|
||||||
helperText={formik.touched.history_facilities && formik.errors.history_facilities}
|
|
||||||
onBlur={formik.handleBlur("history_facilities")}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography>{t("PassengerBoss.upload_expert_img")}</Typography>
|
<Typography>{t("PassengerBoss.upload_expert_img")}</Typography>
|
||||||
<UploadSystem
|
<UploadSystem
|
||||||
@@ -678,32 +478,6 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
|||||||
{formik.touched.expert_img && formik.errors.expert_img}
|
{formik.touched.expert_img && formik.errors.expert_img}
|
||||||
</FormHelperText>
|
</FormHelperText>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
|
||||||
<Typography>{t("PassengerBoss.upload_file")}</Typography>
|
|
||||||
<UploadSystem
|
|
||||||
selectedImage={selectedImage}
|
|
||||||
handleUploadChange={handleUploadChange}
|
|
||||||
setselectedImage={setSelectedImage}
|
|
||||||
setFieldValue={formik.setFieldValue}
|
|
||||||
fieldname="confirm_img"
|
|
||||||
fileType={fileType}
|
|
||||||
fileName={fileName}
|
|
||||||
imageAlt={t("app_name")}
|
|
||||||
imageSize={[250, 150]}
|
|
||||||
onBlur={formik.handleBlur("confirm_img")}
|
|
||||||
error={
|
|
||||||
formik.touched.confirm_img &&
|
|
||||||
Boolean(formik.errors.confirm_img)
|
|
||||||
}
|
|
||||||
setShowAddIcon={setShowAddIcon}
|
|
||||||
showAddIcon={showAddIcon}
|
|
||||||
/>
|
|
||||||
<FormHelperText
|
|
||||||
error={Boolean(formik.errors.confirm_img)}
|
|
||||||
>
|
|
||||||
{formik.touched.confirm_img && formik.errors.confirm_img}
|
|
||||||
</FormHelperText>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
import {Button, CircularProgress} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useMemo, useState} from "react";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {EXPORT_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import moment from "jalali-moment";
|
|
||||||
import FileSaver from 'file-saver';
|
|
||||||
import DescriptionIcon from '@mui/icons-material/Description';
|
|
||||||
|
|
||||||
const PrintExcel = ({table}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [loading, setLoading] = useState(false)
|
|
||||||
const requestServer = useRequest({auth: true, pending: false, success: {notification: {show: false}}})
|
|
||||||
const {columnFilters, columnFilterFns, sorting} = table.getState()
|
|
||||||
const columns = table.getAllColumns()
|
|
||||||
|
|
||||||
const filterParams = useMemo(() => {
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
const filters = columnFilters.map((filter) => {
|
|
||||||
let datatype;
|
|
||||||
for (const i in columns) {
|
|
||||||
if (columns[i].id == filter.id) {
|
|
||||||
datatype = columns[i].columnDef.datatype;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
...filter, fn: columnFilterFns[filter.id], datatype: datatype,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
params.set("start", '0');
|
|
||||||
params.set("filters", JSON.stringify(filters ?? []));
|
|
||||||
params.set("sorting", JSON.stringify(sorting ?? []));
|
|
||||||
return params;
|
|
||||||
}, [columnFilters, columnFilterFns, sorting, columns,]);
|
|
||||||
|
|
||||||
|
|
||||||
const clickHandler = () => {
|
|
||||||
setLoading(true)
|
|
||||||
requestServer(`${EXPORT_PASSENGER_OFFICE}?${filterParams}`, 'get', {
|
|
||||||
auth: true,
|
|
||||||
notification: false,
|
|
||||||
requestOptions: {responseType: 'blob'}
|
|
||||||
}).then((response) => {
|
|
||||||
const filename = `گزارش اداره مسافر تاریخ_${moment().format('jYYYY_jMM_jDD')}.xlsx`;
|
|
||||||
FileSaver.saveAs(response.data, filename);
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setLoading(false)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
variant="contained"
|
|
||||||
size="small"
|
|
||||||
disabled={loading}
|
|
||||||
sx={{textTransform: "unset", alignSelf: "center"}}
|
|
||||||
startIcon={loading ? <CircularProgress size={18} color="inherit"/> : <DescriptionIcon/>}
|
|
||||||
onClick={clickHandler}
|
|
||||||
>
|
|
||||||
{t("PassengerOffice.excel_report")}
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PrintExcel
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
import UploadSystem from "@/core/components/UploadSystem";
|
|
||||||
import useNotification from "@/lib/app/hooks/useNotification";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {Button, DialogActions, DialogContent, FormHelperText, Stack, TextField, Typography} from "@mui/material"
|
|
||||||
import {useFormik} from "formik";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {CONFIRM_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import {useState} from "react";
|
|
||||||
import * as Yup from "yup";
|
|
||||||
|
|
||||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
|
||||||
const [fileType, setfileType] = useState(null);
|
|
||||||
const [fileName, setfileName] = useState(null);
|
|
||||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
|
||||||
const requestServer = useRequest({auth: true})
|
|
||||||
const {update_notification} = useNotification()
|
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
|
||||||
confirm_img: Yup.mixed().notRequired(t("ConfirmDialog.approved_amount_error"))
|
|
||||||
.test('fileSize', `${t("PassengerOffice.upload_file_unit")}`, (value) => {
|
|
||||||
if (!value) return true
|
|
||||||
return value.size <= 5 * 1024 * 1024;
|
|
||||||
})
|
|
||||||
.test('fileType', `${t("PassengerOffice.upload_file_format")}`, (value) => {
|
|
||||||
if (!value) return true
|
|
||||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types
|
|
||||||
return allowedTypes.includes(value.type);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const formik = useFormik({
|
|
||||||
initialValues: {
|
|
||||||
description: "",
|
|
||||||
confirm_img: null
|
|
||||||
}, validationSchema,
|
|
||||||
onSubmit: (values, {setSubmitting}) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
if (values.description != "") formData.append("description", values.description);
|
|
||||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
|
||||||
|
|
||||||
requestServer(`${CONFIRM_PASSENGER_OFFICE}/${rowId}`, 'post', {
|
|
||||||
data: formData,
|
|
||||||
}).then((response) => {
|
|
||||||
setOpenConfirmDialog(false)
|
|
||||||
mutate()
|
|
||||||
update_notification()
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setSubmitting(false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleDescriptionChange = (event) => {
|
|
||||||
formik.setFieldValue("description", event.target.value)
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUploadChange = (event) => {
|
|
||||||
const uploadedFile = event.target?.files?.[0];
|
|
||||||
if (uploadedFile) {
|
|
||||||
const fileType = event.target?.files?.[0].type;
|
|
||||||
const fileName = event.target?.files?.[0].name;
|
|
||||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
|
||||||
setfileType(fileType);
|
|
||||||
setfileName(fileName);
|
|
||||||
formik.setFieldValue("confirm_img", uploadedFile).then(() => {
|
|
||||||
formik.setFieldTouched("confirm_img", true);
|
|
||||||
})
|
|
||||||
setShowAddIcon(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DialogContent>
|
|
||||||
<Stack spacing={2}>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="description"
|
|
||||||
multiline
|
|
||||||
rows={8}
|
|
||||||
label={<>
|
|
||||||
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
|
||||||
value={formik.values.description}
|
|
||||||
onChange={handleDescriptionChange}
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
sx={{mt: 1}}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
|
||||||
<UploadSystem
|
|
||||||
selectedImage={selectedImage}
|
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
|
||||||
setselectedImage={setSelectedImage}
|
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
|
||||||
fieldname="confirm_img"
|
|
||||||
fileType={fileType}
|
|
||||||
fileName={fileName}
|
|
||||||
imageAlt={t("app_name")}
|
|
||||||
imageSize={[250, 150]}
|
|
||||||
setShowAddIcon={setShowAddIcon}
|
|
||||||
showAddIcon={showAddIcon}
|
|
||||||
onBlur={() => formik.handleBlur("confirm_img")}
|
|
||||||
error={
|
|
||||||
formik.touched.confirm_img &&
|
|
||||||
Boolean(formik.errors.confirm_img)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<FormHelperText
|
|
||||||
error={Boolean(formik.errors.confirm_img)}
|
|
||||||
>
|
|
||||||
{formik.touched.confirm_img && formik.errors.confirm_img}
|
|
||||||
</FormHelperText>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary"
|
|
||||||
disabled={formik.isSubmitting} autoFocus>
|
|
||||||
{t("ConfirmDialog.button-cancel")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
|
||||||
disabled={formik.isSubmitting || !formik.isValid}>
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
export default ConfirmContent
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import {Dialog, DialogTitle, IconButton, Tooltip} from "@mui/material";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import ConfirmContent from "./ConfirmContent";
|
|
||||||
import CallMadeIcon from '@mui/icons-material/CallMade';
|
|
||||||
const Confirm = ({rowId, mutate}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Tooltip title={t("ConfirmDialog.confirm")}>
|
|
||||||
<IconButton
|
|
||||||
color="primary"
|
|
||||||
onClick={() => {
|
|
||||||
setOpenConfirmDialog(true)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CallMadeIcon/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Dialog fullWidth open={openConfirmDialog}
|
|
||||||
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
|
||||||
<DialogTitle>{t("PassengerOffice.confirm")}</DialogTitle>
|
|
||||||
<ConfirmContent mutate={mutate} rowId={rowId} setOpenConfirmDialog={setOpenConfirmDialog}/>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
export default Confirm;
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
import UploadSystem from "@/core/components/UploadSystem"
|
|
||||||
import useNotification from "@/lib/app/hooks/useNotification";
|
|
||||||
import useRequest from "@/lib/app/hooks/useRequest";
|
|
||||||
import {Button, DialogActions, DialogContent, Stack, TextField, Typography} from "@mui/material"
|
|
||||||
import {useFormik} from "formik";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import * as Yup from "yup";
|
|
||||||
import {REJECT_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
|
|
||||||
const RejectContent = ({rowId, mutate, setOpenRejectDialog}) => {
|
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
|
||||||
const [fileType, setfileType] = useState(null);
|
|
||||||
const [fileName, setfileName] = useState(null);
|
|
||||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
|
||||||
const t = useTranslations();
|
|
||||||
const requestServer = useRequest({auth: true})
|
|
||||||
const {update_notification} = useNotification()
|
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
|
||||||
description: Yup.string().required(t("RejectDialog.description_error")),
|
|
||||||
});
|
|
||||||
|
|
||||||
const formik = useFormik({
|
|
||||||
initialValues: {
|
|
||||||
description: "",
|
|
||||||
reject_img: null
|
|
||||||
},
|
|
||||||
validationSchema,
|
|
||||||
onSubmit: (values, {setSubmitting}) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("expert_description", values.description);
|
|
||||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
|
||||||
|
|
||||||
requestServer(`${REJECT_PASSENGER_OFFICE}/${rowId}`, 'post', {
|
|
||||||
data: formData,
|
|
||||||
}).then((response) => {
|
|
||||||
setOpenRejectDialog(false)
|
|
||||||
mutate()
|
|
||||||
update_notification()
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
setSubmitting(false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleDescriptionChange = (event) => {
|
|
||||||
formik.setFieldValue("description", event.target.value);
|
|
||||||
formik.handleChange(event);
|
|
||||||
};
|
|
||||||
const handleUploadChange = (event) => {
|
|
||||||
const uploadedFile = event.target?.files?.[0];
|
|
||||||
if (uploadedFile) {
|
|
||||||
const maxFileSize = 2 * 1024 * 1024;
|
|
||||||
if (uploadedFile.size > maxFileSize) {
|
|
||||||
UploadFileNotification(t);
|
|
||||||
event.target.value = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const fileType = event.target?.files?.[0].type;
|
|
||||||
const fileName = event.target?.files?.[0].name;
|
|
||||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
|
||||||
setfileType(fileType);
|
|
||||||
setfileName(fileName);
|
|
||||||
formik.setFieldValue("reject_img", uploadedFile);
|
|
||||||
setShowAddIcon(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DialogContent>
|
|
||||||
<Stack spacing={2}>
|
|
||||||
<Stack>
|
|
||||||
<TextField
|
|
||||||
name="description"
|
|
||||||
multiline
|
|
||||||
rows={8}
|
|
||||||
label={t("RejectDialog.description")}
|
|
||||||
value={formik.values.description}
|
|
||||||
onChange={handleDescriptionChange}
|
|
||||||
onBlur={formik.handleBlur("description")}
|
|
||||||
error={
|
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
|
||||||
}
|
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
|
||||||
fullWidth
|
|
||||||
variant="outlined"
|
|
||||||
sx={{mt: 1}}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
|
||||||
<UploadSystem
|
|
||||||
selectedImage={selectedImage}
|
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
|
||||||
setselectedImage={setSelectedImage}
|
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
|
||||||
fieldname="reject_img"
|
|
||||||
fileType={fileType}
|
|
||||||
fileName={fileName}
|
|
||||||
imageAlt={t("app_name")}
|
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
|
||||||
setShowAddIcon={setShowAddIcon}
|
|
||||||
showAddIcon={showAddIcon}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => setOpenRejectDialog(false)} variant="outlined" color="secondary"
|
|
||||||
disabled={formik.isSubmitting} autoFocus>
|
|
||||||
{t("RejectDialog.button-cancel")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
|
||||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}>
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default RejectContent
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import {Dialog, DialogTitle, IconButton, Tooltip} from "@mui/material"
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import {useState} from "react";
|
|
||||||
import RejectContent from "./RejectContent";
|
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
|
||||||
|
|
||||||
const Reject = ({rowId, mutate}) => {
|
|
||||||
const t = useTranslations();
|
|
||||||
const [openRejectDialog, setOpenRejectDialog] = useState(false);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Tooltip title={t("RejectDialog.reject")}>
|
|
||||||
<IconButton color="primary" onClick={() => setOpenRejectDialog(true)}>
|
|
||||||
<ThumbDownIcon/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Dialog fullWidth open={openRejectDialog}
|
|
||||||
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
|
||||||
<RejectContent mutate={mutate} rowId={rowId} setOpenRejectDialog={setOpenRejectDialog}/>
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default Reject
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import {Box} from "@mui/material";
|
|
||||||
import Confirm from "./Form/ConfirmForm";
|
|
||||||
import Reject from "./Form/RejectForm";
|
|
||||||
|
|
||||||
const TableRow = ({row, mutate, fetchUrl}) => {
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box sx={{display: "flex", flexWrap: "nowrap", gap: "8px"}}>
|
|
||||||
<Confirm
|
|
||||||
rowId={row.getValue("id")}
|
|
||||||
mutate={mutate}
|
|
||||||
/>
|
|
||||||
<Reject
|
|
||||||
rowId={row.getValue("id")}
|
|
||||||
mutate={mutate}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default TableRow;
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import {Stack} from "@mui/material";
|
|
||||||
import PrintExcel from "@/components/dashboard/passenger-office/Buttons/printExcel";
|
|
||||||
|
|
||||||
const TableToolbar = ({table}) => {
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack direction={"row"} spacing={2}>
|
|
||||||
<PrintExcel table={table}/>
|
|
||||||
</Stack>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TableToolbar
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
import {Box, Typography} from "@mui/material";
|
|
||||||
import {useMemo} from "react";
|
|
||||||
import {GET_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
|
||||||
import {useTranslations} from "next-intl";
|
|
||||||
import TableRowActions from "./TableRowActions";
|
|
||||||
import moment from "jalali-moment";
|
|
||||||
import DataTable from "@/core/components/DataTable";
|
|
||||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
|
||||||
import TableToolbar from "@/components/dashboard/passenger-office/TableToolbar";
|
|
||||||
|
|
||||||
function DashboardPassengerOfficeComponent() {
|
|
||||||
const t = useTranslations();
|
|
||||||
|
|
||||||
const columns = useMemo(
|
|
||||||
() => [
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.id,
|
|
||||||
id: "id",
|
|
||||||
header: t("PassengerOffice.id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.name,
|
|
||||||
id: "name",
|
|
||||||
header: t("PassengerOffice.name"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.national_id,
|
|
||||||
id: "national_id",
|
|
||||||
header: t("PassengerOffice.national_id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.phone_number,
|
|
||||||
id: "phone_number",
|
|
||||||
header: t("PassengerOffice.phone_number"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) =>
|
|
||||||
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
|
|
||||||
id: "created_at",
|
|
||||||
header: t("PassengerOffice.created_at"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "date",
|
|
||||||
filterFn: "lessThan",
|
|
||||||
columnFilterModeOptions: ["lessThan", "greaterThan"],
|
|
||||||
Cell: ({renderedCellValue}) => {
|
|
||||||
return <Typography variant="body2">{renderedCellValue}</Typography>;
|
|
||||||
},
|
|
||||||
Header: ({column}) => <>{column.columnDef.header}</>,
|
|
||||||
Filter: ({column}) => {
|
|
||||||
return (
|
|
||||||
<MuiDatePicker column={column}/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) =>
|
|
||||||
moment(row.updated_at).locale("fa").format("HH:mm | YYYY/MM/DD"),
|
|
||||||
id: "updated_at",
|
|
||||||
header: t("PassengerOffice.updated_at"),
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "numeric",
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.navgan_id,
|
|
||||||
id: "navgan_id",
|
|
||||||
header: t("PassengerOffice.navgan_id"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.vehicle_type,
|
|
||||||
id: "vehicle_type",
|
|
||||||
header: t("PassengerOffice.vehicle_type"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "contains",
|
|
||||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorFn: (row) => row.state_name,
|
|
||||||
id: "state_id",
|
|
||||||
header: t("PassengerOffice.state_name"),
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "numeric",
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<Box sx={{px: 3}}>
|
|
||||||
<DataTable
|
|
||||||
tableUrl={GET_PASSENGER_OFFICE}
|
|
||||||
columns={columns}
|
|
||||||
selectableRow={false}
|
|
||||||
enableCustomToolbar={true}
|
|
||||||
CustomToolbar={TableToolbar}
|
|
||||||
enableLastUpdate={true}
|
|
||||||
sorting={[{
|
|
||||||
id: 'id', desc: false
|
|
||||||
}]}
|
|
||||||
enablePinning={true}
|
|
||||||
enableDensityToggle={false}
|
|
||||||
initialState={{density: 'compact'}} //compact (small) //comfortable (medium) //spacious (large)
|
|
||||||
enableColumnFilters={true}
|
|
||||||
enableHiding={true}
|
|
||||||
enableFullScreenToggle={false}
|
|
||||||
enableGlobalFilter={false}
|
|
||||||
enableColumnResizing={false} // if you want true this you shold change renderRowActions props ** see https://www.material-react-table.com/docs/guides/row-actions
|
|
||||||
enableRowActions={true}
|
|
||||||
TableRowAction={TableRowActions}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default DashboardPassengerOfficeComponent;
|
|
||||||
@@ -15,7 +15,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.id,
|
accessorFn: (row) => row.id,
|
||||||
id: "id",
|
id: "id",
|
||||||
header: t("MachinaryOffice.id"),
|
header: t("ReserveLoan.id"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -34,7 +34,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.score,
|
accessorFn: (row) => row.score,
|
||||||
id: "score",
|
id: "score",
|
||||||
header: t("MachinaryOffice.score"),
|
header: t("ReserveLoan.score"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -53,20 +53,20 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.is_legal_person,
|
accessorFn: (row) => row.is_legal_person,
|
||||||
id: "is_legal_person",
|
id: "is_legal_person",
|
||||||
header: t("MachinaryOffice.is_legal_person"),
|
header: t("ReserveLoan.is_legal_person"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
columnFilterModeOptions: ["equals"],
|
columnFilterModeOptions: ["equals"],
|
||||||
Cell: ({renderedCellValue}) => (
|
Cell: ({renderedCellValue}) => (
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2">{renderedCellValue === 1 ? `${t("MachinaryOffice.hoghoghi")}` : `${t("MachinaryOffice.haghighi")}`}</Typography>
|
variant="body2">{renderedCellValue === 1 ? `${t("ReserveLoan.hoghoghi")}` : `${t("ReserveLoan.haghighi")}`}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.navgan_id,
|
accessorFn: (row) => row.navgan_id,
|
||||||
id: "navgan_id",
|
id: "navgan_id",
|
||||||
header: t("MachinaryOffice.navgan_id"),
|
header: t("ReserveLoan.navgan_id"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -85,7 +85,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.name,
|
accessorFn: (row) => row.name,
|
||||||
id: "name",
|
id: "name",
|
||||||
header: t("MachinaryOffice.name"),
|
header: t("ReserveLoan.name"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "text",
|
datatype: "text",
|
||||||
filterFn: "contains",
|
filterFn: "contains",
|
||||||
@@ -97,7 +97,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.national_id,
|
accessorFn: (row) => row.national_id,
|
||||||
id: "national_id",
|
id: "national_id",
|
||||||
header: t("MachinaryOffice.national_id"),
|
header: t("ReserveLoan.national_id"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -116,7 +116,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.shenase_meli,
|
accessorFn: (row) => row.shenase_meli,
|
||||||
id: "shenase_meli",
|
id: "shenase_meli",
|
||||||
header: t("MachinaryOffice.shenase_meli"),
|
header: t("ReserveLoan.shenase_meli"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -135,7 +135,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.province_name,
|
accessorFn: (row) => row.province_name,
|
||||||
id: "province_name",
|
id: "province_name",
|
||||||
header: t("MachinaryOffice.province_name"),
|
header: t("ReserveLoan.province_name"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "text",
|
datatype: "text",
|
||||||
filterFn: "contains",
|
filterFn: "contains",
|
||||||
@@ -147,7 +147,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.city_name,
|
accessorFn: (row) => row.city_name,
|
||||||
id: "city_name",
|
id: "city_name",
|
||||||
header: t("MachinaryOffice.city_name"),
|
header: t("ReserveLoan.city_name"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "text",
|
datatype: "text",
|
||||||
filterFn: "contains",
|
filterFn: "contains",
|
||||||
@@ -160,7 +160,7 @@ function DashboardReserveLoan() {
|
|||||||
accessorFn: (row) =>
|
accessorFn: (row) =>
|
||||||
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
|
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
|
||||||
id: "created_at",
|
id: "created_at",
|
||||||
header: t("MachinaryOffice.created_at"),
|
header: t("ReserveLoan.created_at"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "date",
|
datatype: "date",
|
||||||
filterFn: "lessThan",
|
filterFn: "lessThan",
|
||||||
@@ -178,7 +178,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.phone_number,
|
accessorFn: (row) => row.phone_number,
|
||||||
id: "phone_number",
|
id: "phone_number",
|
||||||
header: t("MachinaryOffice.phone_number"),
|
header: t("ReserveLoan.phone_number"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -197,7 +197,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.statement_count,
|
accessorFn: (row) => row.statement_count,
|
||||||
id: "statement_count",
|
id: "statement_count",
|
||||||
header: t("MachinaryOffice.statement_count"),
|
header: t("ReserveLoan.statement_count"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -211,7 +211,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.navgan_capacity,
|
accessorFn: (row) => row.navgan_capacity,
|
||||||
id: "navgan_capacity",
|
id: "navgan_capacity",
|
||||||
header: t("MachinaryOffice.navgan_capacity"),
|
header: t("ReserveLoan.navgan_capacity"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -230,7 +230,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.manufacture_date,
|
accessorFn: (row) => row.manufacture_date,
|
||||||
id: "manufacture_date",
|
id: "manufacture_date",
|
||||||
header: t("MachinaryOffice.manufacture_date"),
|
header: t("ReserveLoan.manufacture_date"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
filterFn: "equals",
|
filterFn: "equals",
|
||||||
@@ -249,7 +249,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.vehicle_type,
|
accessorFn: (row) => row.vehicle_type,
|
||||||
id: "vehicle_type",
|
id: "vehicle_type",
|
||||||
header: t("MachinaryOffice.vehicle_type"),
|
header: t("ReserveLoan.vehicle_type"),
|
||||||
enableColumnFilter: true,
|
enableColumnFilter: true,
|
||||||
datatype: "text",
|
datatype: "text",
|
||||||
filterFn: "contains",
|
filterFn: "contains",
|
||||||
@@ -261,7 +261,7 @@ function DashboardReserveLoan() {
|
|||||||
{
|
{
|
||||||
accessorFn: (row) => row.plate_number,
|
accessorFn: (row) => row.plate_number,
|
||||||
id: "plate_number",
|
id: "plate_number",
|
||||||
header: t("MachinaryOffice.plate_number"),
|
header: t("ReserveLoan.plate_number"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "text",
|
datatype: "text",
|
||||||
filterFn: "contains",
|
filterFn: "contains",
|
||||||
@@ -288,10 +288,190 @@ function DashboardReserveLoan() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.approved_amount,
|
||||||
|
id: "approved_amount",
|
||||||
|
header: t("ReserveLoan.approved_amount"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_bank,
|
||||||
|
id: "facility_bank",
|
||||||
|
header: t("ReserveLoan.facility_bank"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_gov,
|
||||||
|
id: "facility_gov",
|
||||||
|
header: t("ReserveLoan.facility_gov"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_person,
|
||||||
|
id: "facility_person",
|
||||||
|
header: t("ReserveLoan.facility_person"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.physical_progress,
|
||||||
|
id: "physical_progress",
|
||||||
|
header: t("ReserveLoan.physical_progress"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.repayment_period,
|
||||||
|
id: "repayment_period",
|
||||||
|
header: t("ReserveLoan.repayment_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.sakht_period,
|
||||||
|
id: "sakht_period",
|
||||||
|
header: t("ReserveLoan.sakht_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals"
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.tanafos_period,
|
||||||
|
id: "tanafos_period",
|
||||||
|
header: t("ReserveLoan.tanafos_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals"
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.committed_employment,
|
||||||
|
id: "committed_employment",
|
||||||
|
header: t("ReserveLoan.committed_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.existing_employment,
|
||||||
|
id: "existing_employment",
|
||||||
|
header: t("ReserveLoan.existing_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.state_name,
|
accessorFn: (row) => row.state_name,
|
||||||
id: "state_id",
|
id: "state_id",
|
||||||
header: t("MachinaryOffice.state_name"),
|
header: t("ReserveLoan.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
Cell: ({renderedCellValue}) => (
|
Cell: ({renderedCellValue}) => (
|
||||||
|
|||||||
@@ -180,13 +180,23 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
|||||||
{loading ? <LinearProgress/> :
|
{loading ? <LinearProgress/> :
|
||||||
<>
|
<>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
showNumber={(detailsList?.data?.proposed_amount) / 1000000}
|
showNumber={(detailsList?.data?.approved_amount) / 1000000}
|
||||||
headerTitle={t("ConfirmDialog.proposed_amount")}
|
headerTitle={t("ConfirmDialog.approved_amount_title")}
|
||||||
unitTitle={t("ConfirmDialog.unit")}
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
/>
|
/>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
showNumber={(detailsList?.data?.approved_amount) / 1000000}
|
showNumber={(detailsList?.data?.facility_bank) / 1000000}
|
||||||
headerTitle={t("ConfirmDialog.approved_amount_title")}
|
headerTitle={t("ConfirmDialog.facility_bank_title")}
|
||||||
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={(detailsList?.data?.facility_gov) / 1000000}
|
||||||
|
headerTitle={t("ConfirmDialog.facility_gov_title")}
|
||||||
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={(detailsList?.data?.facility_person) / 1000000}
|
||||||
|
headerTitle={t("ConfirmDialog.facility_person_title")}
|
||||||
unitTitle={t("ConfirmDialog.unit")}
|
unitTitle={t("ConfirmDialog.unit")}
|
||||||
/>
|
/>
|
||||||
<NumberShowBox
|
<NumberShowBox
|
||||||
@@ -199,6 +209,11 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
|||||||
headerTitle={t("ConfirmDialog.tanafos_period")}
|
headerTitle={t("ConfirmDialog.tanafos_period")}
|
||||||
unitTitle={t("ConfirmDialog.tanafos_period_month")}
|
unitTitle={t("ConfirmDialog.tanafos_period_month")}
|
||||||
/>
|
/>
|
||||||
|
<NumberShowBox
|
||||||
|
showNumber={detailsList?.data?.repayment_period}
|
||||||
|
headerTitle={t("ConfirmDialog.repayment_period")}
|
||||||
|
unitTitle={t("ConfirmDialog.repayment_period_month")}
|
||||||
|
/>
|
||||||
{renderCustomAccordions()}
|
{renderCustomAccordions()}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,25 +232,6 @@ function DashboardTransportationAssistanceComponent() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorFn: (row) => row.proposed_amount,
|
|
||||||
id: "proposed_amount",
|
|
||||||
header: t("TransportationAssistance.proposed_amount"),
|
|
||||||
enableColumnFilter: true,
|
|
||||||
datatype: "numeric",
|
|
||||||
filterFn: "equals",
|
|
||||||
columnFilterModeOptions: [
|
|
||||||
"equals",
|
|
||||||
"notEquals",
|
|
||||||
"contains",
|
|
||||||
"lessThan",
|
|
||||||
"greaterThan",
|
|
||||||
"between",
|
|
||||||
],
|
|
||||||
Cell: ({renderedCellValue}) => (
|
|
||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.approved_amount,
|
accessorFn: (row) => row.approved_amount,
|
||||||
id: "approved_amount",
|
id: "approved_amount",
|
||||||
@@ -270,6 +251,101 @@ function DashboardTransportationAssistanceComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_bank,
|
||||||
|
id: "facility_bank",
|
||||||
|
header: t("TransportationAssistance.facility_bank"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_gov,
|
||||||
|
id: "facility_gov",
|
||||||
|
header: t("TransportationAssistance.facility_gov"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.facility_person,
|
||||||
|
id: "facility_person",
|
||||||
|
header: t("TransportationAssistance.facility_person"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue / 1000000}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.physical_progress,
|
||||||
|
id: "physical_progress",
|
||||||
|
header: t("TransportationAssistance.physical_progress"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.repayment_period,
|
||||||
|
id: "repayment_period",
|
||||||
|
header: t("TransportationAssistance.repayment_period"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.sakht_period,
|
accessorFn: (row) => row.sakht_period,
|
||||||
id: "sakht_period",
|
id: "sakht_period",
|
||||||
@@ -298,6 +374,44 @@ function DashboardTransportationAssistanceComponent() {
|
|||||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.committed_employment,
|
||||||
|
id: "committed_employment",
|
||||||
|
header: t("TransportationAssistance.committed_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorFn: (row) => row.existing_employment,
|
||||||
|
id: "existing_employment",
|
||||||
|
header: t("TransportationAssistance.existing_employment"),
|
||||||
|
enableColumnFilter: true,
|
||||||
|
datatype: "numeric",
|
||||||
|
filterFn: "equals",
|
||||||
|
columnFilterModeOptions: [
|
||||||
|
"equals",
|
||||||
|
"notEquals",
|
||||||
|
"contains",
|
||||||
|
"lessThan",
|
||||||
|
"greaterThan",
|
||||||
|
"between",
|
||||||
|
],
|
||||||
|
Cell: ({renderedCellValue}) => (
|
||||||
|
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.state_name,
|
accessorFn: (row) => row.state_name,
|
||||||
id: "state_id",
|
id: "state_id",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const NumberShowBox = ({showNumber, headerTitle, unitTitle}) => {
|
|||||||
sx={{color: "primary.main", fontWeight: 500}}>{headerTitle}</Typography>
|
sx={{color: "primary.main", fontWeight: 500}}>{headerTitle}</Typography>
|
||||||
<Typography pt={1}>
|
<Typography pt={1}>
|
||||||
{isNaN(showNumber) || showNumber === null
|
{isNaN(showNumber) || showNumber === null
|
||||||
? ""
|
? "0"
|
||||||
: (showNumber).toLocaleString()}{" "}
|
: (showNumber).toLocaleString()}{" "}
|
||||||
{unitTitle}
|
{unitTitle}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
||||||
import DirectionsCarFilledIcon from "@mui/icons-material/DirectionsCarFilled";
|
|
||||||
import AirlineSeatReclineNormalIcon from "@mui/icons-material/AirlineSeatReclineNormal";
|
|
||||||
import DirectionsRailwayIcon from "@mui/icons-material/DirectionsRailway";
|
import DirectionsRailwayIcon from "@mui/icons-material/DirectionsRailway";
|
||||||
import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
|
import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
|
||||||
import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
|
import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
|
||||||
@@ -48,26 +46,6 @@ const sidebarMenu = [
|
|||||||
permissions: ["view_navgan_loans", "view_navgan_loans_province"],
|
permissions: ["view_navgan_loans", "view_navgan_loans_province"],
|
||||||
},
|
},
|
||||||
], [
|
], [
|
||||||
{
|
|
||||||
key: "sidebar.passenger-office-chief",
|
|
||||||
secondary: "secondary.navgan-province-manager",
|
|
||||||
name: "passenger_office_chief",
|
|
||||||
type: "page",
|
|
||||||
route: "/dashboard/passenger-office-chief",
|
|
||||||
icon: <AirlineSeatReclineNormalIcon sx={{width: 'inherit', height: 'inherit'}}/>,
|
|
||||||
selected: false,
|
|
||||||
permissions: ["manage_passenger_office_navgan"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "sidebar.machinery-expert",
|
|
||||||
secondary: "secondary.navgan-province-manager",
|
|
||||||
name: "machinery_expert",
|
|
||||||
type: "page",
|
|
||||||
route: "/dashboard/machinery-expert",
|
|
||||||
icon: <DirectionsCarFilledIcon sx={{width: 'inherit', height: 'inherit'}}/>,
|
|
||||||
selected: false,
|
|
||||||
permissions: ["manage_machinery_navgan"],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: "sidebar.reserve-loan",
|
key: "sidebar.reserve-loan",
|
||||||
secondary: "secondary.navgan-province-manager",
|
secondary: "secondary.navgan-province-manager",
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import DashboardMachineryOfficeComponent from "@/components/dashboard/machinary-office";
|
|
||||||
import {parse} from "next-useragent";
|
|
||||||
|
|
||||||
export default function PassengerOffice() {
|
|
||||||
return (
|
|
||||||
<DashboardMachineryOfficeComponent/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getServerSideProps({req, locale}) {
|
|
||||||
const {isBot} = parse(req.headers["user-agent"]);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
|
||||||
title: "Dashboard.machinary_office_page",
|
|
||||||
isBot,
|
|
||||||
locale,
|
|
||||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_machinery_navgan"]}}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import {parse} from "next-useragent";
|
|
||||||
import ReportComponent from "@/components/dashboard/machinary-office/Prints/report";
|
|
||||||
|
|
||||||
export default function Report() {
|
|
||||||
return (
|
|
||||||
<ReportComponent/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getServerSideProps({req, locale}) {
|
|
||||||
const {isBot} = parse(req.headers["user-agent"]);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
|
||||||
title: "Dashboard.machinary_office_page",
|
|
||||||
isBot,
|
|
||||||
locale,
|
|
||||||
layout: {name: 'PrintLayout'}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import DashboardPassengerOfficeComponent from "@/components/dashboard/passenger-office";
|
|
||||||
import {parse} from "next-useragent";
|
|
||||||
|
|
||||||
export default function PassengerOffice() {
|
|
||||||
return (
|
|
||||||
<DashboardPassengerOfficeComponent/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getServerSideProps({req, locale}) {
|
|
||||||
const {isBot} = parse(req.headers["user-agent"]);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
|
||||||
title: "Dashboard.passenger_office_page",
|
|
||||||
isBot,
|
|
||||||
locale,
|
|
||||||
layout: {name: 'DashboardLayout', props: {permissions: ["manage_passenger_office_navgan"]}}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user