Team4 - Molecule Identification form Testing for error (18/06/2026 : 05:03)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 34s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 34s
Details
This commit is contained in:
parent
d46cc0974d
commit
384d80bb8d
|
|
@ -105,6 +105,13 @@
|
|||
$otherMolecule = trim((string) $otherMolecule);
|
||||
}
|
||||
|
||||
$otherMoleculeRxSupport = $formdata->other_molecule_rx_support ?? '';
|
||||
if (is_array($otherMoleculeRxSupport) || $otherMoleculeRxSupport instanceof \Traversable) {
|
||||
$otherMoleculeRxSupport = trim((string)(array_values((array)$otherMoleculeRxSupport)[0] ?? ''));
|
||||
} else {
|
||||
$otherMoleculeRxSupport = trim((string)$otherMoleculeRxSupport);
|
||||
}
|
||||
|
||||
$recordDate = $formdata->record_date ?? '';
|
||||
if (is_array($recordDate) || $recordDate instanceof \Traversable) {
|
||||
$recordDate = trim((string) (array_values((array) $recordDate)[0] ?? ''));
|
||||
|
|
@ -123,6 +130,7 @@
|
|||
'doctor_name' => $doctorNameById[$doctorId] ?? $rawDoctorId,
|
||||
'rx_support' => $rxSupport,
|
||||
'other_molecule_use' => $otherMolecule,
|
||||
'other_molecule_rx_support' => $otherMoleculeRxSupport ?? '',
|
||||
'record_date' => $recordDate,
|
||||
];
|
||||
|
||||
|
|
@ -193,6 +201,7 @@
|
|||
'rx_support',
|
||||
'other_molecule_use',
|
||||
'molecule_use',
|
||||
'other_molecule_rx_support',
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
|
@ -354,6 +363,9 @@
|
|||
<th>Doctor Name</th>
|
||||
<th>Rxn/Week Support</th>
|
||||
<th>Other Molecule Use</th>
|
||||
<th class="other-rx-header" style="display:none;">
|
||||
Other Molecule Rxn/Week Support
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody
|
||||
|
|
@ -375,6 +387,7 @@
|
|||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<select class="form-control rx-support-select" required>
|
||||
<option value="">-- Select --</option>
|
||||
<option value="1-3 Rxn/Week">1-3 Rxn/Week</option>
|
||||
|
|
@ -383,6 +396,7 @@
|
|||
<option value=">11 Rxn/Week">>11 Rxn/Week</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="form-control other-molecule-select" required>
|
||||
<option value="">-- Select --</option>
|
||||
|
|
@ -392,6 +406,15 @@
|
|||
<option value="No">No</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="other-molecule-rx-cell" style="display:none;">
|
||||
<select class="form-control other-molecule-rx-support">
|
||||
<option value="">-- Select --</option>
|
||||
<option value="1-3 Rxn/Week">1-3 Rxn/Week</option>
|
||||
<option value="4-7 Rxn/Week">4-7 Rxn/Week</option>
|
||||
<option value="8-11 Rxn/Week">8-11 Rxn/Week</option>
|
||||
<option value=">11 Rxn/Week">>11 Rxn/Week</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@php $globalRowIndex++; @endphp
|
||||
@endfor
|
||||
|
|
@ -469,6 +492,17 @@ select option:disabled {
|
|||
var categoryDoctorSubmissions = {!! json_encode($categoryDoctorSubmissions) !!};
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
$(document).on(
|
||||
'change',
|
||||
'.other-molecule-select',
|
||||
function(){
|
||||
|
||||
toggleOtherMoleculeRxSupport(
|
||||
$(this).closest('tr')
|
||||
);
|
||||
|
||||
}
|
||||
);
|
||||
function getDoctorRows() {
|
||||
let rows = [];
|
||||
|
||||
|
|
@ -534,6 +568,9 @@ select option:disabled {
|
|||
.val(submission.rx_support || '');
|
||||
$row.find('.other-molecule-select')
|
||||
.val(submission.other_molecule_use || '');
|
||||
$row.find('.other-molecule-rx-support')
|
||||
.val(submission.other_molecule_rx_support || '');
|
||||
toggleOtherMoleculeRxSupport($row);
|
||||
setSubmissionId($row, submission.submission_id);
|
||||
});
|
||||
}
|
||||
|
|
@ -543,6 +580,42 @@ select option:disabled {
|
|||
prefillDoctorTableSection($(this), $(this).data('category'));
|
||||
});
|
||||
}
|
||||
function checkOtherRxHeader(){
|
||||
|
||||
let visible = false;
|
||||
|
||||
$('.other-molecule-rx-cell').each(function(){
|
||||
|
||||
if($(this).is(':visible')){
|
||||
visible = true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(visible){
|
||||
$('.other-rx-header').show();
|
||||
}else{
|
||||
$('.other-rx-header').hide();
|
||||
}
|
||||
|
||||
}
|
||||
function toggleOtherMoleculeRxSupport($row){
|
||||
|
||||
let value = $row.find('.other-molecule-select').val();
|
||||
|
||||
if(
|
||||
value &&
|
||||
value !== 'No'
|
||||
){
|
||||
$row.find('.other-molecule-rx-cell').show();
|
||||
$('.other-rx-header').show();
|
||||
}else{
|
||||
$row.find('.other-molecule-rx-cell').hide();
|
||||
$row.find('.other-molecule-rx-support').val('');
|
||||
}
|
||||
|
||||
checkOtherRxHeader();
|
||||
}
|
||||
|
||||
/* function updateDoctorDropdowns($tbody) {
|
||||
let selectedDoctors = [];
|
||||
|
|
@ -645,7 +718,7 @@ select option:disabled {
|
|||
function buildSubmitFormData() {
|
||||
let fd = new FormData();
|
||||
let form = $('#report-form')[0];
|
||||
let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select'];
|
||||
let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select', 'other-molecule-rx-support'];
|
||||
|
||||
Array.from(form.elements).forEach(function(el) {
|
||||
if (!el.name || el.disabled) {
|
||||
|
|
@ -697,6 +770,7 @@ select option:disabled {
|
|||
fd.append('contact_id[]', $row.find('.doctor-select').val());
|
||||
fd.append('rx_support[]', $row.find('.rx-support-select').val());
|
||||
fd.append('other_molecule_use[]', $row.find('.other-molecule-select').val());
|
||||
fd.append('other_molecule_rx_support[]', $row.find('.other-molecule-rx-support').val());
|
||||
fd.append('molecule_use[]', item.moleculeUse);
|
||||
|
||||
let submissionId = $row.attr('data-submission-id');
|
||||
|
|
@ -746,6 +820,7 @@ select option:disabled {
|
|||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
|
||||
$("#pageloader").fadeOut();
|
||||
if (data.status == 'success') {
|
||||
Swal.fire({
|
||||
|
|
|
|||
Loading…
Reference in New Issue