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: {
...submissionData.product,
quarter: quarter,
year: year
year: year,
remarks: submissionData.product?.remarks || ''
},
timestamp: new Date().toISOString()
};

View File

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

View File

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

View File

@ -179,6 +179,17 @@ const EditCompanyProfile = () => {
}, [form, requiredFieldsByStep, selectedProducts]);
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') {
setForm(prev => ({
...prev,