Compare commits
2 Commits
f26cf8dfd8
...
1e33ce82bf
| Author | SHA1 | Date |
|---|---|---|
|
|
1e33ce82bf | |
|
|
aa81e6e90f |
|
|
@ -339,7 +339,12 @@
|
||||||
<div class="col-md-12 mt-3">
|
<div class="col-md-12 mt-3">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5>
|
{{-- <h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5> --}}
|
||||||
|
<h5 class="mb-0">
|
||||||
|
{{ $categoryLabel == 'nac + acebrophylline'
|
||||||
|
? 'NAC + Acebrophylline'
|
||||||
|
: ucwords($categoryLabel) }}
|
||||||
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|
@ -539,7 +544,7 @@ select option:disabled {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDoctorDropdowns($tbody) {
|
/* function updateDoctorDropdowns($tbody) {
|
||||||
let selectedDoctors = [];
|
let selectedDoctors = [];
|
||||||
|
|
||||||
$tbody.find('.doctor-select').each(function() {
|
$tbody.find('.doctor-select').each(function() {
|
||||||
|
|
@ -574,7 +579,47 @@ 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) {
|
function updateOtherMoleculeDropdowns($tbody) {
|
||||||
let sectionMolecule = $tbody.data('molecule-use');
|
let sectionMolecule = $tbody.data('molecule-use');
|
||||||
|
|
||||||
|
|
@ -663,8 +708,11 @@ select option:disabled {
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('change', '.doctor-select', function() {
|
/*$(document).on('change', '.doctor-select', function() {
|
||||||
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
|
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
|
||||||
|
});*/
|
||||||
|
$(document).on('change', '.doctor-select', function() {
|
||||||
|
updateDoctorDropdowns();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.doctor-select').select2({
|
$('.doctor-select').select2({
|
||||||
|
|
@ -675,12 +723,18 @@ select option:disabled {
|
||||||
|
|
||||||
prefillAllDoctorTables();
|
prefillAllDoctorTables();
|
||||||
|
|
||||||
$('.doctor-table-body').each(function() {
|
/* $('.doctor-table-body').each(function() {
|
||||||
let $tbody = $(this);
|
let $tbody = $(this);
|
||||||
updateOtherMoleculeDropdowns($tbody);
|
updateOtherMoleculeDropdowns($tbody);
|
||||||
updateDoctorDropdowns($tbody);
|
updateDoctorDropdowns($tbody);
|
||||||
|
}); */
|
||||||
|
$('.doctor-table-body').each(function() {
|
||||||
|
let $tbody = $(this);
|
||||||
|
updateOtherMoleculeDropdowns($tbody);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateDoctorDropdowns();
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event) {
|
$('#report-form').on('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,10 @@
|
||||||
</option>
|
</option>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
<option value="others">Others</option>
|
<option value="others"
|
||||||
|
{{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>
|
||||||
|
Others
|
||||||
|
</option>
|
||||||
@else
|
@else
|
||||||
@foreach ($question->options as $option)
|
@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' : '' }}>
|
<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' : '' }}>
|
||||||
|
|
@ -181,6 +184,12 @@
|
||||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($){
|
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];
|
var today = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
$('#field-record_date').attr('max', today);
|
$('#field-record_date').attr('max', today);
|
||||||
|
|
@ -243,7 +252,7 @@
|
||||||
$('#field-contact_id').change(function() {
|
$('#field-contact_id').change(function() {
|
||||||
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#field-contact_id').change(function() {
|
$('#field-contact_id').change(function() {
|
||||||
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue