From d0765b9a8c5d1a1f160ed142c04831c50b70e24a Mon Sep 17 00:00:00 2001 From: Tanuja Pansare Date: Thu, 1 Oct 2026 12:59:18 +0530 Subject: [PATCH] Titans Form Changes - Core HCP Connect Drive --- ...5bd1-442d-4226-bacf-5f12e647373d.blade.php | 151 +++++++++++++++--- 1 file changed, 130 insertions(+), 21 deletions(-) diff --git a/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php b/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php index cef77c80..e60d2c30 100644 --- a/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php +++ b/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php @@ -69,7 +69,7 @@ PCODE Speciality Month of Engagement - Core Value + Activity Executed as per Plan No. of Flutter Utilized @@ -89,17 +89,24 @@ @endphp - @if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ) Execution Done - - @else - + @if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes') + + Execution Done + + @elseif(isset($sub->workflow_status) && $sub->workflow_status == 'approved') + + + + @elseif(isset($sub->workflow_status) && $sub->workflow_status == 'rejected') - + plan_details="{{ json_encode($sub->formdata) }}"> + Edit Plan + + @endif @@ -154,6 +161,10 @@
+
+ Please ensure to add Plan for all your Core Drs which will be executed during the period Oct 2026 - Dec 2026 +
+
@@ -171,6 +182,7 @@ 'sync', 'cip', 'total', + 'no_of_patients_screened', ])) @continue @endif @@ -405,6 +417,10 @@ $('#form-wrapper').hide() $('#execution-form-wrapper').hide() + // Patients Screened should only appear in Execution view for LHC + $('#execution-no_of_patients_screened').closest('.col-md-12').hide(); + $('#execution-no_of_patients_screened').prop('required', false); + $('#add-camp-btn').click(function() { @@ -474,6 +490,7 @@ // if(selected[k] != '') // $('#execution-'+k).val(selected[k]); } + let docid = $('#execution-contact_id option').map(function() { if ($(this).text().trim() == selected['contact_id'] || $(this).val().trim() == selected['cont_id']) return this; @@ -481,8 +498,55 @@ $('#execution-contact_id').val(docid) $('#execution-id').val(selected['id']) + // Show Patients Screened only for LHC during Execution + const selectedActivity = ($('#execution-activity').val() || '').trim().toUpperCase(); - $('#execution-no_of_flutter_utilized').closest('.col-md-12').after('

Prescription Generated

'); + if (selectedActivity === 'LHC') { + $('#execution-no_of_patients_screened') + .closest('.col-md-12') + .show(); + + $('#execution-no_of_patients_screened') + .prop('required', true); + } else { + $('#execution-no_of_patients_screened') + .closest('.col-md-12') + .hide(); + + $('#execution-no_of_patients_screened') + .prop('required', false) + .val(''); + } + + $('#execution-activity').off('change.patientsScreened').on('change.patientsScreened', function () { + + const activity = ($(this).val() || '').trim().toUpperCase(); + + if (activity === 'LHC') { + + $('#execution-no_of_patients_screened') + .closest('.col-md-12') + .show(); + + $('#execution-no_of_patients_screened') + .prop('required', true); + + } else { + + $('#execution-no_of_patients_screened') + .closest('.col-md-12') + .hide(); + + $('#execution-no_of_patients_screened') + .prop('required', false) + .val(''); + } + + }); + + $('#execution-no_of_patients_screened') + .closest('.col-md-12') + .after('

Prescription Generated

'); $('#execution-dpi,#execution-mdi,#execution-sync,#execution-cip').on('input', function() { var total=( @@ -520,6 +584,13 @@ $('#add-camp-btn').hide(0); }) $('#table-wrapper').hide() + // Restrict Edit Plan date selection to Oct 1, 2026 - Dec 31, 2026 + $('#execution-plan_date').attr('min', '2026-10-01'); + $('#execution-plan_date').attr('max', '2026-12-31'); + + // Edit Plan: Patients Screened is NOT applicable + $('#execution-no_of_patients_screened').closest('.col-md-12').hide(); + $('#execution-no_of_patients_screened').prop('required', false); @@ -531,8 +602,8 @@ console.log("Selected Doctor:", selected['contact_id']); - $('#execution-execution_as_per_plan,#execution-execution_date,#execution-no_of_flutter_utilized,#execution-dpi,#execution-mdi,#execution-sync,#execution-cip,#execution-total').parent().hide(); - $('#execution-execution_as_per_plan,#execution-execution_date,#execution-no_of_flutter_utilized,#execution-dpi,#execution-mdi,#execution-sync,#execution-cip,#execution-total').prop('required',false); + $('#execution-execution_as_per_plan,#execution-execution_date,#execution-no_of_flutter_utilized,#execution-dpi,#execution-mdi,#execution-sync,#execution-cip,#execution-total,#execution-no_of_patients_screened').parent().hide(); + $('#execution-execution_as_per_plan,#execution-execution_date,#execution-no_of_flutter_utilized,#execution-dpi,#execution-mdi,#execution-sync,#execution-cip,#execution-total,#execution-no_of_patients_screened').prop('required',false); @@ -554,6 +625,8 @@ // $('#execution-'+k).val(selected[k]); } + + let docid = $('#execution-contact_id option').map(function() { if ($(this).text().trim() == selected['contact_id'] || $(this).val().trim() == selected['cont_id']) return this; }).attr('value') @@ -596,9 +669,17 @@ $('#execution-core_value').parent().hide(); $('#execution-core_value').prop('required',false); + + $('#execution-no_of_patients_screened').on('input', function () { + let value = $(this).val(); + // Remove everything except digits + value = value.replace(/[^0-9]/g, ''); + + $(this).val(value); + }); @@ -650,6 +731,7 @@ }) $('#report-form').on('submit', function(event) { + event.preventDefault(); $("#pageloader").fadeIn(); $.ajax({ @@ -746,14 +828,41 @@ }); $('#execution-form').on('submit', function(event) { - event.preventDefault(); - $("#pageloader").fadeIn(); - $.ajax({ - type: "POST", - url: '/form/ajaxsubmit', - data: new FormData($('#execution-form')[0]), - processData: false, - contentType: false, + + const activity = ($('#execution-activity').val() || '').trim().toUpperCase(); + + if (activity === 'LHC') { + + const patientsScreened = $('#execution-no_of_patients_screened').val(); + + if ( + patientsScreened === '' || + !/^\d+$/.test(patientsScreened) + ) { + event.preventDefault(); + + Swal.fire({ + icon: 'error', + title: 'Invalid No. of Patients Screened', + text: 'Please enter a valid whole number. Negative numbers and decimal values are not allowed.' + }); + + $('#execution-no_of_patients_screened').focus(); + + return; + } + } + + event.preventDefault(); + + $("#pageloader").fadeIn(); + + $.ajax({ + type: "POST", + url: '/form/ajaxsubmit', + data: new FormData($('#execution-form')[0]), + processData: false, + contentType: false, success: function(data) { $("#pageloader").fadeOut(); if (data.status == 'success') {