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 RepoInvBarcodeJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butCetak').click(() => this.proses_print());
|
||||
$('#butLoadPrinter').click(() => this.load_printer());
|
||||
$('#butBrowProduk').click(() => this.produk_brow());
|
||||
@@ -22,7 +22,7 @@ var RepoInvBarcodeJS = {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
},
|
||||
|
||||
proses_print: function(){
|
||||
proses_print() {
|
||||
if ($('#InvID').val() == 0){
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
FoniaJS.setFocus('Nama_Produk');
|
||||
@@ -42,7 +42,7 @@ var RepoInvBarcodeJS = {
|
||||
cetak.exec();
|
||||
},
|
||||
|
||||
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')
|
||||
@@ -59,7 +59,7 @@ var RepoInvBarcodeJS = {
|
||||
});
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
produk_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#SatuanID').val(acell[1]);
|
||||
@@ -69,7 +69,7 @@ var RepoInvBarcodeJS = {
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
data_query(tipe) {
|
||||
if (tipe=="brow-produk"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
@@ -79,7 +79,7 @@ var RepoInvBarcodeJS = {
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
Produk_Comp(item) {
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[0]);
|
||||
@@ -89,7 +89,7 @@ var RepoInvBarcodeJS = {
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
load_printer: function(){
|
||||
load_printer() {
|
||||
qz.printers.find().then((data) => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/load_printer',
|
||||
|
||||
@@ -14,13 +14,13 @@ var RepoInvHutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butCetak').click(() => this.proses_print(true));
|
||||
$('#butPreview').click(() => this.proses_print());
|
||||
$('#butExcel').click(() => this.proses_dload());
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
proses_print(prt) {
|
||||
var cetak = new Printer(this.PHP + '/print');
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
@@ -30,7 +30,7 @@ var RepoInvHutangJS = {
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
proses_dload() {
|
||||
var dload = new Download(this.PHP + '/excel');
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
|
||||
@@ -14,26 +14,26 @@ var RepoInvLabelJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
index(q) {
|
||||
$('#butHapus').click(() => this.proses_empty());
|
||||
$('#butPrint').click(() => this.proses_print(true));
|
||||
$('#butPreview').click(() => this.proses_print());
|
||||
this.data_query('tabel-detail', 'empty', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
proses_empty: function(){
|
||||
proses_empty() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=empty']
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
proses_print(prt) {
|
||||
var cetak = new Printer(this.PHP + '/print');
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
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', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBProduk')
|
||||
@@ -51,7 +51,7 @@ var RepoInvLabelJS = {
|
||||
});
|
||||
},
|
||||
|
||||
produk_simpan: function(){
|
||||
produk_simpan() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=simpan-produk'],
|
||||
@@ -59,7 +59,7 @@ var RepoInvLabelJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_brow: function(){
|
||||
grup_brow() {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Grup" 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="divBrowGrup"> </div>');
|
||||
this.winBGrup = FoniaJS.showWindow('BGrup', 'Daftar Grup Barang', _isi, 'xl', '', () => {
|
||||
$('#winBGrup')
|
||||
@@ -76,7 +76,7 @@ var RepoInvLabelJS = {
|
||||
});
|
||||
},
|
||||
|
||||
grup_select: function(acell){
|
||||
grup_select(acell) {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=simpan-grup','Grup_InvID='+acell[0]],
|
||||
@@ -84,7 +84,7 @@ var RepoInvLabelJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_detail',
|
||||
sendParam: ['mode_detail=update','ID='+acell[0]],
|
||||
@@ -101,7 +101,7 @@ var RepoInvLabelJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', () => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -110,7 +110,7 @@ var RepoInvLabelJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
detail_simpan() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=update','ID='+$('#ID').val(),'Nama_Produk='+encodeURIComponent($('#Nama_Produk').val())],
|
||||
@@ -118,7 +118,7 @@ var RepoInvLabelJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
data_query(tipe, mode, kd_tx) {
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
|
||||
@@ -14,7 +14,7 @@ var RepoInvPiutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butCetak').click(() => this.proses_print(true));
|
||||
$('#butPreview').click(() => this.proses_print());
|
||||
$('#butExcel').click(() => this.proses_dload());
|
||||
@@ -22,7 +22,7 @@ var RepoInvPiutangJS = {
|
||||
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
proses_print(prt) {
|
||||
var cetak = new Printer(this.PHP + '/print');
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
@@ -32,7 +32,7 @@ var RepoInvPiutangJS = {
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
proses_dload() {
|
||||
var dload = new Download(this.PHP + '/excel');
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
@@ -42,7 +42,7 @@ var RepoInvPiutangJS = {
|
||||
dload.download();
|
||||
},
|
||||
|
||||
member_brow: function(){
|
||||
member_brow() {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember"> </div>');
|
||||
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
|
||||
$('#winBMember')
|
||||
@@ -59,13 +59,13 @@ var RepoInvPiutangJS = {
|
||||
});
|
||||
},
|
||||
|
||||
member_select: function(acell){
|
||||
member_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBMember);
|
||||
$('#MemberID').val(acell[0]);
|
||||
$('#Nama_Member').val(acell[1]);
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
data_query(tipe) {
|
||||
if (tipe=="brow-member"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_member',
|
||||
@@ -75,7 +75,7 @@ var RepoInvPiutangJS = {
|
||||
}
|
||||
},
|
||||
|
||||
Member_Comp: function(item){
|
||||
Member_Comp(item) {
|
||||
$('#MemberID').val(item.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user