111 lines
3.3 KiB
JavaScript
111 lines
3.3 KiB
JavaScript
document.addEventListener('alpine:init', () => {
|
|
Alpine.data('assayFormat', () => ({
|
|
// 0. Init dijalankan sebelum inisialisasi
|
|
init(){
|
|
|
|
},
|
|
// 1. Inisialisasi Start
|
|
showDialogAdd: false,
|
|
showDialogEdit: false,
|
|
loadingVerifikasi: false,
|
|
decimalFont: '',
|
|
assayCode: '',
|
|
formulaEdit: '',
|
|
formulaAdd: '',
|
|
dataAssayFormat: [
|
|
{
|
|
idAssayFormat: 1,
|
|
idInstrument: 1,
|
|
namaInstrument: 'Hema 01',
|
|
assayCode: 'WBC',
|
|
decimalFont: '5001',
|
|
formula: ''
|
|
},
|
|
{
|
|
idAssayFormat: 2,
|
|
idInstrument: 2,
|
|
namaInstrument: 'Axsym',
|
|
assayCode: 'IgG',
|
|
decimalFont: '2001',
|
|
formula: ''
|
|
},
|
|
{
|
|
idAssayFormat: 3,
|
|
idInstrument: 3,
|
|
namaInstrument: 'Cobas C311',
|
|
assayCode: 'DBIL',
|
|
decimalFont: '4001',
|
|
formula: '(TBIL) - (DBIL)'
|
|
},
|
|
],
|
|
selectedInstrument: {
|
|
idInstrument: -1,
|
|
namaInstrument: 'Instrument'
|
|
},
|
|
openInstrument: false,
|
|
openInstrumentMobile: false,
|
|
dataInstrument: [
|
|
{
|
|
idInstrument: 1,
|
|
namaInstrument: 'Hema 01',
|
|
},
|
|
{
|
|
idInstrument: 2,
|
|
namaInstrument: 'Axsym',
|
|
},
|
|
{
|
|
idInstrument: 3,
|
|
namaInstrument: 'Cobas C311',
|
|
},
|
|
],
|
|
hasilVerifikasi: '',
|
|
isErrorVerifikasi: false,
|
|
// 1. Inisialisasi End
|
|
// 2. Fungsi Start
|
|
closeDialog(){
|
|
this.openInstrument = false;
|
|
this.selectedInstrument = {
|
|
idInstrument: -1,
|
|
namaInstrument: 'Instrument'
|
|
};
|
|
this.loadingVerifikasi = false;
|
|
this.isErrorVerifikasi = false;
|
|
this.hasilVerifikasi = ''
|
|
this.formulaAdd = ''
|
|
this.showDialogAdd = false
|
|
},
|
|
onChangeInstrument(item){
|
|
this.openInstrument = false;
|
|
this.selectedInstrument = item;
|
|
},
|
|
onChangeInstrumentMobile(item){
|
|
this.openInstrumentMobile = false;
|
|
// this.selectedInstrument = item;
|
|
this.selectedInstrument = { ...item };
|
|
},
|
|
onProcessVerifiaksi(){
|
|
this.loadingVerifikasi = true;
|
|
|
|
setTimeout(() => {
|
|
this.loadingVerifikasi = false;
|
|
this.isErrorVerifikasi = false;
|
|
this.hasilVerifikasi = 'Formula is valid';
|
|
}, 2000);
|
|
},
|
|
openModalEdit(item) {
|
|
this.selectedInstrument = {
|
|
idInstrument: item.idInstrument,
|
|
namaInstrument: item.namaInstrument
|
|
}
|
|
|
|
this.assayCode = item.assayCode
|
|
this.decimalFont = item.decimalFont
|
|
this.formulaEdit = item.formula
|
|
this.showDialogEdit = !this.showDialogEdit;
|
|
},
|
|
closeDialogEdit(){
|
|
this.showDialogEdit = !this.showDialogEdit;
|
|
},
|
|
// 2. Fungsi End
|
|
}))
|
|
}) |