Titans (Novel meet)
This commit is contained in:
parent
f26cf8dfd8
commit
7374343cd9
|
|
@ -28,7 +28,7 @@
|
|||
<br>
|
||||
@endif
|
||||
<div class="col-8">
|
||||
<h4 class="page-title">Report Novel Meet</h4>
|
||||
<h4 class="page-title">Novel Meet</h4>
|
||||
</div>
|
||||
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval !=
|
||||
'yes'))
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
</option>
|
||||
|
||||
@endforeach
|
||||
<option value="Other">Other</option>
|
||||
|
||||
</select>
|
||||
@break
|
||||
|
||||
|
|
@ -288,7 +288,7 @@
|
|||
|
||||
<div class="doctor-group-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-6"><h4>Add Doctors</h4></div>
|
||||
<div class="col-6"><h4>Add Attendee</h4></div>
|
||||
{{-- <div class="col-6"><button class="btn btn-info btn-xs float-end" type="button" id="add-doctor">Add</button></div>
|
||||
</div> --}}
|
||||
<div class="doctor-group row">
|
||||
|
|
@ -475,7 +475,7 @@
|
|||
|
||||
$('.doctor-group-wrapper').show();
|
||||
|
||||
// आधीचे सर्व जनरेट झालेले ग्रुप्स साफ करा
|
||||
|
||||
$('.execution-doctor-group-wrapper').empty();
|
||||
|
||||
if (attendees <= 0) {
|
||||
|
|
@ -502,6 +502,8 @@
|
|||
'<div class="doctor-group row">' + doctor_html + '</div>'
|
||||
);
|
||||
|
||||
updateDoctorOptions();
|
||||
|
||||
|
||||
(function(c) {
|
||||
$('#field-hcp_name_' + c).change(function() {
|
||||
|
|
@ -510,7 +512,7 @@
|
|||
|
||||
$('#field-pcode_of_wrapper_doctor_' + c).val(selectedOption.attr('msl_code'));
|
||||
|
||||
// २. सर्वात महत्त्वाचे: या ड्रॉपडाउनची 'value' बदलून थेट डॉक्टरांचे 'नाव' सेट करा
|
||||
|
||||
let doctorName = selectedOption.text().trim();
|
||||
if(doctorName !== "" && doctorName !== "-- Select --") {
|
||||
selectedOption.val(doctorName);
|
||||
|
|
@ -521,6 +523,60 @@
|
|||
});
|
||||
|
||||
|
||||
function updateDoctorOptions() {
|
||||
|
||||
let selectedDoctors = [];
|
||||
|
||||
$('[id^="field-hcp_name"]').each(function () {
|
||||
let val = $(this).val();
|
||||
if (val) {
|
||||
selectedDoctors.push(val);
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^="field-hcp_name"]').each(function () {
|
||||
|
||||
let currentValue = $(this).val();
|
||||
|
||||
$(this).find('option').each(function () {
|
||||
|
||||
let optionValue = $(this).val();
|
||||
|
||||
if (
|
||||
optionValue &&
|
||||
optionValue !== currentValue &&
|
||||
selectedDoctors.includes(optionValue)
|
||||
) {
|
||||
$(this).prop('disabled', true);
|
||||
} else {
|
||||
$(this).prop('disabled', false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('change', '[id^="field-hcp_name"]', function () {
|
||||
|
||||
let currentVal = $(this).val();
|
||||
|
||||
let duplicate = false;
|
||||
|
||||
$('[id^="field-hcp_name"]').not(this).each(function () {
|
||||
if ($(this).val() === currentVal && currentVal !== '') {
|
||||
duplicate = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (duplicate) {
|
||||
alert('This doctor is already selected.');
|
||||
$(this).val('');
|
||||
}
|
||||
|
||||
updateDoctorOptions();
|
||||
});
|
||||
|
||||
$('#field-hcp_name').change(function() {
|
||||
$('#field-pcode_of_wrapper_doctor').val($('option:selected', this).attr('msl_code'))
|
||||
})
|
||||
|
|
@ -562,6 +618,7 @@
|
|||
$('#execution-plan_date').prop('readonly', true);
|
||||
$('#execution-msl_code').prop('readonly',true);
|
||||
$('#execution-expected_no_of_attendees').prop('readonly',true);
|
||||
$('#execution-name_of_additional_speaker').prop('readonly',true);
|
||||
|
||||
|
||||
let contacts = document.getElementById('execution-contact_id');
|
||||
|
|
@ -615,6 +672,10 @@
|
|||
$('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').parent().hide();
|
||||
$('#execution-hcp_name,#execution-pcode_of_wrapper_doctor,#execution-speaker_name').attr('required',false);
|
||||
|
||||
document.querySelectorAll('[id^="field-pcode_of_wrapper_doctor"]')
|
||||
.forEach(function(el) {
|
||||
el.readOnly = true;
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue