|
|
@@ -97,6 +97,10 @@ const FormPanel = ({ formData }) => { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const getReturnBeforeDate=(date)=>{ |
|
|
|
return DateUtils.convertToDate(date).getTime(); |
|
|
|
} |
|
|
|
|
|
|
|
const formik = useFormik({ |
|
|
|
enableReinitialize: true, |
|
|
|
initialValues: data, |
|
|
@@ -115,23 +119,24 @@ const FormPanel = ({ formData }) => { |
|
|
|
length: values.length, |
|
|
|
colCount: columnPrice.colCount, |
|
|
|
noOfPages: values.noOfPages, |
|
|
|
returnBeforeDate: getReturnBeforeDate(values.beforeDate) |
|
|
|
}, |
|
|
|
files: attachments, |
|
|
|
onSuccess: function (responeData) { |
|
|
|
if(responeData.success == true){ |
|
|
|
if (responeData.success == true) { |
|
|
|
notifySaveSuccess() |
|
|
|
navigate("/proof/search"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
let msg = responeData.msg; |
|
|
|
if(msg ==="haveActiveProof"){ |
|
|
|
if (msg === "haveActiveProof") { |
|
|
|
msg = "Action Failed: There is already a pending payment and proofreading record for client review." |
|
|
|
}else if(msg === "haveProofed"){ |
|
|
|
} else if (msg === "haveProofed") { |
|
|
|
msg = "Action Failed: Already proofed." |
|
|
|
} |
|
|
|
setWarningText(msg); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@@ -178,6 +183,33 @@ const FormPanel = ({ formData }) => { |
|
|
|
|
|
|
|
{/*row 2*/} |
|
|
|
<Grid container direction="column" sx={{ paddingLeft: 4, paddingRight: 4 }} spacing={1}> |
|
|
|
|
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
<Stack direction="row" sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<FormLabel sx={{ paddingRight: 2, textAlign: "center" }}> |
|
|
|
<Typography variant="h5">Return Before Date:</Typography> |
|
|
|
</FormLabel> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
size="small" |
|
|
|
type="datetime-local" |
|
|
|
onChange={formik.handleChange} |
|
|
|
name="beforeDate" |
|
|
|
value={formik.values["beforeDate"]} |
|
|
|
variant="outlined" |
|
|
|
sx={ |
|
|
|
{ |
|
|
|
"& .MuiInputBase-input.Mui-disabled": { |
|
|
|
WebkitTextFillColor: "#000000", |
|
|
|
background: "#f8f8f8", |
|
|
|
}, |
|
|
|
width: '15%' |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
</Stack> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
<input |
|
|
|
id="uploadFileBtn" |
|
|
@@ -391,6 +423,13 @@ const FormPanel = ({ formData }) => { |
|
|
|
</DialogActions> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Dialog open={wait} onClose={() => setWait(false)} > |
|
|
|
<DialogContent style={{ display: 'flex', }}> |
|
|
|
<Typography variant="h4" style={{ padding: '16px' }}>Calculating, please wait ...</Typography> |
|
|
|
</DialogContent> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|
</MainCard> |
|
|
|
); |
|
|
|
}; |
|
|
|