Fix: some issues like dispatch and wrong keys
This commit is contained in:
@@ -36,12 +36,13 @@ export const SenfStock = () => {
|
||||
const selectedSubUser = useSelector(
|
||||
(state) => state.userSlice.selectedSubUser
|
||||
);
|
||||
useEffect(() => {
|
||||
|
||||
const handleRefreshServices = () => {
|
||||
dispatch(
|
||||
senfGetAllocationDashboardService({
|
||||
date1: selectedDate1,
|
||||
date2: selectedDate2,
|
||||
role_key: checkPathStartsWith("senf") ? selectedSubUser?.key : "",
|
||||
role_key: selectedSubUser?.key || "",
|
||||
search: text,
|
||||
})
|
||||
);
|
||||
@@ -49,17 +50,21 @@ export const SenfStock = () => {
|
||||
senfGetInventoryAllocatedService({
|
||||
date1: selectedDate1,
|
||||
date2: selectedDate2,
|
||||
role_key: checkPathStartsWith("senf") ? selectedSubUser?.key : "",
|
||||
role_key: selectedSubUser?.key || "",
|
||||
type: statusTab,
|
||||
search: text,
|
||||
})
|
||||
);
|
||||
dispatch(
|
||||
guildSalesInfoDashboardService({
|
||||
role_key: checkPathStartsWith("senf") ? selectedSubUser?.key : "",
|
||||
role_key: selectedSubUser?.key,
|
||||
})
|
||||
);
|
||||
}, [selectedDate1, selectedDate2, selectedSubUser?.key, statusTab, dispatch]);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
handleRefreshServices();
|
||||
}, [selectedDate1, selectedDate2, selectedSubUser?.key, statusTab]);
|
||||
|
||||
useEffect(() => {
|
||||
const items = senfGetInventoryAllocated?.results || [];
|
||||
@@ -93,19 +98,16 @@ export const SenfStock = () => {
|
||||
`${sellerRoleFa} ${sellerName} (${sellerMobile})`,
|
||||
formatJustDate(item.date),
|
||||
(item?.weightOfCarcasses || 0).toLocaleString() + " کیلوگرم",
|
||||
item?.quota === "free" ? "آزاد" : "دولتی",
|
||||
<Grid container direction="column" key={item.key}>
|
||||
{item?.receiverRealNumberOfCarcasses && (
|
||||
<>
|
||||
<Typography variant="caption">
|
||||
{item?.receiverRealNumberOfCarcasses?.toLocaleString() +
|
||||
" قطعه"}
|
||||
</Typography>
|
||||
<Typography variant="caption">
|
||||
{item?.receiverRealWeightOfCarcasses?.toLocaleString() +
|
||||
" کیلوگرم"}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
{/* <Typography variant="caption">
|
||||
{item?.receiverRealNumberOfCarcasses?.toLocaleString() + " قطعه"}
|
||||
</Typography> */}
|
||||
<Typography variant="caption">
|
||||
{item?.receiverRealWeightOfCarcasses?.toLocaleString() +
|
||||
" کیلوگرم"}
|
||||
</Typography>
|
||||
|
||||
{/* {item?.receiverState === "pending" && (
|
||||
<Grid>
|
||||
<Button
|
||||
@@ -132,7 +134,12 @@ export const SenfStock = () => {
|
||||
dispatch(
|
||||
OPEN_MODAL({
|
||||
title: "ثبت تحویل بار",
|
||||
content: <GuildReceiveBarOperation item={item} />,
|
||||
content: (
|
||||
<GuildReceiveBarOperation
|
||||
item={item}
|
||||
onSuccess={handleRefreshServices}
|
||||
/>
|
||||
),
|
||||
})
|
||||
);
|
||||
}}
|
||||
@@ -208,7 +215,7 @@ export const SenfStock = () => {
|
||||
(
|
||||
guildSalesInfoDashboard?.totalFreeOutputWeight || 0
|
||||
).toLocaleString(),
|
||||
"0",
|
||||
guildSalesInfoDashboard?.segmentationsWeight || "0",
|
||||
"0",
|
||||
(
|
||||
guildSalesInfoDashboard?.totalGovernmentalRemainWeight || 0
|
||||
@@ -317,14 +324,16 @@ export const SenfStock = () => {
|
||||
"فروشنده",
|
||||
"تاریخ تخصیص",
|
||||
"وزن تخصیص",
|
||||
"تعداد/وزن واقعی تحویلی",
|
||||
"نوع فروش",
|
||||
"وزن واقعی تحویلی",
|
||||
]
|
||||
: [
|
||||
"ردیف",
|
||||
"فروشنده",
|
||||
"تاریخ تخصیص",
|
||||
"وزن تخصیص",
|
||||
"تعداد/وزن واقعی تحویلی",
|
||||
"نوع فروش",
|
||||
"وزن واقعی تحویلی",
|
||||
"عملیات",
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user