Merge branch 'feature/mohammad_add_column' into 'develop'

This commit is contained in:
AmirHossein Mahmoodi
2023-12-10 13:48:18 +00:00
6 changed files with 193 additions and 32 deletions

View File

@@ -191,6 +191,8 @@
"id": "کد یکتا",
"national_id": "کد ملی",
"phone_number": "موبایل",
"proposed_amount": "مبلغ پیشنهادی",
"approved_amount": "مبلغ تصویب شده",
"created_at": "تاریخ درخواست",
"updated_at": "تاریخ بروزرسانی",
"navgan_id": "کد ناوگان",
@@ -206,6 +208,7 @@
"id": "کد یکتا",
"national_id": "کد ملی",
"phone_number": "موبایل",
"proposed_amount": "مبلغ پیشنهادی",
"created_at": "تاریخ درخواست",
"updated_at": "تاریخ بروزرسانی",
"navgan_id": "کد ناوگان",
@@ -282,6 +285,8 @@
"id": "کد یکتا",
"national_id": "کد ملی",
"phone_number": "موبایل",
"proposed_amount": "مبلغ پیشنهادی",
"approved_amount": "مبلغ تصویب شده",
"created_at": "تاریخ درخواست",
"updated_at": "تاریخ بروزرسانی",
"navgan_id": "کد ناوگان",
@@ -357,7 +362,7 @@
"approved_amount_number": "مبلغ تصویب شده باید عدد باشد",
"toman": "میلیون تومان",
"proposed_amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
"proposed_amount": قدار پیشنهادی",
"proposed_amount": بلغ پیشنهادی",
"proposed_amount_positive": "مقدار پیشنهادی باید مثبت باشد",
"proposed_amount_number": "مقدار پیشنهادی باید عدد باشد"
},
@@ -537,6 +542,17 @@
"update_again": "بروزرسانی مجدد"
},
"LoanHistory": {
"id": "کد یکتا",
"name": "نام",
"national_id": "کد ملی",
"phone_number": "موبایل",
"proposed_amount": "مبلغ پیشنهادی",
"approved_amount": "مبلغ تصویب شده",
"created_at": "تاریخ درخواست",
"updated_at": "تاریخ بروزرسانی",
"navgan_id": "کد ناوگان",
"vehicle_type": "نوع ماشین",
"state_name": "وضعیت درخواست",
"history": "تاریخچه",
"Table_history_error": "خطا در دریافت اطلاعات",
"history_report": "فایل ضمیمه",
@@ -547,4 +563,4 @@
"Table_head_file": "فایل پیوست",
"empty_history_detail": "سابقه ای برای این وام وجود ندارد"
}
}
}

View File

@@ -14,7 +14,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.id,
id: "id",
header: t("PassengerOffice.id"),
header: t("LoanHistory.id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -33,7 +33,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.name,
id: "name",
header: t("MachinaryOffice.name"),
header: t("LoanHistory.name"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -45,7 +45,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.national_id,
id: "national_id",
header: t("MachinaryOffice.national_id"),
header: t("LoanHistory.national_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -64,7 +64,45 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.phone_number,
id: "phone_number",
header: t("MachinaryOffice.phone_number"),
header: t("LoanHistory.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.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}</Typography>
),
},
{
accessorFn: (row) => row.approved_amount,
id: "approved_amount",
header: t("LoanHistory.approved_amount"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -84,7 +122,7 @@ function DashboardLoanHistoryComponent() {
accessorFn: (row) =>
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "created_at",
header: t("MachinaryOffice.created_at"),
header: t("LoanHistory.created_at"),
enableColumnFilter: true,
datatype: "date",
filterFn: "lessThan",
@@ -103,7 +141,7 @@ function DashboardLoanHistoryComponent() {
accessorFn: (row) =>
moment(row.updated_at).locale("fa").format("HH:mm | yyyy/MM/DD"),
id: "updated_at",
header: t("MachinaryOffice.updated_at"),
header: t("LoanHistory.updated_at"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({renderedCellValue}) => (
@@ -113,7 +151,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.navgan_id,
id: "navgan_id",
header: t("MachinaryOffice.navgan_id"),
header: t("LoanHistory.navgan_id"),
enableColumnFilter: true,
datatype: "numeric",
filterFn: "equals",
@@ -132,7 +170,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.vehicle_type,
id: "vehicle_type",
header: t("MachinaryOffice.vehicle_type"),
header: t("LoanHistory.vehicle_type"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
@@ -144,7 +182,7 @@ function DashboardLoanHistoryComponent() {
{
accessorFn: (row) => row.state_name,
id: "state_id",
header: t("MachinaryOffice.state_name"),
header: t("LoanHistory.state_name"),
enableColumnFilter: false,
datatype: "numeric",
Cell: ({renderedCellValue}) => (

View File

@@ -82,6 +82,44 @@ function DashboardNavganProvinceManagerComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
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}</Typography>
),
},
{
accessorFn: (row) => row.approved_amount,
id: "approved_amount",
header: t("NavganProvinceManager.approved_amount"),
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"),

View File

@@ -82,6 +82,25 @@ function DashboardPassengerOfficeComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
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}</Typography>
),
},
{
accessorFn: (row) =>
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),

View File

@@ -6,7 +6,9 @@ import {
Button,
DialogActions,
DialogContent,
FormHelperText, Grid, LinearProgress,
FormHelperText,
Grid,
LinearProgress,
Stack,
TextField,
Typography
@@ -18,13 +20,14 @@ import {useEffect, useState} from "react";
import * as Yup from "yup";
import CustomAccordion from "@/core/components/CustomAccordion";
import ImageContent from "@/core/components/ImageContent";
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeClick}) => {
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, 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 requestServer = useRequest({auth: true, notification: false})
const [accordionStates, setAccordionStates] = useState([]);
const [hasAccordionOpened, setHasAccordionOpened] = useState([]);
const {update_notification} = useNotification();
@@ -37,14 +40,14 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
useEffect(() => {
requestServer(`${GET_TRANSPORTATION_ASSISTANCE_DETAILS}/${rowId}`, 'get')
.then((response) => {
const booleanData = Array.from({ length: response.data.data.attachment_files.length }, () => false);
setAccordionStates(booleanData);
setHasAccordionOpened(booleanData);
setDetailsData(response.data)
const booleanData = Array.from({length: response.data.data.attachment_files.length}, () => false);
setAccordionStates(booleanData);
setHasAccordionOpened(booleanData);
setDetailsData(response.data)
})
.catch(() => {
}).finally(() => {
setLoading(false);
setLoading(false);
});
}, []);
@@ -52,13 +55,11 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
const newAccordionStates = accordionStates.map((state, i) => i === index ? !state : false);
setAccordionStates(newAccordionStates);
if (!newAccordionStates[index])
{
if (!newAccordionStates[index]) {
handleSizeChangeClick('sm');
setHasImageShown(false);
setIsSkeleton(false)
}
else {
} else {
handleSizeChangeClick('xl');
setHasImageShown(true);
setImageLink(detailsList.data.attachment_files[index])
@@ -144,8 +145,11 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
const numberShowBox = () => {
return (
<>
<Box sx={{ border: '1px solid #ccc' ,p:2 , mb:2 , borderRadius: '8px'}}>
<Typography sx={{color: "primary.main" , fontWeight: 500}}>{t("ConfirmDialog.approved_amount")} {t("sidebar.machinery-expert")}</Typography>
<Box sx={{border: '1px solid #ccc', p: 2, mb: 2, borderRadius: '8px'}}>
<Typography sx={{
color: "primary.main",
fontWeight: 500
}}>{t("ConfirmDialog.proposed_amount")} {t("sidebar.machinery-expert")}</Typography>
<Typography pt={1}>
{isNaN((detailsList?.data?.proposed_amount) / 10)
? ""
@@ -153,8 +157,11 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
{t("ConfirmDialog.unit")}
</Typography>
</Box>
<Box sx={{ border: '1px solid #ccc' ,p:2 , mb:2 , borderRadius: '8px'}}>
<Typography sx={{color: "primary.main" , fontWeight: 500}}>{t("ConfirmDialog.approved_amount")} {t("secondary.passenger-boss")}</Typography>
<Box sx={{border: '1px solid #ccc', p: 2, mb: 2, borderRadius: '8px'}}>
<Typography sx={{
color: "primary.main",
fontWeight: 500
}}>{t("ConfirmDialog.approved_amount")} {t("secondary.passenger-boss")}</Typography>
<Typography pt={1}>
{isNaN((detailsList?.data?.approved_amount) / 10)
? ""
@@ -170,7 +177,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
<DialogContent>
<Grid container spacing={2}>
<Grid item xs={hasImageShown ? 6 : 12}>
{loading ? <LinearProgress /> :
{loading ? <LinearProgress/> :
<>
{numberShowBox()}
{renderCustomAccordions()}
@@ -220,9 +227,14 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
</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>
<Stack sx={{
display: hasImageShown ? 'flex' : 'none',
alignItems: 'center',
gap: 0.5,
justifyContent: 'center'
}}>
<ImageContent imageLink={imageLink} isSkeleton={isSkeleton} setIsSkeleton={setIsSkeleton}/>
</Stack>
</Grid>
</Grid>
</DialogContent>
@@ -233,7 +245,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog ,handleSizeChangeCl
</Button>
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
disabled={formik.isSubmitting || !formik.isValid ||
hasAccordionOpened.some((opened) => !opened) }
hasAccordionOpened.some((opened) => !opened)}
>
{t("ConfirmDialog.button-confirm")}
</Button>

View File

@@ -82,6 +82,44 @@ function DashboardTransportationAssistanceComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
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}</Typography>
),
},
{
accessorFn: (row) => row.approved_amount,
id: "approved_amount",
header: t("TransportationAssistance.approved_amount"),
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"),