machinary implement
This commit is contained in:
@@ -109,7 +109,8 @@
|
|||||||
"updated_at": "تاریخ بروزرسانی",
|
"updated_at": "تاریخ بروزرسانی",
|
||||||
"navgan_id": "کد ناوگان",
|
"navgan_id": "کد ناوگان",
|
||||||
"vehicle_type": "نوع ماشین",
|
"vehicle_type": "نوع ماشین",
|
||||||
"state_name": "وضعیت درخواست"
|
"state_name": "وضعیت درخواست",
|
||||||
|
"proposed_amount": "مقدار پیشنهادی"
|
||||||
},
|
},
|
||||||
"ConfirmDialog": {
|
"ConfirmDialog": {
|
||||||
"confirm": "تایید",
|
"confirm": "تایید",
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import {
|
|||||||
DialogContentText,
|
DialogContentText,
|
||||||
DialogActions,
|
DialogActions,
|
||||||
Button,
|
Button,
|
||||||
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
const ConfirmForm = ({
|
const ConfirmForm = ({
|
||||||
open,
|
open,
|
||||||
@@ -17,15 +19,27 @@ const ConfirmForm = ({
|
|||||||
confirmData,
|
confirmData,
|
||||||
}) => {
|
}) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
|
const [proposedAmount, setProposedAmount] = useState("");
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("proposed_amount", proposedAmount);
|
||||||
handleDelete();
|
handleDelete();
|
||||||
confirmData(CONFIRM_MACHINARY_OFFICE, rowId);
|
confirmData(CONFIRM_MACHINARY_OFFICE, rowId, formData);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open} onClose={handleClose}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
|
<TextField
|
||||||
|
label={t("MachinaryOffice.proposed_amount")}
|
||||||
|
type="number"
|
||||||
|
variant="outlined"
|
||||||
|
value={proposedAmount}
|
||||||
|
onChange={(e) => setProposedAmount(e.target.value)}
|
||||||
|
sx={{ mt: 2 }}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleConfirm} color="primary">
|
<Button onClick={handleConfirm} color="primary">
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const useDataTable = () => {
|
|||||||
|
|
||||||
const { token } = useUser();
|
const { token } = useUser();
|
||||||
|
|
||||||
const confirmData = useCallback(async (url, rowID) => {
|
const confirmData = useCallback(async (url, rowID, values) => {
|
||||||
dispatch({ type: "CONFIRM_DATA", url: url, rowID: rowID });
|
dispatch({ type: "CONFIRM_DATA", url: url, rowID: rowID });
|
||||||
axios
|
axios
|
||||||
.post(`${url}/${rowID}`, null, {
|
.post(`${url}/${rowID}`, null, {
|
||||||
|
|||||||
Reference in New Issue
Block a user