Files
siaupheng aaaf0a9215 Refactor member and product scripts to use concise method definitions
- Updated all function declarations to use ES6 shorthand method syntax in member.js, member_grup.js, point_barang.js, point_skema.js, point_tipe.js, kategori.js, operator.js, produk.js, produk_grup.js, rekpos.js, satuan.js, supplier.js, and varian.js.
2026-11-01 14:57:54 +07:00

88 lines
2.8 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/Display/ConfigController
Description : Konfigurasi Display POS
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPConfigJS = {
PHP: '',
KODE: '',
index() {
$('#butBrow').click(() => this.cab_brow());
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('form-display');
},
cab_brow() {
var _isi = new String('<div id="divBrowCab">&nbsp;</div>');
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', () => this.data_query('brow-cabang'));
},
cab_select(acell) {
FoniaJS.closeWindow(this.winBCab);
$('#REG_ID').val(acell[0]);
this.data_query('form-display', 'view');
},
proses_edit() {
this.data_query('form-display', 'edit');
this.load_port();
},
proses_save() {
this.data_query('form-display', 'save');
},
data_query(tipe, mode) {
if (tipe=='form-display'){
new Request({
url: this.PHP + '/form_display',
sendParam: ['mode='+mode,'REG_ID','MON_ENABLE','Text_Run','Warna','Font','Promo_Idle','Promo_Durasi','POLE_ENABLE','POLE_PORT','POLE_START1','POLE_START2','POLE_END1','POLE_END2'],
onSuccess: (ajson) => {
$('#divDisplay').html(ajson.html);
$('#Nama_Cabang').val(ajson.Nama_Cab);
this.update_event();
if (ajson.sukses) FoniaJS.showInfo('Konfigurasi display POS sukses disimpan!');
}
}).send();
} else if (tipe=='brow-cabang'){
new Request_JSF({
url: this.PHP + '/brow_cabang',
}).send();
}
},
update_event() {
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
$('#butBrow').prop('disabled', true);
$('#butUbah').prop('disabled', true);
$('#butSimpan').prop('disabled', false);
} else {
$('#butBrow').prop('disabled', false);
$('#butUbah').prop('disabled', false);
$('#butSimpan').prop('disabled', true);
}
},
load_port() {
var parent = this;
qz.serial.findPorts().then(function(data){
var _selport = $('#POLE_PORT').val();
$('#POLE_PORT').empty();
for (var i = 0; i < data.length; i++){
$('<option/>', {value: data[i]}).text(data[i]).appendTo('#POLE_PORT');
};
$('#POLE_PORT').val(_selport);
});
}
};