diff --git a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx
index 07e8983..cfd1ed6 100644
--- a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx
+++ b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx
@@ -3,8 +3,12 @@ import { Box } from "@mui/material";
import { useMemo } from "react";
import RowActions from "./RowActions";
import { GET_MACHINES_TABLE_LIST } from "@/core/utils/routes";
+import { useAuth } from "@/lib/contexts/auth";
const MachinesList = ({ machineType, setMachine, setOpenMachinesDialog }) => {
+ const {
+ user: { city_id },
+ } = useAuth();
const columns = useMemo(
() => [
{
@@ -40,7 +44,11 @@ const MachinesList = ({ machineType, setMachine, setOpenMachinesDialog }) => {
need_filter={true}
table_title="لیست خودرو ها"
columns={columns}
- specialFilter={[{ value: machineType, datatype: "text", id: "car_type", fn: "equals" }]}
+ specialFilter={[
+ { value: machineType, datatype: "text", id: "car_type", fn: "equals" },
+ { value: 1, datatype: "numeric", id: "status", fn: "equals" },
+ { value: city_id, datatype: "numeric", id: "city_id", fn: "equals" },
+ ]}
sorting={[{ id: "id", desc: true }]}
table_url={GET_MACHINES_TABLE_LIST}
page_name={"roadMissionsTransportation"}
diff --git a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/index.jsx b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/index.jsx
index 4c2d1fe..eed66c8 100644
--- a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/index.jsx
+++ b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/index.jsx
@@ -1,18 +1,17 @@
import MapLayer from "@/core/components/MapLayer";
+import { machineType } from "@/core/utils/machineTypes";
+import { missionRegions } from "@/core/utils/missionRegions";
+import { missionTypes } from "@/core/utils/missionTypes";
import { ALLOCATE_REQUEST_MISSION } from "@/core/utils/routes";
import useRequest from "@/lib/hooks/useRequest";
import { Box, Button, Chip, DialogActions, DialogContent, Divider, Paper, Typography } from "@mui/material";
import { Stack } from "@mui/system";
+import moment from "jalali-moment";
import { useMemo, useState } from "react";
import ShowBound from "../../../Actions/showBound";
-import Reject from "./Reject";
-import { missionRegions } from "@/core/utils/missionRegions";
-import { machineType } from "@/core/utils/machineTypes";
-import { missionTypes } from "@/core/utils/missionTypes";
-import moment from "jalali-moment";
-import MachinesDialog from "./MachinesDialog";
import DriversDialog from "./DriversDialog";
-import LtrTextField from "@/core/components/LtrTextField";
+import MachinesDialog from "./MachinesDialog";
+import Reject from "./Reject";
const AllocationForm = ({ row, mutate, setOpenAllocationDialog }) => {
const bound = useMemo(
() =>
@@ -56,7 +55,7 @@ const AllocationForm = ({ row, mutate, setOpenAllocationDialog }) => {
mt.id == row.requested_machines[0]).name_fa}
+ label={machineType.find((mt) => mt.id == row.requested_machines?.[0])?.name_fa}
/>
diff --git a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/GetItemInfo/index.jsx b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/GetItemInfo/index.jsx
index 7610a5b..666b1f9 100644
--- a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/GetItemInfo/index.jsx
+++ b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/GetItemInfo/index.jsx
@@ -103,9 +103,6 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
)}
/>
-
-
-
{
+const DriversDialog = ({ setDriver, mode = "" }) => {
const [openDriversDialog, setOpenDriversDialog] = useState(false);
return (
<>
diff --git a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/MachineAndDriver/index.jsx b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/MachineAndDriver/index.jsx
index 951fd83..912eb63 100644
--- a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/MachineAndDriver/index.jsx
+++ b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/MachineAndDriver/index.jsx
@@ -1,10 +1,8 @@
import { Box, Button, Chip, DialogActions, DialogContent, Divider, Stack, Typography } from "@mui/material";
-import DriversDialog from "./DriversDialog";
import { useState } from "react";
-import MachinesDialog from "./MachinesDialog";
+import DriversDialog from "./DriversDialog";
const MachineAndDriver = ({ setTabState, allData, setAllData, handlePrev }) => {
- const [machine, setMachine] = useState(allData.machine);
const [driver, setDriver] = useState(allData.driver);
const handleNext = (data) => {
@@ -18,43 +16,21 @@ const MachineAndDriver = ({ setTabState, allData, setAllData, handlePrev }) => {
- {machine ? (
+ {driver ? (
<>
- خودرو
+ راننده
-
+
>
) : (
-
+
)}
- {machine && (
-
- {driver ? (
- <>
- راننده
-
-
-
-
- >
- ) : (
-
- )}
-
- )}
@@ -62,12 +38,7 @@ const MachineAndDriver = ({ setTabState, allData, setAllData, handlePrev }) => {
-
-
+
-
- خودرو
-
-
-
+
راننده
diff --git a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/index.jsx b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/index.jsx
index 00c4297..45ec88e 100644
--- a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/index.jsx
+++ b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/Form/index.jsx
@@ -1,4 +1,4 @@
-import { AccessTime, Engineering, InsertDriveFile, LocalShipping, Route, Verified } from "@mui/icons-material";
+import { AccessTime, Engineering, InsertDriveFile, Route, Verified, Person } from "@mui/icons-material";
import { Box, Tab, Tabs } from "@mui/material";
import { useReducer, useState } from "react";
import Area from "./Area";
@@ -62,7 +62,7 @@ const CreateForm = ({ defaultValues, submitForm, setOpen, submitting }) => {
} label="مشخصات" />
} label="زمانبندی" />
} label="منطقه عملیاتی" />
- } label="خودرو و راننده" />
+ } label="راننده" />
} label="همراهان" />
} label="بررسی نهایی" />
diff --git a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/index.jsx b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/index.jsx
index 4159027..5bc7492 100644
--- a/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/index.jsx
+++ b/src/components/dashboard/roadMissions/violations/Actions/CreateWithoutProcess/index.jsx
@@ -1,16 +1,14 @@
import { REQUEST_MISSION_WITHOUT_PROCESS } from "@/core/utils/routes";
import useRequest from "@/lib/hooks/useRequest";
-import { AddCircle, AddCircleOutline, Close } from "@mui/icons-material";
-import { Button, Dialog, IconButton, useMediaQuery, useTheme } from "@mui/material";
+import { AddCircleOutline, Close } from "@mui/icons-material";
+import { Dialog, IconButton, Tooltip } from "@mui/material";
import moment from "jalali-moment";
import { useState } from "react";
import CreateForm from "./Form";
-const CreateWithoutProcess = ({ mutate }) => {
+const CreateWithoutProcess = ({ row, mutate }) => {
const [submitting, setSubmitting] = useState(false);
const requestServer = useRequest({ notificationSuccess: true });
- const theme = useTheme();
- const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const [open, setOpen] = useState(false);
const handleOpen = () => {
@@ -25,15 +23,10 @@ const CreateWithoutProcess = ({ mutate }) => {
? bound.map((ring) => ring.map((latlng) => [latlng.lat, latlng.lng]))[0]
: bound.map((latlng) => [latlng.lat, latlng.lng]);
- await requestServer(REQUEST_MISSION_WITHOUT_PROCESS, "post", {
+ await requestServer(`${REQUEST_MISSION_WITHOUT_PROCESS}/${row.original.id}`, "post", {
data: {
explanation: result.explanation,
category_id: result.category_id,
- ...(result.category_id == 3
- ? {
- road_observed_id: result.road_observed_id,
- }
- : {}),
area: {
type: result.bound_type,
coordinates: area,
@@ -43,7 +36,6 @@ const CreateWithoutProcess = ({ mutate }) => {
end_point: result.end_point,
start_date: `${result.start_date} ${moment(result.start_time).format("HH:mm")}`,
end_date: `${result.end_date} ${moment(result.end_time).format("HH:mm")}`,
- machines: [result.machine.id],
driver: result.driver.id,
},
hasSidebarUpdate: true,
@@ -60,21 +52,12 @@ const CreateWithoutProcess = ({ mutate }) => {
return (
<>
- {isMobile ? (
+
- ) : (
- }
- onClick={handleOpen}
- >
- تصحیح ماموریت
-
- )}
+
+