Compare commits
4 Commits
6b70eb8e27
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
| b0a0facea8 | |||
| 58fc9135ac | |||
| 3a28da9b39 | |||
| 80da9a1e40 |
@@ -1,5 +1,5 @@
|
||||
HOST="rms.witel.ir"
|
||||
HOST_RMTO="rms.rmto.ir"
|
||||
NEXT_PUBLIC_VERSION="1.8.7"
|
||||
NEXT_PUBLIC_VERSION="1.8.8"
|
||||
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
|
||||
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"
|
||||
@@ -14,6 +14,7 @@ import useCities from "@/lib/hooks/useCities";
|
||||
const ControlList = () => {
|
||||
const columns = useMemo(() => {
|
||||
const dynamicColumns = {
|
||||
accessorKey: "province_id",
|
||||
header: "استان",
|
||||
id: "province_id",
|
||||
enableColumnFilter: true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import LtrTextField from "@/core/components/LtrTextField";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import MuiTimePicker from "@/core/components/MuiTimePicker";
|
||||
import { FINISH_MISSION } from "@/core/utils/routes";
|
||||
@@ -14,6 +15,7 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const validationSchema = object().shape({
|
||||
end_km: string().required("لطفاً کیلومتر را وارد کنید."),
|
||||
start_date: mixed().required("تاریخ خروج خودرو را مشخص کنید."),
|
||||
start_time: mixed().required("ساعت خروج خودرو را مشخص کنید."),
|
||||
});
|
||||
@@ -24,6 +26,7 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
formState: { isSubmitting },
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
end_km: "",
|
||||
start_date: null,
|
||||
start_time: null,
|
||||
},
|
||||
@@ -36,6 +39,7 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
const formattedTime = format(values.start_time, "HH:mm");
|
||||
requestServer(`${FINISH_MISSION}/${rowId}`, "post", {
|
||||
data: {
|
||||
end_km: values.end_km,
|
||||
time: `${formattedDate} ${formattedTime}`,
|
||||
},
|
||||
hasSidebarUpdate: true,
|
||||
@@ -55,6 +59,27 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
<DialogContent>
|
||||
<Stack alignItems="center" spacing={2}>
|
||||
<Typography mt={2}>آیا از ورود خودرو و پایان ماموریت اطمینان دارید؟</Typography>
|
||||
<Stack>
|
||||
<Controller
|
||||
control={control}
|
||||
name={"end_km"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<LtrTextField
|
||||
autoComplete="off"
|
||||
type="tel"
|
||||
value={field.value}
|
||||
onChange={(e) => {
|
||||
if (isNaN(Number(e.target.value))) return;
|
||||
field.onChange(e.target.value);
|
||||
}}
|
||||
size="small"
|
||||
fullWidth
|
||||
label="کیلومتر خودرو / ساعت کار"
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Controller
|
||||
control={control}
|
||||
@@ -65,8 +90,8 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
error={error}
|
||||
value={field.value || null}
|
||||
disableFuture={false}
|
||||
placeholder={"تاریخ شروع ماموریت را وارد کنید"}
|
||||
label={"تاریخ شروع ماموریت"}
|
||||
placeholder={"تاریخ پایان ماموریت را وارد کنید"}
|
||||
label={"تاریخ پایان ماموریت"}
|
||||
setFieldValue={(name, value) => field.onChange(value || null)}
|
||||
helperText={error ? error.message : null}
|
||||
/>
|
||||
@@ -83,8 +108,8 @@ const FinishMissionContent = ({ rowId, mutate, setOpenFinishMissionDialog }) =>
|
||||
error={error}
|
||||
value={field.value || null}
|
||||
views={["hours", "minutes"]}
|
||||
placeholder={"زمان شروع ماموریت را وارد کنید"}
|
||||
label={"زمان شروع ماموریت"}
|
||||
placeholder={"زمان پایان ماموریت را وارد کنید"}
|
||||
label={"زمان پایان ماموریت"}
|
||||
setFieldValue={(name, value) => field.onChange(value || null)}
|
||||
helperText={error ? error.message : null}
|
||||
/>
|
||||
|
||||
@@ -51,7 +51,6 @@ const MissionDates = ({ control }) => {
|
||||
name="start_time"
|
||||
error={error}
|
||||
value={field.value}
|
||||
views={["hours"]}
|
||||
minTime={
|
||||
start_date && new Date(start_date).toDateString() === now.toDateString()
|
||||
? now
|
||||
@@ -100,7 +99,6 @@ const MissionDates = ({ control }) => {
|
||||
name="end_time"
|
||||
error={error}
|
||||
value={field.value}
|
||||
views={["hours"]}
|
||||
minTime={startDateTime ?? null}
|
||||
placeholder={"زمان پایان ماموریت را وارد کنید"}
|
||||
label={"زمان پایان ماموریت"}
|
||||
|
||||
@@ -24,7 +24,7 @@ const Area = ({ allData, setAllData, handlePrev, setTabState }) => {
|
||||
<Stack spacing={2}>
|
||||
<Box sx={{ width: "100%", height: "400px" }}>
|
||||
<MapLayer style={{ borderRadius: "4px" }}>
|
||||
<MapControlPolygon bound={bound} setBound={setBound} boundType={"polyline"} />
|
||||
<MapControlPolygon bound={bound} setBound={setBound} boundType={"polyline"} />
|
||||
</MapLayer>
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
@@ -15,7 +15,7 @@ const ToDateController = ({ control }) => {
|
||||
maxDate={new Date()}
|
||||
error={!!error}
|
||||
value={value}
|
||||
label={"تاریخ شروع (تا تاریخ)"}
|
||||
label={"تاریخ پایان (تا تاریخ)"}
|
||||
placeholder={"تا تاریخ"}
|
||||
setFieldValue={(name, newValue) => {
|
||||
const formattedDate = moment(new Date(newValue)).locale("en").format("YYYY-MM-DD");
|
||||
|
||||
@@ -5,10 +5,7 @@ const SearchReportList = ({ handleSubmit, onSearchSubmit, control, hasProvincesP
|
||||
return (
|
||||
<>
|
||||
<StyledForm onSubmit={handleSubmit(onSearchSubmit)}>
|
||||
<SearchReportField
|
||||
control={control}
|
||||
hasProvincesPermission={hasProvincesPermission}
|
||||
/>
|
||||
<SearchReportField control={control} hasProvincesPermission={hasProvincesPermission} />
|
||||
</StyledForm>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -5,10 +5,7 @@ const SearchReportList = ({ handleSubmit, onSearchSubmit, control, hasProvincesP
|
||||
return (
|
||||
<>
|
||||
<StyledForm onSubmit={handleSubmit(onSearchSubmit)}>
|
||||
<SearchReportField
|
||||
control={control}
|
||||
hasProvincesPermission={hasProvincesPermission}
|
||||
/>
|
||||
<SearchReportField control={control} hasProvincesPermission={hasProvincesPermission} />
|
||||
</StyledForm>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -47,10 +47,8 @@ export const GET_COUNTRY_ACTIVITY_REPORT = api + "/api/v3/missions/report/countr
|
||||
export const EXPORT_COUNTRY_ROAD_PATROL_REPORTS = api + "/api/v3/road_patrols/report/country_activity_excel";
|
||||
export const EXPORT_PROVINCE_ROAD_PATROL_REPORTS = api + "/api/v3/road_patrols/report/province_activity_excel";
|
||||
|
||||
export const GET_MISSIONS_REPORT_TARADOD_COUNTRY_ACTIVITY =
|
||||
api + "/api/v3/missions/report_taradod/country_activity";
|
||||
export const GET_MISSIONS_REPORT_TARADOD_PROVINCE_ACTIVITY =
|
||||
api + "/api/v3/missions/report_taradod/province_activity";
|
||||
export const GET_MISSIONS_REPORT_TARADOD_COUNTRY_ACTIVITY = api + "/api/v3/missions/report_taradod/country_activity";
|
||||
export const GET_MISSIONS_REPORT_TARADOD_PROVINCE_ACTIVITY = api + "/api/v3/missions/report_taradod/province_activity";
|
||||
export const EXPORT_MISSIONS_REPORT_TARADOD_COUNTRY_EXCEL_ACTIVITY =
|
||||
api + "/api/v3/missions/report_taradod/country_excel_activity";
|
||||
export const EXPORT_MISSIONS_REPORT_TARADOD_PROVINCE_EXCEL_ACTIVITY =
|
||||
|
||||
Reference in New Issue
Block a user