Updated rapport glenmarkcv blade file
This commit is contained in:
parent
7ac38f903a
commit
b924912815
|
|
@ -73,7 +73,6 @@
|
||||||
value="{{isset($question->value)?$question->value:''}}">
|
value="{{isset($question->value)?$question->value:''}}">
|
||||||
@break
|
@break
|
||||||
@case('number')
|
@case('number')
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
|
|
@ -86,11 +85,11 @@
|
||||||
name="{{$question->code}}"
|
name="{{$question->code}}"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
|
||||||
{{$question->required == 'yes'?'required':'' }}
|
{{$question->required == 'yes' ? 'required' : ''}}
|
||||||
|
|
||||||
value="{{isset($question->value)?$question->value:0}}"
|
{{ in_array($question->code, ['total_lobg_rx']) ? 'readonly' : '' }}
|
||||||
|
|
||||||
{{ $question->code == 'total-lobg-rx' ? 'readonly' : '' }}>
|
value="{{isset($question->value)?$question->value:0}}">
|
||||||
|
|
||||||
@break
|
@break
|
||||||
@case('textarea')
|
@case('textarea')
|
||||||
|
|
@ -296,67 +295,67 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#field-contact_id").change(function(){
|
$(document).on('change', '#field-contact_id', function () {
|
||||||
|
|
||||||
let selected = $('option:selected', this);
|
let selected = $(this).find('option:selected');
|
||||||
|
|
||||||
console.log(selected.attr('msl_code'));
|
$('#field-msl_code').val(
|
||||||
console.log(selected.attr('speciality'));
|
selected.attr('msl_code') || ''
|
||||||
|
);
|
||||||
|
|
||||||
$('#field-msl_code').val(selected.attr('msl_code'));
|
$('#field-speciality').val(
|
||||||
$('#field-speciality').val(selected.attr('speciality'));
|
selected.attr('speciality') || ''
|
||||||
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Auto populate Total LOBG Rx from LO-BG 0.5 mg Rx
|
|
||||||
|
|
||||||
function calculateTotalLOBGRx() {
|
// LOBG auto fill
|
||||||
|
|
||||||
let loBgRx = parseInt(
|
function syncLOBGTotal() {
|
||||||
$('#field-lo-bg-05-mg-rx').val()
|
|
||||||
) || 0;
|
|
||||||
|
|
||||||
$('#field-total-lobg-rx').val(loBgRx);
|
let loBgRx = parseInt(
|
||||||
}
|
$('#field-lo_bg_05_mg_rx').val()
|
||||||
|
) || 0;
|
||||||
|
|
||||||
$(document).on(
|
// integer only
|
||||||
'input keyup change',
|
$('#field-lo_bg_05_mg_rx').val(loBgRx);
|
||||||
'#field-lo-bg-05-mg-rx',
|
|
||||||
function () {
|
|
||||||
|
|
||||||
this.value = this.value.replace(/[^0-9]/g, '');
|
// autofill total
|
||||||
|
$('#field-total_lobg_rx').val(loBgRx);
|
||||||
calculateTotalLOBGRx();
|
|
||||||
}
|
}
|
||||||
);
|
|
||||||
$('#report-form').on('submit', function(event){
|
|
||||||
|
|
||||||
let loBgRx = parseInt(
|
|
||||||
$('#field-lo-bg-05-mg-rx').val()
|
|
||||||
) || 0;
|
|
||||||
|
|
||||||
let totalRx = parseInt(
|
// trigger while typing
|
||||||
$('#field-total-lobg-rx').val()
|
|
||||||
) || 0;
|
|
||||||
|
|
||||||
if (loBgRx !== totalRx) {
|
$(document).on(
|
||||||
|
'input keyup change',
|
||||||
|
'#field-lo_bg_05_mg_rx',
|
||||||
|
function () {
|
||||||
|
|
||||||
event.preventDefault();
|
this.value = this.value.replace(/[^0-9]/g, '');
|
||||||
|
|
||||||
alert('Total LOBG Rx is mismatched.');
|
syncLOBGTotal();
|
||||||
|
|
||||||
return false;
|
}
|
||||||
}
|
);
|
||||||
});
|
|
||||||
var today = new Date();
|
|
||||||
var dd = String(today.getDate()).padStart(2, '0');
|
|
||||||
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
|
||||||
var yyyy = today.getFullYear();
|
|
||||||
today = yyyy + '-' + mm + '-' + dd;
|
|
||||||
|
|
||||||
var plandateField = document.getElementById('field-record_date');
|
|
||||||
|
|
||||||
plandateField.setAttribute('max', today);
|
// prevent future dates
|
||||||
|
|
||||||
|
$('input[type="date"]').attr(
|
||||||
|
'max',
|
||||||
|
new Date().toISOString().split("T")[0]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// initial load sync
|
||||||
|
|
||||||
|
syncLOBGTotal();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue