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:
+12
-12
@@ -14,7 +14,7 @@ var PromoBarangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
@@ -28,7 +28,7 @@ var PromoBarangJS = {
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
detail_show(mode, ID) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_promo',
|
||||
sendParam: ['mode_detail='+mode,'PromoID='+ID],
|
||||
@@ -49,15 +49,15 @@ var PromoBarangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
detail_tambah() {
|
||||
this.detail_show('insert', 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
this.detail_show('update', acell[0]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_promo',
|
||||
@@ -67,7 +67,7 @@ var PromoBarangJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
detail_save() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_promo',
|
||||
sendParam: ['mode_detail','PromoID','InvID','SatuanID','CabID','Grup_MemberID','Pilih_Qty','Qty_Min','Qty_Kali','Tipe_Promo','Promo_Disc','Promo_InvID','Promo_SatuanID','Promo_Qty','Jumlah_Promo','Tgl_Mulai','Tgl_Akhir','Aktif','Cari_Promo'],
|
||||
@@ -78,7 +78,7 @@ var PromoBarangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_brow: function(tipe){
|
||||
produk_brow(tipe) {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button><input type="hidden" id="Tipe_Brow" value="'+tipe+'" /></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'lg', '', () => {
|
||||
$('#winBProduk')
|
||||
@@ -96,7 +96,7 @@ var PromoBarangJS = {
|
||||
});
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
produk_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
var itipe = parseInt($('#Tipe_Brow').val());
|
||||
if (itipe == 1){
|
||||
@@ -110,7 +110,7 @@ var PromoBarangJS = {
|
||||
}
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=="detail"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_promo',
|
||||
@@ -125,7 +125,7 @@ var PromoBarangJS = {
|
||||
}
|
||||
},
|
||||
|
||||
update_Items: function(InvID, SatuanID, Tipe){
|
||||
update_Items(InvID, SatuanID, Tipe) {
|
||||
const elSatuan = (Tipe==1) ? $('#SatuanID') : $('#Promo_SatuanID');
|
||||
elSatuan.empty();
|
||||
if (InvID==0) return false;
|
||||
@@ -141,7 +141,7 @@ var PromoBarangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
oc_PilihQ: function(){
|
||||
oc_PilihQ() {
|
||||
var i = parseInt($('#Pilih_Qty').val());
|
||||
if (i == 1){
|
||||
$('#Qty_Min').prop('disabled', false);
|
||||
@@ -152,7 +152,7 @@ var PromoBarangJS = {
|
||||
}
|
||||
},
|
||||
|
||||
oc_PilihP: function(){
|
||||
oc_PilihP() {
|
||||
var i = parseInt($('#Tipe_Promo').val());
|
||||
if (i == 1){
|
||||
$('.promo1').removeClass('d-none');
|
||||
|
||||
Reference in New Issue
Block a user