step 34 : fix selected object add, edit assay format desktop
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
document.addEventListener('alpine:init', () => {
|
||||
Alpine.data('assayFormat', () => ({
|
||||
// 0. Init dijalankan sebelum inisialisasi
|
||||
init(){
|
||||
init() {
|
||||
|
||||
},
|
||||
// 1. Inisialisasi Start
|
||||
@@ -74,6 +74,7 @@ document.addEventListener('alpine:init', () => {
|
||||
showDialogEdit: false,
|
||||
loadingVerifikasi: false,
|
||||
isVerifikasiDone: false,
|
||||
assayNo: '',
|
||||
decimalFontEdit: '',
|
||||
assayCodeEdit: '',
|
||||
decimalFont: '',
|
||||
@@ -114,6 +115,10 @@ document.addEventListener('alpine:init', () => {
|
||||
idInstrument: -1,
|
||||
namaInstrument: 'Instrument'
|
||||
},
|
||||
selectedInstrumentEdit: {
|
||||
idInstrument: -1,
|
||||
namaInstrument: 'Instrument'
|
||||
},
|
||||
openInstrument: false,
|
||||
openInstrumentSearchMobile: false,
|
||||
openInstrumentSearch: false,
|
||||
@@ -141,68 +146,93 @@ document.addEventListener('alpine:init', () => {
|
||||
assayCode: '',
|
||||
formula: '',
|
||||
},
|
||||
objFormEdit: {
|
||||
isValidForm: false,
|
||||
idInstrument: -1,
|
||||
namaInstrument: 'Instrument',
|
||||
decimalFont: '',
|
||||
assayCode: '',
|
||||
formula: '',
|
||||
},
|
||||
// 1. Inisialisasi End
|
||||
// 2. Fungsi Start
|
||||
closeDialog(){
|
||||
closeDialog() {
|
||||
this.openInstrument = false;
|
||||
this.selectedInstrument = {
|
||||
this.selectedInstrumentAdd = {
|
||||
idInstrument: -1,
|
||||
namaInstrument: 'Instrument'
|
||||
};
|
||||
this.loadingVerifikasi = false;
|
||||
this.loadingVerifikasi = false;
|
||||
this.isVerifikasiDone = false;
|
||||
this.objForm.isValidForm = false;
|
||||
this.isErrorVerifikasi = false;
|
||||
this.hasilVerifikasi = ''
|
||||
this.assayCode = ''
|
||||
this.decimalFont = ''
|
||||
this.formulaAdd = ''
|
||||
this.showDialogAdd = false
|
||||
},
|
||||
onChangeInstrument(item){
|
||||
onChangeInstrumentSearch(item) {
|
||||
this.openInstrumentSearch = false;
|
||||
this.selectedInstrument = item;
|
||||
},
|
||||
onChangeInstrument(item) {
|
||||
this.openInstrument = false;
|
||||
this.selectedInstrumentAdd = item;
|
||||
this.validateForm();
|
||||
},
|
||||
onChangeInstrumentEdit(item) {
|
||||
this.openInstrument = false;
|
||||
this.selectedInstrumentEdit = item;
|
||||
},
|
||||
onChangeAssayCodeAdd() {
|
||||
this.objForm.assayCode = this.assayCode;
|
||||
this.validateForm();
|
||||
},
|
||||
onChangeDecimalFontAdd(){
|
||||
onChangeDecimalFontAdd() {
|
||||
this.objForm.decimalFont = this.decimalFont;
|
||||
this.validateForm();
|
||||
},
|
||||
onChangeFormulaAdd(){
|
||||
onChangeFormulaAdd() {
|
||||
this.objForm.formula = this.formulaAdd;
|
||||
this.validateForm();
|
||||
},
|
||||
onChangeInstrumentMobile(item){
|
||||
onChangeInstrumentMobile(item) {
|
||||
this.openInstrumentSearchMobile = false;
|
||||
// this.selectedInstrument = item;
|
||||
this.selectedInstrument = { ...item };
|
||||
},
|
||||
onProcessVerifikasi(){
|
||||
if(this.isVerifikasiDone == true) {
|
||||
onProcessVerifikasi() {
|
||||
if (this.isVerifikasiDone == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.loadingVerifikasi = true;
|
||||
this.loadingVerifikasi = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.loadingVerifikasi = false;
|
||||
this.loadingVerifikasi = false;
|
||||
this.isErrorVerifikasi = false;
|
||||
this.isVerifikasiDone = true;
|
||||
this.hasilVerifikasi = 'Formula is valid';
|
||||
}, 2000);
|
||||
},
|
||||
openModalEdit(item) {
|
||||
this.selectedInstrument = {
|
||||
this.selectedInstrumentEdit = {
|
||||
idInstrument: item.idInstrument,
|
||||
namaInstrument: item.namaInstrument
|
||||
}
|
||||
|
||||
this.assayCode = item.assayCode
|
||||
this.decimalFont = item.decimalFont
|
||||
this.assayCodeEdit = item.assayCode
|
||||
this.decimalFontEdit = item.decimalFont
|
||||
this.formulaEdit = item.formula
|
||||
|
||||
this.showDialogEdit = !this.showDialogEdit;
|
||||
},
|
||||
closeDialogEdit(){
|
||||
closeDialogEdit() {
|
||||
this.loadingVerifikasi = false;
|
||||
this.isErrorVerifikasi = false;
|
||||
this.isVerifikasiDone = false;
|
||||
this.hasilVerifikasi = ''
|
||||
this.showDialogEdit = !this.showDialogEdit;
|
||||
},
|
||||
validateForm() {
|
||||
|
||||
Reference in New Issue
Block a user