add: new column to enter load information
This commit is contained in:
@@ -9,7 +9,7 @@ import { SPACING } from "../../../../data/spacing";
|
|||||||
import { DatePicker } from "@mui/x-date-pickers";
|
import { DatePicker } from "@mui/x-date-pickers";
|
||||||
import {
|
import {
|
||||||
LOADING_END,
|
LOADING_END,
|
||||||
LOADING_START,
|
LOADING_START
|
||||||
} from "../../../../lib/redux/slices/appSlice";
|
} from "../../../../lib/redux/slices/appSlice";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { format } from "date-fns-jalali";
|
import { format } from "date-fns-jalali";
|
||||||
@@ -29,7 +29,7 @@ const ROLES = {
|
|||||||
SUPER_ADMIN: "SuperAdmin",
|
SUPER_ADMIN: "SuperAdmin",
|
||||||
VET_SUPERVISOR: "VetSupervisor",
|
VET_SUPERVISOR: "VetSupervisor",
|
||||||
VET_FARM: "VetFarm",
|
VET_FARM: "VetFarm",
|
||||||
CITY_VET: "CityVet",
|
CITY_VET: "CityVet"
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_PER_PAGE = 10;
|
const DEFAULT_PER_PAGE = 10;
|
||||||
@@ -63,7 +63,7 @@ const buildApiUrl = (params) => {
|
|||||||
date1: date1 || "",
|
date1: date1 || "",
|
||||||
date2: date2 || "",
|
date2: date2 || "",
|
||||||
page: page || DEFAULT_PAGE,
|
page: page || DEFAULT_PAGE,
|
||||||
page_size: perPage || DEFAULT_PER_PAGE,
|
page_size: perPage || DEFAULT_PER_PAGE
|
||||||
});
|
});
|
||||||
|
|
||||||
if (roleKey) {
|
if (roleKey) {
|
||||||
@@ -77,7 +77,7 @@ const isTrafficCodeEditable = (role, item) => {
|
|||||||
const adminRoles = [
|
const adminRoles = [
|
||||||
ROLES.PROVINCE_OPERATOR,
|
ROLES.PROVINCE_OPERATOR,
|
||||||
ROLES.SUPER_ADMIN,
|
ROLES.SUPER_ADMIN,
|
||||||
ROLES.VET_SUPERVISOR,
|
ROLES.VET_SUPERVISOR
|
||||||
];
|
];
|
||||||
|
|
||||||
if (adminRoles.includes(role)) {
|
if (adminRoles.includes(role)) {
|
||||||
@@ -136,7 +136,7 @@ export const EnterLoadInformation = () => {
|
|||||||
if (isKillHouse) {
|
if (isKillHouse) {
|
||||||
dispatch(
|
dispatch(
|
||||||
slaughterGetPermissionToVetService({
|
slaughterGetPermissionToVetService({
|
||||||
role_key: roleKey,
|
role_key: roleKey
|
||||||
})
|
})
|
||||||
).then((r) => {
|
).then((r) => {
|
||||||
setChecked(r.payload.data?.[0]?.allow || false);
|
setChecked(r.payload.data?.[0]?.allow || false);
|
||||||
@@ -156,7 +156,7 @@ export const EnterLoadInformation = () => {
|
|||||||
date2: selectedDate2,
|
date2: selectedDate2,
|
||||||
page: pageNumber,
|
page: pageNumber,
|
||||||
perPage,
|
perPage,
|
||||||
roleKey,
|
roleKey
|
||||||
});
|
});
|
||||||
|
|
||||||
const response = await axios.get(url);
|
const response = await axios.get(url);
|
||||||
@@ -176,7 +176,7 @@ export const EnterLoadInformation = () => {
|
|||||||
perPage,
|
perPage,
|
||||||
roleKey,
|
roleKey,
|
||||||
page,
|
page,
|
||||||
dispatch,
|
dispatch
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ export const EnterLoadInformation = () => {
|
|||||||
selectedDate1,
|
selectedDate1,
|
||||||
selectedDate2,
|
selectedDate2,
|
||||||
text: textValue,
|
text: textValue,
|
||||||
role_key: roleKey,
|
role_key: roleKey
|
||||||
})
|
})
|
||||||
).then((r) => {
|
).then((r) => {
|
||||||
setDashboardData(r.payload.data);
|
setDashboardData(r.payload.data);
|
||||||
@@ -216,7 +216,7 @@ export const EnterLoadInformation = () => {
|
|||||||
{item.barCode}
|
{item.barCode}
|
||||||
</Typography>,
|
</Typography>,
|
||||||
<VetFarmEditTrafficCode
|
<VetFarmEditTrafficCode
|
||||||
key={i}
|
key={item.key}
|
||||||
updateTable={fetchApiData}
|
updateTable={fetchApiData}
|
||||||
killHouseRequestKey={item.key}
|
killHouseRequestKey={item.key}
|
||||||
trafficCode={item?.trafficCode}
|
trafficCode={item?.trafficCode}
|
||||||
@@ -255,6 +255,9 @@ export const EnterLoadInformation = () => {
|
|||||||
item?.barDocumentStatus?.title || "-",
|
item?.barDocumentStatus?.title || "-",
|
||||||
item?.finalBarState || "-",
|
item?.finalBarState || "-",
|
||||||
item?.poultryRequest?.freezing ? "انجماد" : "عادی",
|
item?.poultryRequest?.freezing ? "انجماد" : "عادی",
|
||||||
|
item?.poultryRequest?.freeSaleInProvince
|
||||||
|
? "فروش آزاد"
|
||||||
|
: "فروش دولتی" || "-"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
setTableData(transformedData || []);
|
setTableData(transformedData || []);
|
||||||
@@ -311,7 +314,7 @@ export const EnterLoadInformation = () => {
|
|||||||
const newValue = !checked;
|
const newValue = !checked;
|
||||||
dispatch(
|
dispatch(
|
||||||
slaughterPermissionToVetService({
|
slaughterPermissionToVetService({
|
||||||
allow: newValue,
|
allow: newValue
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
setChecked(newValue);
|
setChecked(newValue);
|
||||||
@@ -323,7 +326,7 @@ export const EnterLoadInformation = () => {
|
|||||||
"مجموع تعداد اولیه",
|
"مجموع تعداد اولیه",
|
||||||
"مجموع وزن اولیه (کیلوگرم)",
|
"مجموع وزن اولیه (کیلوگرم)",
|
||||||
"مجموع تعداد تحویلی دامپزشک",
|
"مجموع تعداد تحویلی دامپزشک",
|
||||||
"مجموع وزن تحویلی دامپزشک (کیلوگرم)",
|
"مجموع وزن تحویلی دامپزشک (کیلوگرم)"
|
||||||
];
|
];
|
||||||
|
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
@@ -347,6 +350,7 @@ export const EnterLoadInformation = () => {
|
|||||||
"وضعیت سند",
|
"وضعیت سند",
|
||||||
"وضعیت بار",
|
"وضعیت بار",
|
||||||
"نوع کشتار",
|
"نوع کشتار",
|
||||||
|
"نوع فروش"
|
||||||
];
|
];
|
||||||
|
|
||||||
const dashboardRow = [
|
const dashboardRow = [
|
||||||
@@ -354,7 +358,7 @@ export const EnterLoadInformation = () => {
|
|||||||
formatNumber(dashboardData?.firstQuantity),
|
formatNumber(dashboardData?.firstQuantity),
|
||||||
formatNumber(dashboardData?.firstWeight),
|
formatNumber(dashboardData?.firstWeight),
|
||||||
formatNumber(dashboardData?.vetAcceptedRealQuantity),
|
formatNumber(dashboardData?.vetAcceptedRealQuantity),
|
||||||
formatNumber(dashboardData?.vetAcceptedRealWeight),
|
formatNumber(dashboardData?.vetAcceptedRealWeight)
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user