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,7 +14,7 @@ var PromoBeliDiscJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
index(q) {
|
||||
$('#butTambah').click(() => this.promo_tambah());
|
||||
$('#butUbah').click(() => this.promo_ubah());
|
||||
$('#butHapus').click(() => this.promo_hapus());
|
||||
@@ -23,7 +23,7 @@ var PromoBeliDiscJS = {
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
promo_brow: function(){
|
||||
promo_brow() {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Promo" 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></div></div></div><div id="divBrowPromo"> </div>');
|
||||
this.winBPromo = FoniaJS.showWindow('BPromo', 'Daftar Promo', _isi, 'xl', '', () => {
|
||||
$('#winBPromo')
|
||||
@@ -40,17 +40,17 @@ var PromoBeliDiscJS = {
|
||||
});
|
||||
},
|
||||
|
||||
promo_select: function(acell){
|
||||
promo_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBPromo);
|
||||
$('#Grup_PromoID').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
promo_tambah: function(){
|
||||
promo_tambah() {
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
promo_ubah: function(){
|
||||
promo_ubah() {
|
||||
if ($('#Grup_PromoID').val() == 0){
|
||||
FoniaJS.showError("Silakan pilih Nama Promo !");
|
||||
return;
|
||||
@@ -58,7 +58,7 @@ var PromoBeliDiscJS = {
|
||||
this.data_query('master', 'edit');
|
||||
},
|
||||
|
||||
promo_hapus: function(){
|
||||
promo_hapus() {
|
||||
if ($('#Grup_PromoID').val() == 0){
|
||||
FoniaJS.showError("Silakan pilih Nama Promo !");
|
||||
return;
|
||||
@@ -80,18 +80,18 @@ var PromoBeliDiscJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
promo_simpan: function(mode){
|
||||
promo_simpan(mode) {
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
promo_batal: function(){
|
||||
promo_batal() {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#Grup_PromoID').val(0);
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
produk_brow() {
|
||||
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></div></div></div><div id="divBrowProduk"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
|
||||
$('#winBProduk')
|
||||
@@ -108,12 +108,12 @@ var PromoBeliDiscJS = {
|
||||
});
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
produk_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1], '0');
|
||||
},
|
||||
|
||||
detail_produk: function(mode, PromoID, InvID, SatuanID, Kode_Varian){
|
||||
detail_produk(mode, PromoID, InvID, SatuanID, Kode_Varian) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_produk',
|
||||
sendParam: ['mode','mode_detail='+mode,'Grup_PromoID','PromoID='+PromoID,'InvID='+InvID,'SatuanID='+SatuanID,'Kode_Varian='+Kode_Varian],
|
||||
@@ -132,15 +132,15 @@ var PromoBeliDiscJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function() {
|
||||
detail_tambah() {
|
||||
this.detail_produk('insert', 0, 0, 0, '0');
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -149,7 +149,7 @@ var PromoBeliDiscJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
detail_simpan() {
|
||||
if ($('#InvID').val() == 0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang Promo !');
|
||||
return;
|
||||
@@ -161,14 +161,14 @@ var PromoBeliDiscJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
varian_show: function(){
|
||||
varian_show() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/form_varian',
|
||||
sendParam: ['InvID','SatuanID','Kode_Varian']
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
data_query(tipe, mode, kd_tx) {
|
||||
if (tipe=="master"){
|
||||
mode = (mode) ? mode : '';
|
||||
var sparam = ['mode='+mode,'Grup_PromoID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
@@ -221,13 +221,13 @@ var PromoBeliDiscJS = {
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
Produk_Comp(item) {
|
||||
$('#InvID').val(item.value);
|
||||
$('#Nama_Produk').val(item.text);
|
||||
PromoBeliDiscJS.update_items(item.value, item.data);
|
||||
},
|
||||
|
||||
update_items: function(InvID, SatuanID){
|
||||
update_items(InvID, SatuanID) {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/option_satuan',
|
||||
sendParam: ['InvID='+InvID,'SatuanID='+SatuanID],
|
||||
|
||||
Reference in New Issue
Block a user