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,34 +14,34 @@ var DISPConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#butBrow').click(() => this.cab_brow());
|
||||
$('#butUbah').click(() => this.proses_edit());
|
||||
$('#butSimpan').click(() => this.proses_save());
|
||||
this.data_query('form-display');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
cab_brow() {
|
||||
var _isi = new String('<div id="divBrowCab"> </div>');
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, '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-display', 'view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
proses_edit() {
|
||||
this.data_query('form-display', 'edit');
|
||||
this.load_port();
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
proses_save() {
|
||||
this.data_query('form-display', 'save');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=='form-display'){
|
||||
new Request({
|
||||
url: this.PHP + '/form_display',
|
||||
@@ -60,7 +60,7 @@ var DISPConfigJS = {
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
update_event() {
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butBrow').prop('disabled', true);
|
||||
$('#butUbah').prop('disabled', true);
|
||||
@@ -72,7 +72,7 @@ var DISPConfigJS = {
|
||||
}
|
||||
},
|
||||
|
||||
load_port: function(){
|
||||
load_port() {
|
||||
var parent = this;
|
||||
qz.serial.findPorts().then(function(data){
|
||||
var _selport = $('#POLE_PORT').val();
|
||||
|
||||
@@ -14,7 +14,7 @@ var DISPIklanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
this.data_query('detail');
|
||||
$('#Cari_Iklan').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
@@ -28,7 +28,7 @@ var DISPIklanJS = {
|
||||
FoniaJS.setFocus('#Cari_Iklan');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
detail_show(mode, ID) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_iklan',
|
||||
sendParam: ['mode_detail='+mode,'PromoID='+ID],
|
||||
@@ -63,15 +63,15 @@ var DISPIklanJS = {
|
||||
}).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_detail',
|
||||
@@ -81,7 +81,7 @@ var DISPIklanJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
detail_save() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','PromoID','CabID','Tanggal','Info','Aktif','Cari_Iklan'],
|
||||
@@ -92,7 +92,7 @@ var DISPIklanJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=="detail"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -101,7 +101,7 @@ var DISPIklanJS = {
|
||||
}
|
||||
},
|
||||
|
||||
get_picture: function(){
|
||||
get_picture() {
|
||||
new Request({
|
||||
url: this.PHP + '/get_picture',
|
||||
sendParam: ['PromoID'],
|
||||
|
||||
@@ -14,7 +14,7 @@ var DISPPromoJS = {
|
||||
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 DISPPromoJS = {
|
||||
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],
|
||||
@@ -63,15 +63,15 @@ var DISPPromoJS = {
|
||||
}).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_detail',
|
||||
@@ -81,7 +81,7 @@ var DISPPromoJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
detail_save() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','PromoID','Tanggal','Info','Warna','Font','Aktif','Cari_Promo'],
|
||||
@@ -92,7 +92,7 @@ var DISPPromoJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=="detail"){
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -101,7 +101,7 @@ var DISPPromoJS = {
|
||||
}
|
||||
},
|
||||
|
||||
get_picture: function(){
|
||||
get_picture() {
|
||||
new Request({
|
||||
url: this.PHP + '/get_picture',
|
||||
sendParam: ['PromoID'],
|
||||
|
||||
Reference in New Issue
Block a user