Compare commits

..

No commits in common. "1e33ce82bfd29db78af9fb507257821b0fecc4c8" and "f26cf8dfd82d886a841447a37d90bea23b607e09" have entirely different histories.

2 changed files with 6 additions and 69 deletions

View File

@ -339,12 +339,7 @@
<div class="col-md-12 mt-3">
<div class="card">
<div class="card-header">
{{-- <h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5> --}}
<h5 class="mb-0">
{{ $categoryLabel == 'nac + acebrophylline'
? 'NAC + Acebrophylline'
: ucwords($categoryLabel) }}
</h5>
<h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
@ -544,7 +539,7 @@ select option:disabled {
});
}
/* function updateDoctorDropdowns($tbody) {
function updateDoctorDropdowns($tbody) {
let selectedDoctors = [];
$tbody.find('.doctor-select').each(function() {
@ -579,47 +574,7 @@ select option:disabled {
});
});
}
*/
function updateDoctorDropdowns() {
let selectedDoctors = [];
$('.doctor-select').each(function() {
let value = $(this).val();
if (value) {
selectedDoctors.push(value);
}
});
$('.doctor-select').each(function() {
let currentDropdown = $(this);
let currentValue = currentDropdown.val();
currentDropdown.find('option').each(function() {
let option = $(this);
let originalText = option.data('original-text') || option.text();
option.data('original-text', originalText);
option.text(originalText);
option.prop('disabled', false);
let optionValue = option.val();
if (
optionValue &&
optionValue !== currentValue &&
selectedDoctors.includes(optionValue)
) {
option.prop('disabled', true);
option.text(originalText + ' (Already Added)');
}
});
});
}
function updateOtherMoleculeDropdowns($tbody) {
let sectionMolecule = $tbody.data('molecule-use');
@ -708,11 +663,8 @@ select option:disabled {
return fd;
}
/*$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
});*/
$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns();
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
});
$('.doctor-select').select2({
@ -723,18 +675,12 @@ select option:disabled {
prefillAllDoctorTables();
/* $('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
updateDoctorDropdowns($tbody);
}); */
$('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
updateDoctorDropdowns($tbody);
});
updateDoctorDropdowns();
$('#report-form').on('submit', function(event) {
event.preventDefault();

View File

@ -90,10 +90,7 @@
</option>
@endif
@endforeach
<option value="others"
{{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>
Others
</option>
<option value="others">Others</option>
@else
@foreach ($question->options as $option)
<option value="{{ $option->value }}" pcode="{{isset($option->contact->pcode)?$option->contact->pcode:''}}" msl_code="{{isset($option->contact->msl_code)?$option->contact->msl_code:''}}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
@ -184,12 +181,6 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
if($('#field-contact_id').val() === 'others'){
$('#field-name_of_other_hcp,#field-p_code_of_other_hcp')
.parent().show();
$('#field-msl_code').parent().hide();
}
var today = new Date().toISOString().split('T')[0];
$('#field-record_date').attr('max', today);
@ -252,7 +243,7 @@
$('#field-contact_id').change(function() {
$('#field-speciality').val($('option:selected', this).attr('speciality'))
})
$('#field-contact_id').change(function() {
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
})