fixed slaughter manage guilds
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS_REQUESTS,
|
||||
ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS,
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS,
|
||||
ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
|
||||
ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_GUILDS,
|
||||
// ROUTE_SUPER_ADMIN_ROUTE_GUILDS,
|
||||
ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS_REQUESTS,
|
||||
@@ -40,15 +41,7 @@ export const GuildsOperations = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{[
|
||||
ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS,
|
||||
ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS,
|
||||
ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS,
|
||||
ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_GUILDS,
|
||||
ROUTE_ADMINX_ROUTE_OUT_PROVINCE_GUILDS,
|
||||
ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_GUILDS,
|
||||
].includes(pathname) && <BackButton />}
|
||||
|
||||
<BackButton />
|
||||
<Grid
|
||||
container
|
||||
gap={SPACING.SMALL}
|
||||
@@ -61,6 +54,7 @@ export const GuildsOperations = () => {
|
||||
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_GUILDS,
|
||||
ROUTE_ADMINX_ROUTE_MANAGE_GUILDS,
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS,
|
||||
ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
|
||||
].includes(pathname) && (
|
||||
<>
|
||||
<NavLink
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
||||
import { Button, TextField } from "@mui/material";
|
||||
import ResponsiveTable from "../../../../components/responsive-table/ResponsiveTable";
|
||||
import {
|
||||
DRAWER,
|
||||
LOADING_END,
|
||||
LOADING_START,
|
||||
} from "../../../../lib/redux/slices/appSlice";
|
||||
@@ -11,6 +12,7 @@ import { useDispatch } from "react-redux";
|
||||
import { RiSearchLine } from "react-icons/ri";
|
||||
import { fetchOutProvinceLegalBuyers } from "../../services/province-out-province-buyers";
|
||||
import { ProvinceTrueGuildsOutProvinceOperations } from "../province-true-guilds-out-province/ProvinceTrueGuildsOutProvinceOperations";
|
||||
import { SlaughterSellCarcassOutProvinceAddBuyer } from "../../../slaughter-house/components/slaughter-sell-carcass-out-province-add-buyer/SlaughterSellCarcassOutProvinceAddBuyer";
|
||||
|
||||
export const ProvinceLegalGuildsOutProvince = ({ userType }) => {
|
||||
const IS_STEWARD = userType === "steward";
|
||||
@@ -109,6 +111,31 @@ export const ProvinceLegalGuildsOutProvince = ({ userType }) => {
|
||||
alignItems="center"
|
||||
gap={2}
|
||||
>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
dispatch(
|
||||
DRAWER({
|
||||
right: !(window.innerWidth <= 600),
|
||||
bottom: window.innerWidth <= 600,
|
||||
size: 340,
|
||||
content: (
|
||||
<SlaughterSellCarcassOutProvinceAddBuyer
|
||||
updateTable={() => {
|
||||
setPage(1);
|
||||
fetchApiData(1);
|
||||
}}
|
||||
defaultPersonType={"legal"}
|
||||
userType={userType}
|
||||
/>
|
||||
),
|
||||
title: `افزودن ${IS_STEWARD ? "مباشر" : "صنف"} خارج از استان`,
|
||||
})
|
||||
);
|
||||
}}
|
||||
>
|
||||
{`افزودن ${IS_STEWARD ? "مباشر" : "صنف"}`}
|
||||
</Button>
|
||||
<Grid>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<TextField
|
||||
|
||||
@@ -87,11 +87,11 @@ export const ReturnedCargo = ({
|
||||
state,
|
||||
item?.car?.pelak || "-",
|
||||
item?.car?.driverName || "-",
|
||||
item?.nonReceipt ? "دارد" : "ندارد",
|
||||
item?.nonReceiptMessage || "-",
|
||||
item?.clearanceCode || "-",
|
||||
(item?.nonReceipt && item?.mainNonReceipt ? `کاربر` : "سیستم") +
|
||||
" " +
|
||||
formatTime(item?.modifyDate),
|
||||
item?.nonReceiptMessage || "-",
|
||||
];
|
||||
|
||||
if (["AdminX", "SuperAdmin"].includes(getRoleFromUrl())) {
|
||||
@@ -137,9 +137,9 @@ export const ReturnedCargo = ({
|
||||
"وضعیت تایید",
|
||||
"پلاک خودرو",
|
||||
"نام راننده",
|
||||
"عدم دریافت",
|
||||
"پیام عدم دریافت",
|
||||
"کدرهگیری سامانه قرنطینه",
|
||||
"نوع برگشت",
|
||||
"پیام عدم دریافت",
|
||||
];
|
||||
|
||||
if (["AdminX", "SuperAdmin"].includes(getRoleFromUrl())) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
||||
import { Button, TextField } from "@mui/material";
|
||||
import ResponsiveTable from "../../../../components/responsive-table/ResponsiveTable";
|
||||
import {
|
||||
DRAWER,
|
||||
LOADING_END,
|
||||
LOADING_START,
|
||||
} from "../../../../lib/redux/slices/appSlice";
|
||||
@@ -11,6 +12,8 @@ import { useDispatch } from "react-redux";
|
||||
import { RiSearchLine } from "react-icons/ri";
|
||||
import { fetchOutProvinceRealBuyers } from "../../services/province-out-province-buyers";
|
||||
import { ProvinceTrueGuildsOutProvinceOperations } from "./ProvinceTrueGuildsOutProvinceOperations";
|
||||
import { SlaughterSellCarcassOutProvinceAddBuyer } from "../../../slaughter-house/components/slaughter-sell-carcass-out-province-add-buyer/SlaughterSellCarcassOutProvinceAddBuyer";
|
||||
import { SPACING } from "../../../../data/spacing";
|
||||
|
||||
export const ProvinceTrueGuildsOutProvince = ({ userType }) => {
|
||||
const IS_STEWARD = userType === "steward";
|
||||
@@ -109,6 +112,36 @@ export const ProvinceTrueGuildsOutProvince = ({ userType }) => {
|
||||
>
|
||||
<Grid>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Button
|
||||
variant="contained"
|
||||
sx={{
|
||||
mr: SPACING.SMALL,
|
||||
}}
|
||||
onClick={() => {
|
||||
dispatch(
|
||||
DRAWER({
|
||||
right: !(window.innerWidth <= 600),
|
||||
bottom: window.innerWidth <= 600,
|
||||
size: 340,
|
||||
content: (
|
||||
<SlaughterSellCarcassOutProvinceAddBuyer
|
||||
updateTable={() => {
|
||||
setPage(1);
|
||||
fetchApiData(1);
|
||||
}}
|
||||
defaultPersonType={"real"}
|
||||
userType={userType}
|
||||
/>
|
||||
),
|
||||
title: `افزودن ${
|
||||
IS_STEWARD ? "مباشر" : "صنف"
|
||||
} خارج از استان`,
|
||||
})
|
||||
);
|
||||
}}
|
||||
>
|
||||
{`افزودن ${IS_STEWARD ? "مباشر" : "صنف"}`}
|
||||
</Button>
|
||||
<TextField
|
||||
id="outlined-basic"
|
||||
size="small"
|
||||
|
||||
@@ -15,6 +15,8 @@ import {
|
||||
Grid,
|
||||
TextField,
|
||||
IconButton,
|
||||
Tooltip,
|
||||
Button,
|
||||
} from "@mui/material";
|
||||
import ToggleOffOutlinedIcon from "@mui/icons-material/ToggleOffOutlined";
|
||||
import ToggleOnIcon from "@mui/icons-material/ToggleOn";
|
||||
@@ -23,6 +25,7 @@ import { DatePicker } from "@mui/x-date-pickers";
|
||||
import moment from "moment";
|
||||
import { formatJustDate } from "../../../../utils/formatTime";
|
||||
import { CheckCleanceCode } from "../../../../components/check-clearance-code/ChechClearanceCode";
|
||||
import { RiFileExcel2Fill } from "react-icons/ri";
|
||||
|
||||
export const TotalCargoInformation = () => {
|
||||
const [cargoInformation, setCargoInformation] = useState(null);
|
||||
@@ -511,6 +514,26 @@ export const TotalCargoInformation = () => {
|
||||
>
|
||||
<SearchIcon />
|
||||
</IconButton>
|
||||
<Tooltip title="خروجی اکسل">
|
||||
<a
|
||||
href={`https://rsibackend.rasadyar.com/app/all_products_transport_excel/?${
|
||||
selectedProduct
|
||||
? "product_type=" + selectedProduct + "&"
|
||||
: ""
|
||||
}${selectedDate1 ? "date1=" + selectedDate1 + "&" : ""}${
|
||||
selectedDate2 ? "date2=" + selectedDate2 + "&" : ""
|
||||
}${
|
||||
selectedProvince
|
||||
? "destination_province=" + selectedProvince
|
||||
: ""
|
||||
}`}
|
||||
rel="noreferrer"
|
||||
>
|
||||
<Button color="success">
|
||||
<RiFileExcel2Fill size={32} />
|
||||
</Button>
|
||||
</a>
|
||||
</Tooltip>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -159,7 +159,9 @@ export const ProvinceSellCarcassInProvince = ({ updateTable, priceInfo }) => {
|
||||
"تایید شده"
|
||||
) : item?.loggedRegistrationCode ? (
|
||||
item.loggedRegistrationCode
|
||||
) : item?.registrationCode ? (
|
||||
) : item?.registrationCode &&
|
||||
item?.allocationType !== "ColdHouse" &&
|
||||
item?.activeExpireDateTime ? (
|
||||
<SlaughterSellCarcassInProvinceSubmitRegistrationCode
|
||||
key={i}
|
||||
fetchApiData={fetchApiData}
|
||||
|
||||
@@ -29,6 +29,8 @@ import { provinceGetNationalDocumentsService } from "../../../province/services/
|
||||
import { LabelField } from "../../../../components/label-field/LabelField";
|
||||
import { extractProvinceFromAddress } from "../../../../utils/address";
|
||||
|
||||
// userType enums = steward | steward_true | steward_legal | _true | _legal
|
||||
|
||||
export const SlaughterSellCarcassOutProvinceAddBuyer = ({
|
||||
updateTable,
|
||||
isEdit,
|
||||
@@ -460,6 +462,7 @@ export const SlaughterSellCarcassOutProvinceAddBuyer = ({
|
||||
/>
|
||||
</RadioGroup>
|
||||
</LabelField>
|
||||
|
||||
<Typography mt={2}>
|
||||
{"استعلام "}
|
||||
{formik2.values.personType === "legal"
|
||||
|
||||
@@ -8,7 +8,6 @@ import { RiFileExcel2Fill, RiSearchLine } from "react-icons/ri";
|
||||
import { AppContext } from "../../../../contexts/AppContext";
|
||||
import ResponsiveTable from "../../../../components/responsive-table/ResponsiveTable";
|
||||
import { getRoleFromUrl } from "../../../../utils/getRoleFromUrl";
|
||||
import { getFaUserRole } from "../../../../utils/getFaUserRole";
|
||||
import {
|
||||
LOADING_END,
|
||||
LOADING_START,
|
||||
@@ -19,6 +18,7 @@ import { Grid } from "../../../../components/grid/Grid";
|
||||
import { format } from "date-fns-jalali";
|
||||
import { SPACING } from "../../../../data/spacing";
|
||||
import { checkPathStartsWith } from "../../../../utils/checkPathStartsWith";
|
||||
import { formatTime } from "../../../../utils/formatTime";
|
||||
|
||||
export const VetFarmDeletedBars = () => {
|
||||
const [data, setData] = useState([]);
|
||||
@@ -327,27 +327,10 @@ export const VetFarmDeletedBars = () => {
|
||||
item?.trafficCode || "",
|
||||
item?.amount ? item.amount.toLocaleString() + " ﷼" : "0 ﷼",
|
||||
item?.clearanceCode || "-",
|
||||
|
||||
item?.barRemover
|
||||
? `${item.barRemover?.fullName || ""} (${getFaUserRole(
|
||||
item.barRemover?.role
|
||||
)}) (${
|
||||
item.barRemover?.date
|
||||
? (() => {
|
||||
try {
|
||||
const date = new Date(item.barRemover.date);
|
||||
return isNaN(date.getTime())
|
||||
? "-"
|
||||
: format(date, "yyyy/MM/dd");
|
||||
} catch (error) {
|
||||
console.error("Error formatting barRemover date:", error);
|
||||
return "-";
|
||||
}
|
||||
})()
|
||||
: "-"
|
||||
})`
|
||||
: "-",
|
||||
item?.nonReceipt ? `(عدم وصول) ${item?.message || ""}` : "-",
|
||||
(item?.nonReceipt && item?.mainNonReceipt ? `کاربر` : "سیستم") +
|
||||
" " +
|
||||
formatTime(item?.modifyDate),
|
||||
item?.nonReceiptMessage || "-",
|
||||
];
|
||||
});
|
||||
|
||||
@@ -509,8 +492,8 @@ export const VetFarmDeletedBars = () => {
|
||||
"کد بهداشتی حمل و نقل",
|
||||
"قیمت مرغ زندهی بار",
|
||||
"کدرهگیری سامانه قرنطینه",
|
||||
"حذف کننده",
|
||||
"دلیل حذف",
|
||||
"نوع برگشت",
|
||||
"پیام عدم دریافت",
|
||||
]}
|
||||
handlePageChange={handlePageChange}
|
||||
totalRows={totalRows}
|
||||
|
||||
Reference in New Issue
Block a user