Titans Form Changes - Core HCP Connect Drive
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m47s Details

This commit is contained in:
Tanuja Pansare 2026-10-01 12:59:18 +05:30
parent 8478dfdcd3
commit d0765b9a8c
1 changed files with 130 additions and 21 deletions

View File

@ -69,7 +69,7 @@
<th>PCODE </th>
<th>Speciality</th>
<th>Month of Engagement</th>
<th>Core Value</th>
<!-- <th>Core Value</th> -->
<th>Activity</th>
<th>Executed as per Plan</th>
<th>No. of Flutter Utilized</th>
@ -89,17 +89,24 @@
@endphp
<tr>
<td>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ) Execution Done
@else
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i> Execute</button>
@if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes')
Execution Done
@elseif(isset($sub->workflow_status) && $sub->workflow_status == 'approved')
<button type="button" class="btn btn-xs btn-info edit-btn"
plan_details="{{ json_encode($sub->formdata) }}">
<i class="mdi mdi-pencil"></i> Execute
</button>
@elseif(isset($sub->workflow_status) && $sub->workflow_status == 'rejected')
<button type="button" class="btn btn-xs btn-info edit_plan-btn"
plan_details="{{ json_encode($sub->formdata) }}"><i
class="mdi mdi-pencil"></i> Edit Plan</button>
plan_details="{{ json_encode($sub->formdata) }}">
<i class="mdi mdi-pencil"></i> Edit Plan
</button>
@endif
</td>
@ -154,6 +161,10 @@
</div>
<div id="form-wrapper">
<div class="alert alert-info mb-3">
<strong>Please ensure to add Plan for all your Core Drs which will be executed during the period Oct 2026 - Dec 2026</strong>
</div>
<form method="POST" action="/form/submit" id="report-form"
enctype="multipart/form-data">
<input type="hidden" name="form_id" value="{{ $form_id }}">
@ -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('<h4>Prescription Generated</h4>');
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('<h4>Prescription Generated</h4>');
$('#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') {