Files
cmasa/app/Scripts/table/satuan.js
T
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

84 lines
2.6 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/Table/SatuanController
Description : Master Satuan
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SatuanJS = {
PHP: '',
KODE: '',
index() {
this.data_query('detail');
$('#Cari_Satuan').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Satuan').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Satuan');
},
detail_show(mode, ID) {
new Request({
url: this.PHP + '/form_satuan',
sendParam: ['mode_detail='+mode,'SatuanID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Satuan', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah() {
this.detail_show('insert', 0);
},
detail_ubah(acell) {
this.detail_show('update', acell[0]);
},
detail_hapus(acell) {
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request_JSF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','SatuanID='+acell[0],'Cari_Satuan'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save() {
new Request_JSF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','SatuanID','Kode_Satuan','Nama_Satuan','Aktif','Cari_Satuan'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query(tipe, mode) {
if (tipe=="detail"){
new Request_JSF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Satuan']
}).send();
}
}
};