Merge branch 'feature/amin_merge_cartable' into 'develop'
amin merge cartable See merge request witel-front-end/loan-facilities/expert-v2!2
This commit is contained in:
@@ -241,6 +241,12 @@
|
||||
},
|
||||
"PassengerBoss": {
|
||||
"name": "نام",
|
||||
"button-reserve-confirm": "رزرو",
|
||||
"reserve-loan-title": "رزرو وام",
|
||||
"description-reserve-loan-first": "آیا از رزرو وام به کد یکتا",
|
||||
"description-reserve-loan-second": "اطمینان دارید؟",
|
||||
"button-reserve-cancel": "بستن",
|
||||
"button-reserve-confirm": "رزرو",
|
||||
"city_name": "شهرستان",
|
||||
"plate_number": "پلاک",
|
||||
"statement_count": "تعداد صورت وضعیت",
|
||||
@@ -265,9 +271,13 @@
|
||||
"state_name": "وضعیت درخواست",
|
||||
"confirm": "ارجاع به معاون حمل و نقل",
|
||||
"upload_file": "فایل خود را بارگذاری کنید(اختیاری)",
|
||||
"upload_expert_img": "فایل گزارش کارشناسی را بارگذاری کنید",
|
||||
"upload_file_required": "وارد کردن گزارش کارشناسی الزامیست",
|
||||
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
|
||||
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||
"upload_expert_file_required": "وارد کردن گزارش کارشناسی الزامیست",
|
||||
"upload_expert_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد",
|
||||
"upload_expert_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||
"max_amount": "حداکثر مبلغ تصویب شده {value} میلیون ریال می باشد",
|
||||
"excel_report": "گزارش اکسل",
|
||||
"first_form": "فرم الف را بارگذاری کنید",
|
||||
@@ -464,31 +474,68 @@
|
||||
},
|
||||
"ConfirmDialog": {
|
||||
"confirm": "ارجاع",
|
||||
"month": "(ماه)",
|
||||
"context": "آیا از تایید این آیتم اطمینان دارید؟",
|
||||
"button-cancel": "بستن",
|
||||
"button-confirm": "ارجاع",
|
||||
"bank_facility": "تسهیلات سهم بانک",
|
||||
"user_facility": "تسهیلات سهم متقاضی",
|
||||
"government_facility": "تسهیلات سهم دولت",
|
||||
"committed_employment": "تعداد اشتغال تعهد شده",
|
||||
"history_facilities": "سابقه استفاده از تسهیلات تکلیفی",
|
||||
"available_jobs": "تعداد اشتغال موجود",
|
||||
"physical_progress": "درصد پیشرفت فیزیکی",
|
||||
"interest_rate": "نرخ بهره",
|
||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||
"optional": " (اختیاری)",
|
||||
"unit": " (میلیون ریال)",
|
||||
"description": "توضیحات خود را وارد نمائید",
|
||||
"choose_file": "انتخاب فایل",
|
||||
"repayment_period": "دوره باز پرداخت",
|
||||
"participation_period": "دوره مشارکت",
|
||||
"approved_amount": "مبلغ تصویب شده",
|
||||
"sakht_period": "دوره ساخت",
|
||||
"tanafos_period": "دوره تنفس",
|
||||
"approved_amount_error": "وارد کردن مبلغ تصویب شده الزامیست",
|
||||
"bank_facility_error": "وارد کردن تسهیلات سهم بانک الزامیست",
|
||||
"government_facility_error": "وارد کردن تسهیلات سهم دولت الزامیست",
|
||||
"committed_employment_error": "وارد کردن تعداد اشتغال تعهد شده الزامیست",
|
||||
"history_facilities_error": "وارد کردن سابقه استفاده از تسهیلات تکلیفی الزامیست",
|
||||
"available_jobs_error": "وارد کردن تعداد اشتغال موجود الزامیست",
|
||||
"sakht_period_error": "وارد کردن دوره ساخت الزامیست",
|
||||
"tanafos_period_error": "وارد کردن دوره تنفس الزامیست",
|
||||
"approved_amount_positive": "مبلغ تصویب شده باید مثبت باشد",
|
||||
"bank_facility_positive": "تسهیلات سهم بانک باید مثبت باشد",
|
||||
"repayment_period_positive": "دوره باز پرداخت باید مثبت باشد",
|
||||
"participation_period_positive": "دوره مشارکت باید مثبت باشد",
|
||||
"government_facility_positive": "تسهیلات سهم دولت باید مثبت باشد",
|
||||
"committed_employment_positive": "تعداد اشتغال تعهد شده باید مثبت باشد",
|
||||
"history_facilities_positive": "سابقه استفاده از تسهیلات تکلیفی باید مثبت باشد",
|
||||
"available_jobs_positive": "تعدلد اشتغال موجود باید مثبت باشد",
|
||||
"approved_amount_number": "مبلغ تصویب شده باید عدد باشد",
|
||||
"bank_facility_number": "تسهیلات سهم بانک باید عدد باشد",
|
||||
"interest_rate_number": "نرخ بهره باید عدد باشد",
|
||||
"government_facility_number": "تسهیلات سهم دولت باید عدد باشد",
|
||||
"committed_employment_number": "تعداد سابقه استفاده از تسهیلات تکلیفی باید عدد باشد",
|
||||
"history_facilities_number": "تعداد اشتغال تعهد شده باید عدد باشد",
|
||||
"available_jobs_number": "تعداد اشتغال موجود باید عدد باشد",
|
||||
"sakht_period_positive": "دوره ساخت باید مثبت باشد",
|
||||
"interest_rate_positive": "نرخ بهره باید مثبت باشد",
|
||||
"tanafos_period_positive": "دوره تنفس باید مثبت باشد",
|
||||
"sakht_period_number": "دوره ساخت باید عدد باشد",
|
||||
"repayment_period_number": "دوره باز پرداخت باید عدد باشد",
|
||||
"participation_period_number": "دوره مشارکت باید عدد باشد",
|
||||
"tanafos_period_number": "دوره تنفس باید عدد باشد",
|
||||
"toman": "میلیون تومان",
|
||||
"bank_facility_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
||||
"government_facility_max_amount": "جمع مبلغ سهم دولت و سهم بانک نباید از مبلغ تصویب شده بیشتر باشد .",
|
||||
"tanafos_period_month": "ماه",
|
||||
"approved_amount_title": "مبلغ تصویب شده کارگروه",
|
||||
"sakht_period_day": "روز",
|
||||
"proposed_amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
|
||||
"repayment_period_error": "وارد کردن دوره باز پرداخت الزامیست",
|
||||
"participation_period_error": "وارد کردن دوره مشارکت الزامیست",
|
||||
"interest_rate_error": "وارد کردن نرخ بهره الزامیست",
|
||||
"proposed_amount": "مبلغ پیشنهادی",
|
||||
"proposed_amount_positive": "مقدار پیشنهادی باید مثبت باشد",
|
||||
"proposed_amount_number": "مقدار پیشنهادی باید عدد باشد"
|
||||
|
||||
@@ -6,84 +6,36 @@ import {
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
LinearProgress,
|
||||
Stack,
|
||||
TextField,
|
||||
Typography
|
||||
} from "@mui/material"
|
||||
import {useFormik} from "formik";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {CONFIRM_PASSENGER_BOSS, EXPORT_PASSENGER_BOSS_DETAILS,} from "@/core/data/apiRoutes";
|
||||
import {useEffect, useState} from "react";
|
||||
import {CONFIRM_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
||||
import {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 NumberShowBox from "@/core/components/NumberShowBox";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const vehicle_amount = {
|
||||
"اتوبوس": 7000,
|
||||
"مینی بوس": 2000,
|
||||
}
|
||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, handleSizeChangeClick}) => {
|
||||
|
||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) => {
|
||||
const t = useTranslations();
|
||||
const [selectedImage, setSelectedImage] = 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 [expertFileName, setExpertFileName] = useState(null);
|
||||
const [showExpertAddIcon, setShowExpertAddIcon] = useState(true);
|
||||
const requestServer = useRequest({auth: true, notification: false})
|
||||
const {update_notification} = useNotification();
|
||||
const [attachmentsData, setAttachmentsData] = useState([]);
|
||||
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(`${EXPORT_PASSENGER_BOSS_DETAILS}/${rowId}`, 'get')
|
||||
.then((response) => {
|
||||
const allAttachments = [];
|
||||
response.data.data.histories.map((history) => {
|
||||
history.attachments.map((attachment) => {
|
||||
allAttachments.push(attachment);
|
||||
});
|
||||
});
|
||||
setDetailsData(response.data);
|
||||
setAttachmentsData(allAttachments);
|
||||
setDetailsData(response.data)
|
||||
})
|
||||
.catch(() => {
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (attachmentsData.length !== 0) {
|
||||
const booleanData = Array.from({length: attachmentsData.length}, () => false);
|
||||
setAccordionStates(booleanData);
|
||||
}
|
||||
}, [attachmentsData]);
|
||||
|
||||
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(attachmentsData[index])
|
||||
setIsSkeleton(true)
|
||||
}
|
||||
};
|
||||
|
||||
const [showFacility, setShowFacility] = useState(false)
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
approved_amount: Yup.mixed().test(
|
||||
@@ -94,6 +46,70 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
(value) => value <= vehicle_amount[vehicle_type])
|
||||
.test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
|
||||
.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(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.repayment_period_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
|
||||
.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(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.committed_employment_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.committed_employment_error")),
|
||||
available_jobs: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.available_jobs_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.available_jobs_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.available_jobs_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")),
|
||||
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
|
||||
@@ -103,6 +119,15 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
if (!value) return true
|
||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
|
||||
return allowedTypes.includes(value.type);
|
||||
}),
|
||||
expert_img: Yup.mixed()
|
||||
.required(t("PassengerBoss.upload_expert_file_required"))
|
||||
.test('fileSize', `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
|
||||
return value.size <= 5 * 1024 * 1024;
|
||||
})
|
||||
.test('fileType', `${t("PassengerBoss.upload_expert_file_format")}`, (value) => {
|
||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
|
||||
return allowedTypes.includes(value.type);
|
||||
})
|
||||
});
|
||||
|
||||
@@ -110,13 +135,38 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
initialValues: {
|
||||
description: "",
|
||||
approved_amount: "",
|
||||
bank_facility: "0",
|
||||
government_facility: "0",
|
||||
user_facility: "0",
|
||||
physical_progress: "",
|
||||
repayment_period: "",
|
||||
participation_period: "",
|
||||
interest_rate: "",
|
||||
committed_employment: "",
|
||||
sakht_period: "",
|
||||
tanafos_period: "",
|
||||
history_facilities: "0",
|
||||
available_jobs: "",
|
||||
expert_img: null,
|
||||
confirm_img: null,
|
||||
}, validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append("approved_amount", values.approved_amount);
|
||||
formData.append("bank_facility", values.bank_facility);
|
||||
formData.append("government_facility", values.government_facility);
|
||||
formData.append("user_facility", values.user_facility);
|
||||
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("available_jobs", values.available_jobs);
|
||||
formData.append("sakht_period", values.sakht_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.physical_progress != "") formData.append("physical_progress", values.physical_progress);
|
||||
if (values.confirm_img != null) {
|
||||
const attachments = [
|
||||
{
|
||||
@@ -129,6 +179,18 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
||||
});
|
||||
}
|
||||
if (values.expert_img != null) {
|
||||
const attachments = [
|
||||
{
|
||||
title: "فایل ضمیمه گزارش کارشناس",
|
||||
file: values.expert_img
|
||||
}
|
||||
];
|
||||
attachments.forEach((attachment, index) => {
|
||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
||||
});
|
||||
}
|
||||
|
||||
requestServer(`${CONFIRM_PASSENGER_BOSS}/${rowId}`, 'post', {
|
||||
notification: true,
|
||||
@@ -144,10 +206,6 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
},
|
||||
});
|
||||
|
||||
const handleDescriptionChange = (event) => {
|
||||
formik.setFieldValue("description", event.target.value)
|
||||
};
|
||||
|
||||
const handleUploadChange = (event) => {
|
||||
const uploadedFile = event.target?.files?.[0];
|
||||
if (uploadedFile) {
|
||||
@@ -162,135 +220,491 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
setShowAddIcon(false);
|
||||
}
|
||||
};
|
||||
const handleExpertFileChange = (event) => {
|
||||
const uploadedFile = event.target?.files?.[0];
|
||||
if (uploadedFile) {
|
||||
const fileType = event.target?.files?.[0].type;
|
||||
const fileName = event.target?.files?.[0].name;
|
||||
setExpertImg(URL.createObjectURL(uploadedFile));
|
||||
setExpertFileType(fileType);
|
||||
setExpertFileName(fileName);
|
||||
formik.setFieldValue("expert_img", uploadedFile).then(() => {
|
||||
formik.setFieldTouched("expert_img", true);
|
||||
})
|
||||
setShowExpertAddIcon(false);
|
||||
}
|
||||
};
|
||||
const handleAmountChange = (event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("approved_amount", event.target.value)
|
||||
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)))
|
||||
})
|
||||
event.target.value !== "" ? setShowFacility(true) : setShowFacility(false)
|
||||
} else {
|
||||
formik.setFieldValue("approved_amount", formik.values.approved_amount)
|
||||
setShowFacility(false)
|
||||
}
|
||||
};
|
||||
|
||||
const renderCustomAccordions = () => {
|
||||
if (attachmentsData) {
|
||||
return attachmentsData.map((file, index) => (
|
||||
<CustomAccordion
|
||||
key={index}
|
||||
title={`${file.title}`}
|
||||
hasOpened={accordionStates[index]}
|
||||
hasAccordionOpened={null}
|
||||
handleAccordionChange={() => handleAccordionChange(index)}
|
||||
accordionIndex={index}
|
||||
downloadFile={file.file}
|
||||
/>
|
||||
));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={hasImageShown ? 6 : 12}>
|
||||
{loading ? <LinearProgress/> :
|
||||
<>
|
||||
<NumberShowBox
|
||||
showNumber={(detailsList?.data?.proposed_amount) / 1000000}
|
||||
headerTitle={t("ConfirmDialog.proposed_amount")}
|
||||
unitTitle={t("ConfirmDialog.unit")}
|
||||
/>
|
||||
<NumberShowBox
|
||||
showNumber={detailsList?.data?.sakht_period}
|
||||
headerTitle={t("ConfirmDialog.sakht_period")}
|
||||
unitTitle={t("ConfirmDialog.sakht_period_day")}
|
||||
/>
|
||||
<NumberShowBox
|
||||
showNumber={detailsList?.data?.tanafos_period}
|
||||
headerTitle={t("ConfirmDialog.tanafos_period")}
|
||||
unitTitle={t("ConfirmDialog.tanafos_period_month")}
|
||||
/>
|
||||
{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="approved_amount"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.approved_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.approved_amount}
|
||||
onChange={handleAmountChange}
|
||||
onBlur={formik.handleBlur("approved_amount")}
|
||||
error={
|
||||
formik.touched.approved_amount &&
|
||||
Boolean(formik.errors.approved_amount)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.approved_amount && formik.errors.approved_amount
|
||||
}
|
||||
sx={{mt: 1}}
|
||||
fullWidth
|
||||
/>
|
||||
</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>
|
||||
</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>
|
||||
<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={formik.handleChange}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{mt: 1}}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="approved_amount"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.approved_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.approved_amount}
|
||||
onChange={handleAmountChange}
|
||||
onBlur={formik.handleBlur("approved_amount")}
|
||||
error={
|
||||
formik.touched.approved_amount &&
|
||||
Boolean(formik.errors.approved_amount)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.approved_amount && formik.errors.approved_amount
|
||||
}
|
||||
sx={{mt: 1}}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="bank_facility"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.bank_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.bank_facility}
|
||||
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
|
||||
disabled={!showFacility}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="government_facility"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.government_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.government_facility}
|
||||
onChange={(event) => {
|
||||
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
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="user_facility"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.user_facility")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
variant="outlined"
|
||||
value={formik.values.user_facility}
|
||||
disabled
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<TextField
|
||||
name="physical_progress"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.physical_progress")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.physical_progress}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("physical_progress", event.target.value)
|
||||
} else {
|
||||
formik.setFieldValue("physical_progress", formik.values.physical_progress)
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("physical_progress")}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<TextField
|
||||
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"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.repayment_period")}</span> <small>{t("ConfirmDialog.month")}</small></>}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.repayment_period}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("repayment_period", event.target.value)
|
||||
} else {
|
||||
formik.setFieldValue("repayment_period", formik.values.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>
|
||||
<SelectBox
|
||||
name="sakht_period"
|
||||
label={t("ConfirmDialog.sakht_period")}
|
||||
size="small"
|
||||
value={formik.values.sakht_period}
|
||||
selectType="sakht_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 ماه"
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: "5",
|
||||
name: "5 ماه"
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
value: "6",
|
||||
name: "6 ماه"
|
||||
}
|
||||
]}
|
||||
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>
|
||||
<TextField
|
||||
name="committed_employment"
|
||||
label={t("ConfirmDialog.committed_employment")}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.committed_employment}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("committed_employment", event.target.value)
|
||||
} else {
|
||||
formik.setFieldValue("committed_employment", formik.values.committed_employment)
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("committed_employment")}
|
||||
error={
|
||||
formik.touched.committed_employment &&
|
||||
Boolean(formik.errors.committed_employment)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.committed_employment && formik.errors.committed_employment
|
||||
}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<TextField
|
||||
name="available_jobs"
|
||||
label={t("ConfirmDialog.available_jobs")}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
min: 0,
|
||||
pattern: "[0-9]*",
|
||||
}}
|
||||
variant="outlined"
|
||||
value={formik.values.available_jobs}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("available_jobs", event.target.value)
|
||||
} else {
|
||||
formik.setFieldValue("available_jobs", formik.values.available_jobs)
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("available_jobs")}
|
||||
error={
|
||||
formik.touched.available_jobs &&
|
||||
Boolean(formik.errors.available_jobs)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.available_jobs && formik.errors.available_jobs
|
||||
}
|
||||
fullWidth
|
||||
/>
|
||||
</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>
|
||||
<Typography>{t("PassengerBoss.upload_expert_img")}</Typography>
|
||||
<UploadSystem
|
||||
selectedImage={expertImg}
|
||||
handleUploadChange={handleExpertFileChange} // Pass the updated function directly
|
||||
setselectedImage={setExpertImg}
|
||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||
fieldname="expert_img"
|
||||
fileType={expertFileType}
|
||||
fileName={expertFileName}
|
||||
imageAlt={t("app_name")}
|
||||
imageSize={[250, 150]}
|
||||
onBlur={formik.handleBlur("expert_img")}
|
||||
error={
|
||||
formik.touched.expert_img &&
|
||||
Boolean(formik.errors.expert_img)
|
||||
}
|
||||
setShowAddIcon={setShowExpertAddIcon}
|
||||
showAddIcon={showExpertAddIcon}
|
||||
/>
|
||||
<FormHelperText
|
||||
error={Boolean(formik.errors.expert_img)}
|
||||
>
|
||||
{formik.touched.expert_img && formik.errors.expert_img}
|
||||
</FormHelperText>
|
||||
</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>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary"
|
||||
@@ -304,6 +718,5 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type, hand
|
||||
</DialogActions>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
export default ConfirmContent
|
||||
@@ -0,0 +1,75 @@
|
||||
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_PASSENGER_BOSS} 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_PASSENGER_BOSS}/${rowId}`, 'post').then((response) => {
|
||||
setOpenConfirmDialog(false)
|
||||
mutate()
|
||||
update_notification()
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
setIsSubmitting(false)
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={t("PassengerBoss.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("PassengerBoss.reserve-loan-title")}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Typography> {t("PassengerBoss.description-reserve-loan-first")} {rowId} {t("PassengerBoss.description-reserve-loan-second")}</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary" disabled={isSubmitting}>{t("PassengerBoss.button-reserve-cancel")}</Button>
|
||||
<Button onClick={() => handleSubmit()} variant="contained" color="primary" disabled={isSubmitting}>
|
||||
{t("PassengerBoss.button-reserve-confirm")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
export default ReserveForm;
|
||||
@@ -1,6 +1,7 @@
|
||||
import {Box} from "@mui/material";
|
||||
import Reject from "./Form/RejectForm"
|
||||
import Confirm from "./Form/ConfirmForm";
|
||||
import ReserveForm from "@/components/dashboard/passenger-boss/Form/ReserveForm";
|
||||
|
||||
const TableRow = ({row, mutate}) => {
|
||||
|
||||
@@ -11,6 +12,10 @@ const TableRow = ({row, mutate}) => {
|
||||
vehicle_type={row.original.vehicle_type}
|
||||
mutate={mutate}
|
||||
/>
|
||||
<ReserveForm
|
||||
rowId={row.getValue("id")}
|
||||
mutate={mutate}
|
||||
/>
|
||||
<Reject
|
||||
rowId={row.getValue("id")}
|
||||
mutate={mutate}
|
||||
|
||||
@@ -289,53 +289,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
</Stack>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.proposed_amount,
|
||||
id: "proposed_amount",
|
||||
header: t("PassengerBoss.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.sakht_period,
|
||||
id: "sakht_period",
|
||||
header: t("PassengerBoss.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("PassengerBoss.tanafos_period"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterFn: "equals",
|
||||
columnFilterModeOptions: [
|
||||
"equals"
|
||||
],
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
|
||||
@@ -39,7 +39,8 @@ export const REJECT_PASSENGER_BOSS =
|
||||
BASE_URL + "/dashboard/province_working_group/reject";
|
||||
export const EXPORT_PASSENGER_BOSS =
|
||||
BASE_URL + "/dashboard/province_working_group/export";
|
||||
|
||||
export const RESERVE_PASSENGER_BOSS =
|
||||
BASE_URL + "/dashboard/province_working_group/reserve";
|
||||
export const EXPORT_PASSENGER_BOSS_DETAILS =
|
||||
BASE_URL + "/dashboard/province_working_group";
|
||||
//passenger boss
|
||||
@@ -77,8 +78,6 @@ export const EXPORT_MACHINARY_OFFICE =
|
||||
|
||||
export const GET_RESERVE_MACHINARY_LOAN =
|
||||
BASE_URL + "/dashboard/reserved_loan/show";
|
||||
export const RESERVE_MACHINARY_LOAN =
|
||||
BASE_URL + "/dashboard/machinery_expert/reserve";
|
||||
|
||||
export const CANSEL_RESERVE_MACHINARY_LOAN =
|
||||
BASE_URL + "/dashboard/reserved_loan/unreserve";
|
||||
|
||||
Reference in New Issue
Block a user