refer reason

This commit is contained in:
2024-10-12 10:26:45 +00:00
committed by AmirHossein Mahmoodi
parent f62d5d4824
commit 378882e2e0
4 changed files with 17 additions and 11 deletions

View File

@@ -7,14 +7,13 @@ import Link from "next/link";
const PrintHistory = ({attachment}) => { const PrintHistory = ({attachment}) => {
const t = useTranslations(); const t = useTranslations();
return ( return (
<Button <Button
color="primary" color="primary"
variant="contained" variant="contained"
size="small" size="small"
component={Link} component={Link}
href={attachment.file} href={attachment.file || ""}
target="_blank" target="_blank"
sx={{ textTransform: "unset", alignSelf: "center", mx: 0.25 }} sx={{ textTransform: "unset", alignSelf: "center", mx: 0.25 }}
> >

View File

@@ -20,7 +20,8 @@ import {useEffect, useState} from "react";
const action_name = { const action_name = {
"confirm" : "تایید", "confirm" : "تایید",
"reject":"عدم تایید", "reject":"عدم تایید",
"refer":"ارجاع" "refer":"ارجاع",
"reserve" : "رزرو"
} }
const TableContent = ({rowId}) => { const TableContent = ({rowId}) => {

View File

@@ -271,17 +271,20 @@ function DashboardPassengerOfficeComponent() {
), ),
}, },
{ {
accessorFn: (row) => row.latest_history.expert_description, accessorFn: (row) => row.latest_history ? row.latest_history.expert_description : null,
id: "latest_history.expert_description", id: "latest_history.expert_description",
header: t("PassengerBoss.refer_reason"), header: t("PassengerBoss.refer_reason"),
enableColumnFilter: false, enableColumnFilter: false,
datatype: "text", datatype: "text",
filterFn: "contains", filterFn: "contains",
columnFilterModeOptions: ["contains", "equals", "notEquals"], columnFilterModeOptions: ["contains", "equals", "notEquals"],
Cell: ({row}) => { Cell: ({ row }) => {
const latestHistory = row.original.latest_history;
return ( return (
<Typography variant="body2">{row.original.latest_history.action === 'refer'? row.original.latest_history.expert_description : null}</Typography> <Typography variant="body2">
) {latestHistory && latestHistory.action === 'refer' ? latestHistory.expert_description : null}
</Typography>
);
}, },
}, },
{ {

View File

@@ -413,17 +413,20 @@ function DashboardTransportationAssistanceComponent() {
), ),
}, },
{ {
accessorFn: (row) => row.latest_history.expert_description, accessorFn: (row) => row.latest_history ? row.latest_history.expert_description : null,
id: "latest_history.expert_description", id: "latest_history.expert_description",
header: t("TransportationAssistance.refer_reason"), header: t("TransportationAssistance.refer_reason"),
enableColumnFilter: false, enableColumnFilter: false,
datatype: "text", datatype: "text",
filterFn: "contains", filterFn: "contains",
columnFilterModeOptions: ["contains", "equals", "notEquals"], columnFilterModeOptions: ["contains", "equals", "notEquals"],
Cell: ({row}) => { Cell: ({ row }) => {
const latestHistory = row.original.latest_history;
return ( return (
<Typography variant="body2">{row.original.latest_history.action === 'refer'? row.original.latest_history.expert_description : null}</Typography> <Typography variant="body2">
) {latestHistory && latestHistory.action === 'refer' ? latestHistory.expert_description : null}
</Typography>
);
}, },
}, },
{ {