Compare commits
8 Commits
f6c369f866
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f77165ec4 | |||
| 0435654762 | |||
| f94374958d | |||
| a26f07d2ad | |||
| d1b74585d7 | |||
| 6115e0ded2 | |||
| 40f80fac3a | |||
| 188c7c45af |
@@ -1,5 +1,5 @@
|
||||
HOST="rms.witel.ir"
|
||||
HOST_RMTO="rms.rmto.ir"
|
||||
NEXT_PUBLIC_VERSION="1.9.0"
|
||||
NEXT_PUBLIC_VERSION="1.9.1"
|
||||
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
|
||||
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"
|
||||
@@ -11,7 +11,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import DataBox from "./DataBox";
|
||||
import AlarmText from "./AlarmText";
|
||||
|
||||
const MAX_WAYPOINTS = 1;
|
||||
const MAX_WAYPOINTS = 2;
|
||||
|
||||
const Routing = ({ setArea, setLocations, locations, area }) => {
|
||||
const mapPrevSourceMarker = useRef();
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import useRoadItemGetItems from "@/lib/hooks/useRoadItemGetItems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const ItemSelectField = ({ control, setValue }) => {
|
||||
const { itemsList, loadingItemsList, errorItemsList } = useRoadItemGetItems();
|
||||
function getItemName(val) {
|
||||
return itemsList.find((item) => item.id === val)?.name;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="موضوع"
|
||||
selectors={itemsList}
|
||||
isLoading={loadingItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(value) => {
|
||||
field.onChange(value);
|
||||
setValue("explanation", getItemName(value));
|
||||
setValue("sub_item_id", "");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default ItemSelectField;
|
||||
@@ -0,0 +1,37 @@
|
||||
import useRoadItemGetSubItems from "@/lib/hooks/useRoadItemGetISubtems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const SubItemSelectField = ({ control, watch, setValue, getValues }) => {
|
||||
const itemId = watch("item_id");
|
||||
const { subItemsList, loadingSubItemsList, errorSubItemsList } = useRoadItemGetSubItems(itemId);
|
||||
|
||||
function createExplanation(val) {
|
||||
const currentExplanation = getValues("explanation");
|
||||
const selectedItem = subItemsList.find((item) => item.id === val)?.name;
|
||||
return `${currentExplanation}-${selectedItem}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"sub_item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="اقدام انجام شده"
|
||||
selectors={subItemsList}
|
||||
isLoading={loadingSubItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorSubItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(val) => {
|
||||
field.onChange(val);
|
||||
setValue("explanation", createExplanation(val));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default SubItemSelectField;
|
||||
@@ -9,12 +9,15 @@ import { ExitToApp } from "@mui/icons-material";
|
||||
import { Box, Button, DialogActions, DialogContent, Grid, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { array, object, string } from "yup";
|
||||
import ItemSelectField from "./ItemSelectField";
|
||||
import SubItemSelectField from "./SubItemSelectField";
|
||||
|
||||
const validationSchema = object({
|
||||
explanation: string().required("موضوع را مشخص کنید!"),
|
||||
end_point: string().required("مقصد را مشخص کنید!"),
|
||||
region: string().required("محور ماموریت را مشخص کنید!"),
|
||||
category_id: string().required("نوع ماموریت را مشخص کنید!"),
|
||||
item_id: string().required("موضوع را مشخص کنید!"),
|
||||
sub_item_id: string().required("اقدام انجام شده را مشخص کنید!"),
|
||||
requested_machines: array().min(1, "نوع خودرو را مشخص کنید!").required("نوع خودرو را مشخص کنید!"),
|
||||
road_observed_id: string().when("category_id", {
|
||||
is: "3",
|
||||
@@ -25,6 +28,8 @@ const validationSchema = object({
|
||||
|
||||
const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
const defaultValues = {
|
||||
item_id: allData.item_id,
|
||||
sub_item_id: allData.sub_item_id,
|
||||
explanation: allData.explanation,
|
||||
end_point: allData.end_point,
|
||||
region: allData.region,
|
||||
@@ -33,7 +38,7 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
road_observed_id: allData.road_observed_id,
|
||||
};
|
||||
|
||||
const { control, handleSubmit } = useForm({
|
||||
const { control, handleSubmit, watch, setValue, getValues } = useForm({
|
||||
defaultValues,
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
@@ -51,24 +56,14 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Controller
|
||||
<ItemSelectField control={control} watch={watch} setValue={setValue} />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SubItemSelectField
|
||||
control={control}
|
||||
name={"explanation"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<PersianTextField
|
||||
value={field.value}
|
||||
variant="outlined"
|
||||
name="explanation"
|
||||
onChange={field.onChange}
|
||||
label="موضوع"
|
||||
placeholder={"موضوع را وارد کنید"}
|
||||
fullWidth
|
||||
size="small"
|
||||
error={error}
|
||||
helperText={error?.message}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
watch={watch}
|
||||
setValue={setValue}
|
||||
getValues={getValues}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -44,6 +44,8 @@ const Create = ({ mutate }) => {
|
||||
start_date: result.start_date,
|
||||
end_date: result.end_date,
|
||||
}),
|
||||
item_id: result.item_id,
|
||||
sub_item_id: result.sub_item_id,
|
||||
},
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
@@ -93,6 +95,8 @@ const Create = ({ mutate }) => {
|
||||
defaultValues={{
|
||||
explanation: "",
|
||||
category_id: "",
|
||||
item_id: null,
|
||||
sub_item_id: null,
|
||||
road_observed_id: "",
|
||||
rahdaran: [],
|
||||
requested_machines: [],
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import DataBox from "./DataBox";
|
||||
import AlarmText from "./AlarmText";
|
||||
|
||||
const MAX_WAYPOINTS = 1;
|
||||
const MAX_WAYPOINTS = 2;
|
||||
|
||||
const Routing = ({ setArea, setLocations, locations, area }) => {
|
||||
const mapPrevSourceMarker = useRef();
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import useRoadItemGetItems from "@/lib/hooks/useRoadItemGetItems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const ItemSelectField = ({ control, setValue }) => {
|
||||
const { itemsList, loadingItemsList, errorItemsList } = useRoadItemGetItems();
|
||||
function getItemName(val) {
|
||||
return itemsList.find((item) => item.id === val)?.name;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="موضوع"
|
||||
selectors={itemsList}
|
||||
isLoading={loadingItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(value) => {
|
||||
field.onChange(value);
|
||||
setValue("explanation", getItemName(value));
|
||||
setValue("sub_item_id", "");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default ItemSelectField;
|
||||
@@ -0,0 +1,37 @@
|
||||
import useRoadItemGetSubItems from "@/lib/hooks/useRoadItemGetISubtems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const SubItemSelectField = ({ control, watch, setValue, getValues }) => {
|
||||
const itemId = watch("item_id");
|
||||
const { subItemsList, loadingSubItemsList, errorSubItemsList } = useRoadItemGetSubItems(itemId);
|
||||
|
||||
function createExplanation(val) {
|
||||
const currentExplanation = getValues("explanation");
|
||||
const selectedItem = subItemsList.find((item) => item.id === val)?.name;
|
||||
return `${currentExplanation}-${selectedItem}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"sub_item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="اقدام انجام شده"
|
||||
selectors={subItemsList}
|
||||
isLoading={loadingSubItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorSubItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(val) => {
|
||||
field.onChange(val);
|
||||
setValue("explanation", createExplanation(val));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default SubItemSelectField;
|
||||
@@ -8,10 +8,12 @@ import { ExitToApp } from "@mui/icons-material";
|
||||
import { Box, Button, DialogActions, DialogContent, Grid, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { object, string } from "yup";
|
||||
import FastReactCode from "./FastReactCode";
|
||||
import ItemSelectField from "./ItemSelectField";
|
||||
import SubItemSelectField from "./SubItemSelectField";
|
||||
|
||||
const validationSchema = object({
|
||||
explanation: string().required("موضوع را مشخص کنید!"),
|
||||
item_id: string().required("موضوع را مشخص کنید!"),
|
||||
sub_item_id: string().required("اقدام انجام شده را مشخص کنید!"),
|
||||
end_point: string().required("مقصد را مشخص کنید!"),
|
||||
region: string().required("محور ماموریت را مشخص کنید!"),
|
||||
category_id: string().required("نوع ماموریت را مشخص کنید!"),
|
||||
@@ -24,6 +26,8 @@ const validationSchema = object({
|
||||
|
||||
const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
const defaultValues = {
|
||||
item_id: allData.item_id,
|
||||
sub_item_id: allData.sub_item_id,
|
||||
explanation: allData.explanation,
|
||||
end_point: allData.end_point,
|
||||
region: allData.region,
|
||||
@@ -31,7 +35,7 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
road_observed_id: allData.road_observed_id,
|
||||
};
|
||||
|
||||
const { control, handleSubmit } = useForm({
|
||||
const { control, handleSubmit, watch, setValue, getValues } = useForm({
|
||||
defaultValues,
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
@@ -49,24 +53,14 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Controller
|
||||
<ItemSelectField control={control} watch={watch} setValue={setValue} />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SubItemSelectField
|
||||
control={control}
|
||||
name={"explanation"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<PersianTextField
|
||||
value={field.value}
|
||||
variant="outlined"
|
||||
name="explanation"
|
||||
onChange={field.onChange}
|
||||
label="موضوع"
|
||||
placeholder={"موضوع را وارد کنید"}
|
||||
fullWidth
|
||||
size="small"
|
||||
error={error}
|
||||
helperText={error?.message}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
watch={watch}
|
||||
setValue={setValue}
|
||||
getValues={getValues}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { AccessTime, Engineering, InsertDriveFile, Person, Verified, Map } from "@mui/icons-material";
|
||||
import { Engineering, InsertDriveFile, Map, Person, Verified } from "@mui/icons-material";
|
||||
import { Box, Tab, Tabs } from "@mui/material";
|
||||
import { useReducer, useState } from "react";
|
||||
import GetDateTime from "./GetDateTime";
|
||||
import Area from "./Area";
|
||||
import GetItemInfo from "./GetItemInfo";
|
||||
import MachineAndDriver from "./MachineAndDriver";
|
||||
import Rahdaran from "./Rahdaran";
|
||||
import Verify from "./Verify";
|
||||
import Area from "./Area";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index } = props;
|
||||
|
||||
@@ -26,6 +26,8 @@ const MissionCorrection = ({ row, mutate, baseMutate }) => {
|
||||
end_point: result.end_point,
|
||||
driver: result.driver.id,
|
||||
encoded_route: result.area,
|
||||
item_id: result.item_id,
|
||||
sub_item_id: result.sub_item_id,
|
||||
},
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import DataBox from "./DataBox";
|
||||
import AlarmText from "./AlarmText";
|
||||
|
||||
const MAX_WAYPOINTS = 1;
|
||||
const MAX_WAYPOINTS = 2;
|
||||
|
||||
const Routing = ({ setArea, setLocations, locations, area }) => {
|
||||
const mapPrevSourceMarker = useRef();
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import useRoadItemGetItems from "@/lib/hooks/useRoadItemGetItems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const ItemSelectField = ({ control, setValue }) => {
|
||||
const { itemsList, loadingItemsList, errorItemsList } = useRoadItemGetItems();
|
||||
function getItemName(val) {
|
||||
return itemsList.find((item) => item.id === val)?.name;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="موضوع"
|
||||
selectors={itemsList}
|
||||
isLoading={loadingItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(value) => {
|
||||
field.onChange(value);
|
||||
setValue("explanation", getItemName(value));
|
||||
setValue("sub_item_id", "");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default ItemSelectField;
|
||||
@@ -0,0 +1,37 @@
|
||||
import useRoadItemGetSubItems from "@/lib/hooks/useRoadItemGetISubtems";
|
||||
import { Controller } from "react-hook-form";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
|
||||
const SubItemSelectField = ({ control, watch, setValue, getValues }) => {
|
||||
const itemId = watch("item_id");
|
||||
const { subItemsList, loadingSubItemsList, errorSubItemsList } = useRoadItemGetSubItems(itemId);
|
||||
|
||||
function createExplanation(val) {
|
||||
const currentExplanation = getValues("explanation");
|
||||
const selectedItem = subItemsList.find((item) => item.id === val)?.name;
|
||||
return `${currentExplanation}-${selectedItem}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<Controller
|
||||
control={control}
|
||||
name={"sub_item_id"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<SelectBox
|
||||
value={field.value}
|
||||
label="اقدام انجام شده"
|
||||
selectors={subItemsList}
|
||||
isLoading={loadingSubItemsList}
|
||||
schema={{ name: "name", value: "id" }}
|
||||
error={errorSubItemsList}
|
||||
helperText={error?.message}
|
||||
onChange={(val) => {
|
||||
field.onChange(val);
|
||||
setValue("explanation", createExplanation(val));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default SubItemSelectField;
|
||||
@@ -1,3 +1,4 @@
|
||||
import LtrTextField from "@/core/components/LtrTextField";
|
||||
import PersianTextField from "@/core/components/PersianTextField";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import StyledForm from "@/core/components/StyledForm";
|
||||
@@ -8,7 +9,8 @@ import { ExitToApp } from "@mui/icons-material";
|
||||
import { Box, Button, DialogActions, DialogContent, Grid, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { object, string } from "yup";
|
||||
import LtrTextField from "@/core/components/LtrTextField";
|
||||
import ItemSelectField from "./ItemSelectField";
|
||||
import SubItemSelectField from "./SubItemSelectField";
|
||||
|
||||
const validationSchema = object({
|
||||
explanation: string().required("موضوع را مشخص کنید!"),
|
||||
@@ -24,6 +26,8 @@ const validationSchema = object({
|
||||
|
||||
const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
const defaultValues = {
|
||||
item_id: allData.item_id,
|
||||
sub_item_id: allData.sub_item_id,
|
||||
explanation: allData.explanation,
|
||||
end_point: allData.end_point,
|
||||
region: allData.region,
|
||||
@@ -31,7 +35,7 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
road_observed_id: allData.road_observed_id,
|
||||
};
|
||||
|
||||
const { control, handleSubmit } = useForm({
|
||||
const { control, handleSubmit, watch, setValue, getValues } = useForm({
|
||||
defaultValues,
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
@@ -49,24 +53,14 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Controller
|
||||
<ItemSelectField control={control} watch={watch} setValue={setValue} />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<SubItemSelectField
|
||||
control={control}
|
||||
name={"explanation"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<PersianTextField
|
||||
value={field.value}
|
||||
variant="outlined"
|
||||
name="explanation"
|
||||
onChange={field.onChange}
|
||||
label="موضوع"
|
||||
placeholder={"موضوع را وارد کنید"}
|
||||
fullWidth
|
||||
size="small"
|
||||
error={error}
|
||||
helperText={error?.message}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
watch={watch}
|
||||
setValue={setValue}
|
||||
getValues={getValues}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
@@ -126,7 +120,7 @@ const GetItemInfo = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={12}>
|
||||
<Grid item xs={6} sm={6}>
|
||||
<Stack>
|
||||
<Controller
|
||||
control={control}
|
||||
|
||||
@@ -93,10 +93,12 @@ const Verify = ({ allData, handlePrev, submitForm, submitting }) => {
|
||||
<Stack direction={"row"} alignItems={"center"} spacing={1}>
|
||||
<Typography variant="body2">خودرو</Typography>
|
||||
<Divider sx={{ flex: 1 }} />
|
||||
{allData.machine && (
|
||||
<Chip
|
||||
size="small"
|
||||
label={`${allData.machine.machine_code} | ${allData.machine.car_name}`}
|
||||
/>
|
||||
)}
|
||||
</Stack>
|
||||
{/* <Stack direction={"row"} alignItems={"center"} spacing={1}>
|
||||
<Typography variant="body2">راننده</Typography>
|
||||
|
||||
@@ -9,6 +9,8 @@ const DialogAdd = ({ mutate, setOpen, oldBound, rahdaran, machine, row }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const submitForm = async (result) => {
|
||||
console.log("result: ", result);
|
||||
|
||||
setSubmitting(true);
|
||||
await requestServer(`${REQUEST_MISSION_CONTINUE_MISSION}/${row.original.id}`, "post", {
|
||||
data: {
|
||||
@@ -29,6 +31,8 @@ const DialogAdd = ({ mutate, setOpen, oldBound, rahdaran, machine, row }) => {
|
||||
end_point: result.end_point,
|
||||
category_id: result.category_id,
|
||||
explanation: result.explanation,
|
||||
item_id: result.item_id,
|
||||
sub_item_id: result.sub_item_id,
|
||||
...(result.category_id == 3
|
||||
? {
|
||||
road_observed_id: result.road_observed_id,
|
||||
@@ -51,6 +55,8 @@ const DialogAdd = ({ mutate, setOpen, oldBound, rahdaran, machine, row }) => {
|
||||
<CreateForm
|
||||
defaultValues={{
|
||||
explanation: "",
|
||||
item_id: "",
|
||||
sub_item_id: "",
|
||||
category_id: "",
|
||||
rahdaran: rahdaran.filter((r) => !r.is_driver),
|
||||
bound_type: "polyline",
|
||||
|
||||
@@ -51,6 +51,8 @@ const EditController = ({ row, mutate, openEditDialog, setOpenEditDialog }) => {
|
||||
await requestServer(`${UPDATE_REQUEST_MISSION}/${row.original.id}`, "post", {
|
||||
data: {
|
||||
explanation: result.explanation,
|
||||
item_id: result.item_id,
|
||||
sub_item_id: result.sub_item_id,
|
||||
category_id: result.category_id,
|
||||
|
||||
...(result.category_id == 3
|
||||
@@ -101,6 +103,8 @@ const EditController = ({ row, mutate, openEditDialog, setOpenEditDialog }) => {
|
||||
<CreateForm
|
||||
defaultValues={{
|
||||
explanation: row.original.explanation,
|
||||
item_id: row.original.item_id,
|
||||
sub_item_id: row.original.sub_item_id,
|
||||
category_id: row.original.category_id,
|
||||
|
||||
road_observed_id: row.original.category_id == 3 ? (row.original.road_observed?.[0]?.id ?? "") : "",
|
||||
|
||||
Reference in New Issue
Block a user