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.
This commit is contained in:
@@ -14,14 +14,14 @@ var AboutJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#win'+this.KODE).find('#divBuildInfo').html('<p>Aplikasi dibuat dengan komponen :<br>- jQuery Version '+$().jquery+' <br>- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+' <br>- FoniaJS Version '+FoniaJS.version+' <br>- FoniaPHP Version '+FoniaJS.version+'</p>');
|
||||
$('#butDBCek').click(() => this.db_check());
|
||||
$('#butDBOpti').click(() => this.db_opti());
|
||||
$('#butUpdateCek').click(() => this.update_check());
|
||||
},
|
||||
|
||||
db_check: function(){
|
||||
db_check() {
|
||||
new Request({
|
||||
url: this.PHP + '/db_check',
|
||||
onSuccess: (ajson) => {
|
||||
@@ -30,7 +30,7 @@ var AboutJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
db_opti: function(){
|
||||
db_opti() {
|
||||
new Request({
|
||||
url: this.PHP + '/db_check',
|
||||
onSuccess: (ajson) => {
|
||||
@@ -39,7 +39,7 @@ var AboutJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
update_check: function(){
|
||||
update_check() {
|
||||
new Request({
|
||||
url: this.PHP + '/update_check',
|
||||
onSuccess: (ajson) => {
|
||||
@@ -52,7 +52,7 @@ var AboutJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
db_run: function(db_count = 0){
|
||||
db_run(db_count = 0) {
|
||||
if (db_count === 0) return false;
|
||||
var items = Array(db_count).fill(0).map((_, index) => index);
|
||||
var $ul = $('#db-list').empty();
|
||||
@@ -70,7 +70,7 @@ var AboutJS = {
|
||||
}, $.Deferred().resolve().promise());
|
||||
},
|
||||
|
||||
opti_run: function(db_count = 0){
|
||||
opti_run(db_count = 0) {
|
||||
if (db_count === 0) return false;
|
||||
var items = Array(db_count).fill(0).map((_, index) => index);
|
||||
var $ul = $('#db-list').empty();
|
||||
@@ -88,7 +88,7 @@ var AboutJS = {
|
||||
}, $.Deferred().resolve().promise());
|
||||
},
|
||||
|
||||
update_run: function(){
|
||||
update_run() {
|
||||
new Request({
|
||||
url: this.PHP + '/update_proses',
|
||||
onSuccess: (adata) => {
|
||||
|
||||
@@ -14,12 +14,12 @@ var SYSChpasswdJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butSave').click(() => this.proses_save());
|
||||
FoniaJS.setFocus('#LPass');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
proses_save() {
|
||||
if ($("#LPass").val()=="") {
|
||||
FoniaJS.showInfo("Silakan masukkan password lama Anda!");
|
||||
FoniaJS.setFocus("#LPass");
|
||||
|
||||
@@ -14,17 +14,17 @@ var ConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butUbah').click(() => this.proses_edit());
|
||||
$('#butSimpan').click(() => this.proses_save());
|
||||
this.data_query('view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
proses_edit() {
|
||||
this.data_query('edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
proses_save() {
|
||||
new Request({
|
||||
url: this.PHP + '/config',
|
||||
sendParam: ['mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_EMAIL','REG_OWNER','REG_NPWP'],
|
||||
@@ -35,7 +35,7 @@ var ConfigJS = {
|
||||
}).send()
|
||||
},
|
||||
|
||||
data_query: function(mode){
|
||||
data_query(mode) {
|
||||
new Request({
|
||||
url: this.PHP + '/config',
|
||||
sendParam: ['mode='+mode],
|
||||
@@ -46,7 +46,7 @@ var ConfigJS = {
|
||||
}).send()
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
update_event() {
|
||||
if ($.inArray($('#mode').val(), ['edit']) !== -1) {
|
||||
$("#butUbah").prop('disabled', true);
|
||||
$("#butSimpan").prop('disabled', false);
|
||||
|
||||
@@ -14,7 +14,7 @@ var MenuGrupJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
this.data_query();
|
||||
$('#Cari_Grup').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
@@ -28,7 +28,7 @@ var MenuGrupJS = {
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
detail_show(mode, ID) {
|
||||
new Request({
|
||||
url: this.PHP + '/detail_grup',
|
||||
sendParam: ['mode='+mode,'Grup_MenuID='+ID],
|
||||
@@ -40,15 +40,15 @@ var MenuGrupJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
detail_tambah() {
|
||||
this.detail_show('add', 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
this.detail_show('edit', acell[0]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm("Konfirmasi", "Yakin akan hapus "+acell[1]+"?", function(){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -58,7 +58,7 @@ var MenuGrupJS = {
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
detail_save() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','Grup_MenuID','Nama_Grup','Ket','Aktif','Cari_Grup'],
|
||||
@@ -69,7 +69,7 @@ var MenuGrupJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
menu_show(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/detail_menu',
|
||||
sendParam: ['Grup_MenuID='+acell[0]],
|
||||
@@ -92,15 +92,15 @@ var MenuGrupJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
menu_ceksemua() {
|
||||
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
menu_hapussemua() {
|
||||
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
menu_simpan() {
|
||||
var alist = [];
|
||||
$('#tabMenuList tbody input.form-check-input[type=checkbox]:checked').map((i, b) => {
|
||||
alist.push($(b).val());
|
||||
@@ -119,7 +119,7 @@ var MenuGrupJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(){
|
||||
data_query() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['Cari_Grup'],
|
||||
|
||||
@@ -14,7 +14,7 @@ var OperatorJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
this.data_query('detail');
|
||||
$('#Cari_User').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
@@ -29,7 +29,7 @@ var OperatorJS = {
|
||||
FoniaJS.setFocus('#Cari_User');
|
||||
},
|
||||
|
||||
filter_show: function(){
|
||||
filter_show() {
|
||||
new Request({
|
||||
url: this.PHP + '/detail_filter',
|
||||
sendParam: ['Filter_Level'],
|
||||
@@ -43,13 +43,13 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
filter_simpan: function(){
|
||||
filter_simpan() {
|
||||
$('#Filter_Level').val($('#Fi_Level').val());
|
||||
FoniaJS.closeWindow(this.winFilter);
|
||||
this.data_query('detail');
|
||||
},
|
||||
|
||||
detail_show: function(mode, UserID){
|
||||
detail_show(mode, UserID) {
|
||||
new Request({
|
||||
url: this.PHP + '/detail_user',
|
||||
sendParam: ['mode='+mode,'UserID='+UserID],
|
||||
@@ -62,15 +62,15 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
detail_tambah() {
|
||||
this.detail_show('add', 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
this.detail_show('edit', acell[0]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm("Konfirmasi", "Yakin akan hapus ["+acell[1]+"] "+acell[2]+"?", () => {
|
||||
new Request({
|
||||
url: this.PHP + '/save_user',
|
||||
@@ -87,7 +87,7 @@ var OperatorJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_check: function(){
|
||||
detail_check() {
|
||||
if ($('#Username').val().toUpperCase()==$('#UserLama').val().toUpperCase()) {
|
||||
this.detail_save();
|
||||
return;
|
||||
@@ -105,7 +105,7 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
detail_save() {
|
||||
new Request({
|
||||
url: this.PHP + '/save_user',
|
||||
sendParam: ['mode','UserID','Username','Nama','Posisi','Level','Password','Grup_MenuID','Aktif'],
|
||||
@@ -121,7 +121,7 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
menu_show(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/detail_menu',
|
||||
sendParam: ['UserID='+acell[0]],
|
||||
@@ -145,15 +145,15 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
menu_ceksemua() {
|
||||
$('#tabMenuList input.form-check-input[type=checkbox]:not(:disabled)').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
menu_hapussemua() {
|
||||
$('#tabMenuList input.form-check-input[type=checkbox]:not(:disabled)').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
menu_simpan() {
|
||||
var alist = [];
|
||||
$('#tabMenuList tbody input.form-check-input[type=checkbox]:not(:disabled):checked').map((i, b) => {
|
||||
alist.push($(b).val());
|
||||
@@ -172,7 +172,7 @@ var OperatorJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=="detail"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -181,7 +181,7 @@ var OperatorJS = {
|
||||
}
|
||||
},
|
||||
|
||||
oc_Level: function(){
|
||||
oc_Level() {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -14,32 +14,32 @@ var PrinterJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butBrow').click(() => this.cab_brow());
|
||||
$('#butUbah').click(() => this.proses_edit());
|
||||
$('#butSimpan').click(() => this.proses_save());
|
||||
this.data_query('form-printer');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
cab_brow() {
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', '<div id="divBrowCab"> </div>', 'lg', '', () => this.data_query('brow-cabang'));
|
||||
},
|
||||
|
||||
cab_select: function(acell){
|
||||
cab_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBCab);
|
||||
$('#REG_ID').val(acell[0]);
|
||||
this.data_query('form-printer', 'view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
proses_edit() {
|
||||
this.data_query('form-printer', 'edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
proses_save() {
|
||||
this.data_query('form-printer', 'save');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe === 'form-printer'){
|
||||
new Request({
|
||||
url: this.PHP + '/form_printer',
|
||||
@@ -58,7 +58,7 @@ var PrinterJS = {
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
update_event() {
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butBrow').prop('disabled', true);
|
||||
$('#butUbah').prop('disabled', true);
|
||||
|
||||
@@ -14,7 +14,7 @@ var SYSProfileJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butSave').click(() => this.save_profile());
|
||||
$('#win'+this.KODE).find('#FileGambar').off('change').change(() => {
|
||||
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
|
||||
@@ -38,7 +38,7 @@ var SYSProfileJS = {
|
||||
this.get_picture();
|
||||
},
|
||||
|
||||
save_profile: function(){
|
||||
save_profile() {
|
||||
new Request({
|
||||
url: this.PHP + '/save_profile',
|
||||
sendParam: ['Nama','Posisi','Email','HP'],
|
||||
@@ -53,7 +53,7 @@ var SYSProfileJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
get_picture: function(){
|
||||
get_picture() {
|
||||
new Request({
|
||||
url: this.PHP + '/get_picture',
|
||||
onSuccess: (ajson) => {
|
||||
|
||||
@@ -14,12 +14,12 @@ var SuperJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
this.data_query();
|
||||
if ($('#divSuper').length > 0 && socket.active) socket.emit('super-check');
|
||||
},
|
||||
|
||||
detail_select: function(acell){
|
||||
detail_select(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/approve',
|
||||
sendParam: ['AuthID='+acell[0]],
|
||||
@@ -27,7 +27,7 @@ var SuperJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(){
|
||||
data_query() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
}).send();
|
||||
|
||||
Reference in New Issue
Block a user