fixed bug

This commit is contained in:
AmirHossein Mahmoodi
2025-04-20 13:24:02 +03:30
parent 38899c322a
commit 4f5f3156c2
2 changed files with 26 additions and 20 deletions

View File

@@ -79,6 +79,22 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
<>
<DialogContent dividers>
<Grid container spacing={3} sx={{ alignItems: "center", justifyContent: "space-around" }}>
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Chip
icon={<RequestQuoteIcon />}
label={
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
مبلغ کل خسارت برآورد شده
</Typography>
}
/>
</Box>
<Divider sx={{ flex: 1, mx: 2 }} />
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
</Typography>
</Grid>
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Chip
@@ -111,22 +127,6 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
{(row.original?.deposit_daghi_amount / 1).toLocaleString() || "0"} ریال
</Typography>
</Grid>
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Chip
icon={<RequestQuoteIcon />}
label={
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
مبلغ کل خسارت برآورد شده
</Typography>
}
/>
</Box>
<Divider sx={{ flex: 1, mx: 2 }} />
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.800" }}>
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
</Typography>
</Grid>
<Grid item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Chip
@@ -140,7 +140,7 @@ const CreateFactorContent = ({ row, mutate, rowId, setOpenCreateFactorDialog })
</Box>
<Divider sx={{ flex: 1, mx: 2 }} />
<Typography variant="h5" sx={{ fontWeight: 600, color: "primary.main" }}>
{(row.original?.sum / 1).toLocaleString() || "0"} ریال
{(row.original?.sum - (row.original?.deposit_insurance_amount + row.original?.deposit_daghi_amount)).toLocaleString() || "0"} ریال
</Typography>
</Grid>
{!factorCreated && (

View File

@@ -23,7 +23,7 @@ const DamageItemContent = ({ rowId }) => {
try {
setLoading(true);
const response = await request(`${GET_DAMAGE_ITEM_DETAILS}/${rowId}`);
setData(response.data.data.damages);
setData(response.data.data);
} catch (error) {
} finally {
setLoading(false);
@@ -38,7 +38,7 @@ const DamageItemContent = ({ rowId }) => {
<DialogContent>
{loading ? (
<DialogLoading />
) : data ? (
) : data.damages ? (
<TableContainer sx={{ maxHeight: 600 }}>
<Table stickyHeader sx={{ minWidth: 800 }}>
<TableHead>
@@ -49,7 +49,7 @@ const DamageItemContent = ({ rowId }) => {
</TableRow>
</TableHead>
<TableBody>
{data.map((item) => {
{data.damages.map((item) => {
return (
<TableRow
key={item.id}
@@ -63,6 +63,12 @@ const DamageItemContent = ({ rowId }) => {
</TableRow>
);
})}
<TableRow
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
>
<TableCell colSpan={2} align="center">اجرت نصب</TableCell>
<TableCell>{(data.ojrate_nasb / 1).toLocaleString()}</TableCell>
</TableRow>
</TableBody>
</Table>
</TableContainer>