From 384d80bb8d91a263077f30fd68d6b8f1aa7bace9 Mon Sep 17 00:00:00 2001 From: Farhan Pathan Date: Thu, 18 Jun 2026 17:03:59 +0530 Subject: [PATCH] Team4 - Molecule Identification form Testing for error (18/06/2026 : 05:03) --- ...f382-9fbb-45ac-896b-94de9104a11b.blade.php | 85 +++++++++++++++++-- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php index 99d7561e..2fe7f955 100644 --- a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php +++ b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php @@ -105,6 +105,13 @@ $otherMolecule = trim((string) $otherMolecule); } + $otherMoleculeRxSupport = $formdata->other_molecule_rx_support ?? ''; + if (is_array($otherMoleculeRxSupport) || $otherMoleculeRxSupport instanceof \Traversable) { + $otherMoleculeRxSupport = trim((string)(array_values((array)$otherMoleculeRxSupport)[0] ?? '')); + } else { + $otherMoleculeRxSupport = trim((string)$otherMoleculeRxSupport); + } + $recordDate = $formdata->record_date ?? ''; if (is_array($recordDate) || $recordDate instanceof \Traversable) { $recordDate = trim((string) (array_values((array) $recordDate)[0] ?? '')); @@ -123,6 +130,7 @@ 'doctor_name' => $doctorNameById[$doctorId] ?? $rawDoctorId, 'rx_support' => $rxSupport, 'other_molecule_use' => $otherMolecule, + 'other_molecule_rx_support' => $otherMoleculeRxSupport ?? '', 'record_date' => $recordDate, ]; @@ -193,6 +201,7 @@ 'rx_support', 'other_molecule_use', 'molecule_use', + 'other_molecule_rx_support', ]; @endphp @@ -351,10 +360,13 @@ - - - - + + + + + + + @php $globalRowIndex++; @endphp @endfor @@ -469,6 +492,17 @@ select option:disabled { var categoryDoctorSubmissions = {!! json_encode($categoryDoctorSubmissions) !!}; jQuery(document).ready(function($){ + $(document).on( + 'change', + '.other-molecule-select', + function(){ + + toggleOtherMoleculeRxSupport( + $(this).closest('tr') + ); + + } + ); function getDoctorRows() { let rows = []; @@ -534,6 +568,9 @@ select option:disabled { .val(submission.rx_support || ''); $row.find('.other-molecule-select') .val(submission.other_molecule_use || ''); + $row.find('.other-molecule-rx-support') + .val(submission.other_molecule_rx_support || ''); + toggleOtherMoleculeRxSupport($row); setSubmissionId($row, submission.submission_id); }); } @@ -543,6 +580,42 @@ select option:disabled { prefillDoctorTableSection($(this), $(this).data('category')); }); } + function checkOtherRxHeader(){ + + let visible = false; + + $('.other-molecule-rx-cell').each(function(){ + + if($(this).is(':visible')){ + visible = true; + } + + }); + + if(visible){ + $('.other-rx-header').show(); + }else{ + $('.other-rx-header').hide(); + } + + } + function toggleOtherMoleculeRxSupport($row){ + + let value = $row.find('.other-molecule-select').val(); + + if( + value && + value !== 'No' + ){ + $row.find('.other-molecule-rx-cell').show(); + $('.other-rx-header').show(); + }else{ + $row.find('.other-molecule-rx-cell').hide(); + $row.find('.other-molecule-rx-support').val(''); + } + + checkOtherRxHeader(); + } /* function updateDoctorDropdowns($tbody) { let selectedDoctors = []; @@ -645,7 +718,7 @@ select option:disabled { function buildSubmitFormData() { let fd = new FormData(); let form = $('#report-form')[0]; - let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select']; + let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select', 'other-molecule-rx-support']; Array.from(form.elements).forEach(function(el) { if (!el.name || el.disabled) { @@ -697,6 +770,7 @@ select option:disabled { fd.append('contact_id[]', $row.find('.doctor-select').val()); fd.append('rx_support[]', $row.find('.rx-support-select').val()); fd.append('other_molecule_use[]', $row.find('.other-molecule-select').val()); + fd.append('other_molecule_rx_support[]', $row.find('.other-molecule-rx-support').val()); fd.append('molecule_use[]', item.moleculeUse); let submissionId = $row.attr('data-submission-id'); @@ -746,6 +820,7 @@ select option:disabled { processData: false, contentType: false, success: function(data) { + $("#pageloader").fadeOut(); if (data.status == 'success') { Swal.fire({
Doctor NameRxn/Week SupportOther Molecule Use
Doctor NameRxn/Week SupportOther Molecule Use
+