changes in resumission

This commit is contained in:
Malini 2026-01-27 22:09:20 +05:30
parent 0b480b0aae
commit 7cd45e53da
4 changed files with 29 additions and 3 deletions

View File

@ -309,7 +309,9 @@ const ProductDetails = ({
product: { product: {
...submissionData.product, ...submissionData.product,
quarter: quarter, quarter: quarter,
year: year year: year,
remarks: submissionData.product?.remarks || ''
}, },
timestamp: new Date().toISOString() timestamp: new Date().toISOString()
}; };

View File

@ -79,6 +79,10 @@ const defaultEmployeeInfo = {
totalEmirati: '', totalEmirati: '',
}; };
const getCurrentQuarterAndYear = () => { const getCurrentQuarterAndYear = () => {
const now = new Date(); const now = new Date();
const currentQuarter = Math.ceil((now.getMonth() + 1) / 3); const currentQuarter = Math.ceil((now.getMonth() + 1) / 3);
@ -137,6 +141,9 @@ const EstablishmentInfo = ({
fetchProducts(); fetchProducts();
}, []); }, []);
const remarksresubmit = JSON.parse(localStorage.getItem('resubmissionData'))?.product?.remarks || '';
localStorage.setItem('surveyRemarks', remarksresubmit)
const [surveyData, setSurveyData] = React.useState(() => { const [surveyData, setSurveyData] = React.useState(() => {
// For resubmission, use the quarter/year from the submission data // For resubmission, use the quarter/year from the submission data
if (location.state?.fromResubmit && data?.quarter && data?.year) { if (location.state?.fromResubmit && data?.quarter && data?.year) {
@ -398,7 +405,7 @@ const EstablishmentInfo = ({
day: 'numeric' day: 'numeric'
}) })
) : ( ) : (
<span className="text-amber-600">-</span> <span className="#6C4527">Mar 31, 2026</span>
)} )}
</span> </span>
</div> </div>

View File

@ -2558,6 +2558,12 @@ const handleView = async (id) => {
const value = isCheckbox ? event.target.checked : event?.target?.value ?? event; const value = isCheckbox ? event.target.checked : event?.target?.value ?? event;
setForm((prev) => { setForm((prev) => {
const next = { ...prev, [field]: value }; const next = { ...prev, [field]: value };
// Clear remarks when industry codes are changed
if (field === 'industryCodeBusiness' || field === 'industryCodeProduction') {
next.industryCodeMismatchRemarks = '';
}
if ( if (
field === 'employmentEmiratiMale' || field === 'employmentEmiratiMale' ||
field === 'employmentEmiratiFemale' || field === 'employmentEmiratiFemale' ||

View File

@ -179,6 +179,17 @@ const EditCompanyProfile = () => {
}, [form, requiredFieldsByStep, selectedProducts]); }, [form, requiredFieldsByStep, selectedProducts]);
const handleFormChange = useCallback((field, value) => { const handleFormChange = useCallback((field, value) => {
// Clear remarks if either industry code field is changed
if (field === 'industryCodeBusiness' || field === 'industryCodeCurrent') {
setForm(prev => ({
...prev,
[field]: value,
industryCodeMismatchRemarks: '' // Clear the remarks field
}));
setFieldErrors((prev) => ({ ...prev, industryCodeMismatchRemarks: "" }));
return;
}
if (field === 'contactCityTown') { if (field === 'contactCityTown') {
setForm(prev => ({ setForm(prev => ({
...prev, ...prev,