fix: sync columns and data counts in slaughter bars

This commit is contained in:
2026-02-02 10:05:02 +03:30
parent 88392f378d
commit 52fab173c8

View File

@@ -5,7 +5,7 @@ import {
Tabs,
TextField,
Tooltip,
Typography,
Typography
} from "@mui/material";
import { format } from "date-fns-jalali";
import { useContext, useEffect, useState } from "react";
@@ -23,7 +23,7 @@ import { RiFileExcel2Fill, RiSearchLine } from "react-icons/ri";
import {
LOADING_END,
LOADING_START,
OPEN_MODAL,
OPEN_MODAL
} from "../../../../lib/redux/slices/appSlice";
import { getRoleFromUrl } from "../../../../utils/getRoleFromUrl";
// import { getFaUserRole } from "../../../../utils/getFaUserRole";
@@ -132,7 +132,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "100px",
width: "100px"
},
{
name: "خریدار",
@@ -143,7 +143,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "کشتارکن اختصاصی",
@@ -156,7 +156,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "ماشین",
@@ -167,7 +167,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "100px",
width: "100px"
},
{
name: "راننده",
@@ -178,7 +178,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "کد بهداشتی حمل و نقل",
@@ -188,7 +188,7 @@ export const SlaughterBars = () => {
sortable: false,
wrap: true,
allowOverflow: true,
center: true,
center: true
// width: "80px",
},
{
@@ -199,7 +199,7 @@ export const SlaughterBars = () => {
sortable: false,
wrap: true,
allowOverflow: true,
center: true,
center: true
// width: "80px",
},
{
@@ -211,7 +211,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "50px",
width: "50px"
},
{
name: "تعداد اولیه",
@@ -222,7 +222,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "50px",
width: "50px"
},
{
name: "وزن اولیه بار (کیلوگرم)",
@@ -233,7 +233,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
width: "70px"
},
{
name: "میانگین وزن اولیه (کیلوگرم)",
@@ -244,7 +244,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
width: "70px"
},
{
name: "قیمت مرغدار",
@@ -255,7 +255,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "قیمت کشتارگاه",
@@ -266,7 +266,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "مرغدار",
@@ -277,7 +277,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "دامپزشک فارم",
@@ -291,7 +291,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "100px",
width: "100px"
},
{
name: "کدرهگیری سامانه قرنطینه",
@@ -324,7 +324,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "200px",
width: "200px"
},
{
name: "محل کشتار",
@@ -335,7 +335,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "شهر",
@@ -346,7 +346,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "تاریخ کشتار",
@@ -359,7 +359,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "80px",
width: "80px"
},
{
name: "کدسفارش کشتار",
@@ -370,7 +370,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
width: "70px"
},
{
name: "تعداد نهایی",
@@ -381,7 +381,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "50px",
width: "50px"
},
{
name: "وزن نهایی بار (کیلوگرم)",
@@ -392,7 +392,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
width: "70px"
},
{
name: "میانگین وزن نهایی (کیلوگرم)",
@@ -403,7 +403,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
width: "70px"
},
{
name: "وضعیت",
@@ -420,7 +420,7 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "90px",
width: "90px"
},
{
name: "عملیات",
@@ -440,7 +440,7 @@ export const SlaughterBars = () => {
updateTable={updateTable}
killHouseRequestKey={item.key}
/>
),
)
})
);
}}
@@ -455,8 +455,8 @@ export const SlaughterBars = () => {
wrap: true,
allowOverflow: true,
center: true,
width: "70px",
},
width: "70px"
}
];
const handleDateChange1 = (date) => {
@@ -486,7 +486,7 @@ export const SlaughterBars = () => {
textValue,
role_key: checkPathStartsWith("slaughter")
? selectedSubUser?.key || ""
: "",
: ""
})
).then((r) => {
setDashboardData(r.payload.data);
@@ -514,7 +514,7 @@ export const SlaughterBars = () => {
textValue,
role_key: checkPathStartsWith("slaughter")
? selectedSubUser?.key || ""
: "",
: ""
})
).then((r) => {
setDashboardData(r.payload.data);
@@ -619,6 +619,9 @@ export const SlaughterBars = () => {
return [
item.barCode,
`${item.killhouseUser?.name} (${item.killhouseUser?.killHouseOperator?.user?.mobile})`,
item?.killer
? `${item?.killer?.name} (${item?.killer?.killHouseOperator?.user?.mobile})`
: "-",
`${item.addCar.driver.typeCar} ${item.addCar.driver.pelak}`,
`${item.addCar.driver.driverName} (${item.addCar.driver.driverMobile})`,
<VetFarmEditTrafficCode
@@ -635,10 +638,21 @@ export const SlaughterBars = () => {
getRoleFromUrl() === "VetSupervisor"
}
/>,
item?.amount !== undefined && item?.amount !== null
? item?.amount?.toLocaleString() + " ﷼"
: "-",
item.poultryRequest.chickenBreed,
item.quantity?.toLocaleString(),
item?.weightInfo?.weight?.toLocaleString(),
item?.weightInfo?.indexWeight?.toLocaleString(),
item?.poultryRequest?.amount !== undefined &&
item?.poultryRequest?.amount !== null
? item?.poultryRequest?.amount?.toLocaleString() + " ﷼"
: "-",
item?.weightInfo?.killHousePrice !== undefined &&
item?.weightInfo?.killHousePrice !== null
? item?.weightInfo?.killHousePrice?.toLocaleString() + " ﷼"
: "-",
`${item.poultryRequest?.poultry?.unitName} (${item.poultryRequest.poultry?.user?.mobile})`,
item?.vetFarm?.vet?.user?.fullname
? item?.vetFarm?.vet?.user?.fullname +
@@ -668,6 +682,9 @@ export const SlaughterBars = () => {
? format(new Date(item?.poultryRequest.sendDate), "yyyy/MM/dd")
: "-",
item?.poultryRequest.orderCode,
item.acceptedRealQuantity?.toLocaleString(),
item?.acceptedRealWeight?.toLocaleString(),
item?.weightInfo?.finalIndexWeight?.toLocaleString(),
getItemState(item),
<Grid key={item.barCode}>
<Tooltip title="لغو بار">
@@ -683,7 +700,7 @@ export const SlaughterBars = () => {
updateTable={updateTable}
killHouseRequestKey={item.key}
/>
),
)
})
);
}}
@@ -691,7 +708,7 @@ export const SlaughterBars = () => {
<CancelIcon />
</IconButton>
</Tooltip>
</Grid>,
</Grid>
];
});
@@ -738,7 +755,7 @@ export const SlaughterBars = () => {
"تعداد بار های دارای کد قرنطینه",
"تعداد نهایی بار",
"وزن نهایی بار",
"میانگین وزن نهایی ",
"میانگین وزن نهایی "
]}
data={[
[
@@ -749,8 +766,8 @@ export const SlaughterBars = () => {
dashboardData?.clearanceCodeCount?.toLocaleString(),
dashboardData?.acceptedRealQuantity?.toLocaleString(),
dashboardData?.acceptedRealWeight?.toLocaleString(),
dashboardData?.finalIndexWeight?.toLocaleString(),
],
dashboardData?.finalIndexWeight?.toLocaleString()
]
]}
title={"خلاصه اطلاعات"}
/>