From 64b974dec1f699c36505fd8849cbabf638f4d580 Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Thu, 28 Jul 2022 12:45:42 +0800 Subject: [PATCH] fix wtd --- resources/js/WTD/Rekod.vue | 6 +-- resources/js/WTD/SelectWTD.vue | 6 +-- resources/js/WTD/SenaraiBakiLelong.vue | 60 +++++++++-------------- resources/js/WTD/wtd.vue | 2 +- resources/views/layouts/sidebar.blade.php | 4 +- 5 files changed, 30 insertions(+), 48 deletions(-) diff --git a/resources/js/WTD/Rekod.vue b/resources/js/WTD/Rekod.vue index d1653f9..9601da7 100644 --- a/resources/js/WTD/Rekod.vue +++ b/resources/js/WTD/Rekod.vue @@ -24,7 +24,7 @@ const formatter = new Intl.NumberFormat('en-US', { export default { data() { return { - cawangan: 'KB2', + cawangan: '', serahbakiarray: {}, } }, @@ -34,13 +34,11 @@ export default { } }, mounted() { - this.axios.get(this.$hostname + '/admin/wtd/rekod/', { params: { - kodcaw: this.cawangan, + kodcaw: this.$kodcaw, } }).then(response => { - // console.log(response.data); this.serahbakiarray = response.data; }) } diff --git a/resources/js/WTD/SelectWTD.vue b/resources/js/WTD/SelectWTD.vue index c7c48ea..1fb3b8c 100644 --- a/resources/js/WTD/SelectWTD.vue +++ b/resources/js/WTD/SelectWTD.vue @@ -73,7 +73,7 @@ export default { arraybakilelong: [], allSelected: false, boolblocksag: false, - cawangan: 'KB2', + cawangan: '', batchno: 0, aktif: 0 } @@ -86,7 +86,7 @@ export default { this.axios.get(this.$hostname + '/admin/wtd/rekod/' + this.batchno, { params: { - kodcaw: this.cawangan, + kodcaw: this.$kodcaw, } }).then(response => { this.arraybakilelong = response.data; @@ -95,7 +95,7 @@ export default { methods: { proseswtd: function () { this.axios.post(this.$hostname + '/admin/wtd/process', { - kodcaw: this.cawangan, + kodcaw: this.$kodcaw, batch: this.batchno }).then(response => { diff --git a/resources/js/WTD/SenaraiBakiLelong.vue b/resources/js/WTD/SenaraiBakiLelong.vue index f6aa77c..842bb2f 100644 --- a/resources/js/WTD/SenaraiBakiLelong.vue +++ b/resources/js/WTD/SenaraiBakiLelong.vue @@ -91,7 +91,7 @@ export default { selectedNorujukan: [], allSelected: false, boolblocksag: false, - cawangan: 'KB2', + cawangan: '', batchno: 0, blockseterusnya: false, } @@ -142,7 +142,17 @@ export default { this.allSelected = false; }, async blockwtd() { - let cawangan = 'KB2'; + + if(this.blockseterusnya === true) + { + this.$swal({ + icon: 'warning', + title: 'Amaran', + text: 'Surat sudah Di Block!', + allowOutsideClick: false + }) + } + let cawangan = this.$kodcaw; let ref = this; await this.$swal({ title: 'Block Surat Akuan Gadaian (SAG)?', @@ -171,6 +181,7 @@ export default { ) this.boolblocksag = true; + this.blockseterusnya = true; } }); @@ -179,18 +190,18 @@ export default { }, async printwtd() { - let cawangan = 'KB2'; + let cawangan = this.$kodcaw; let ref = this; if (this.selectedNorujukan.length > 0) { await this.$swal({ icon: 'info', title: 'Cetak WTD', - html: "Sila tekan Cetak untuk mencetak senarai SAG yang ingin dituntut,Sila tekan Ya untuk block SAG!", + html: "Sila tekan Ya untuk block SAG, Sila tekan Tidak untuk membatal urusan!", // html:"", showCloseButton: true, showCancelButton: true, - showDenyButton: true, + // showDenyButton: true, // focusConfirm: false, confirmButtonText: 'Ya', cancelButtonText: 'Tidak', @@ -199,37 +210,9 @@ export default { allowOutsideClick: false, }).then((result) => { if (result.isConfirmed) { - this.blockwtd(); - } else if (result.isDenied) { - - this.$swal({ - icon: 'info', - title: 'Pilihan Cetakan', - html: "Sila tekan PDF untuk pilihan dalam bentuk PDF,Sila tekan Excel untuk pilihan dalam bentuk Excel!", - showCloseButton: true, - showCancelButton: false, - showDenyButton: true, - confirmButtonText: 'Excel', - denyButtonText: 'PDF', - confirmButtonColor: '#f39c12', - denyButtonColor: '#f39c12', - allowOutsideClick: false, - }).then((result) => { - if (result.isConfirmed) { - - this.cetaksenarai(); - event.preventDefault(); - return false; - - } else if (result.isDenied) { - this.cetakpdf(); - event.preventDefault(); - return false; - } - }); - } - + blockseterusnya = true; + } }) } else { @@ -242,8 +225,9 @@ export default { }, proseswtd: function () { + let cawangan = this.$kodcaw; this.axios.post(this.$hostname + '/admin/wtd/process', { - kodcaw: this.cawangan, + kodcaw: cawangan, batch: this.batchno }).then(response => { @@ -263,7 +247,7 @@ export default { if (this.selectedNorujukan.length > 0) { let urldirect = window.route('wtd.cetak'); let noruj = JSON.stringify(this.selectedNorujukan); - window.open(urldirect + '?cawangan=' + this.cawangan + '&&norujukan=' + noruj + '&&jenis=excel' + '&&mula=' + this.extensionbulan(this.$props.bulanmula) + '&&hingga=' + this.extensionbulan(this.$props.bulanhingga), '_blank'); + window.open(urldirect + '?cawangan=' + cawangan + '&&norujukan=' + noruj + '&&jenis=excel' + '&&mula=' + this.extensionbulan(this.$props.bulanmula) + '&&hingga=' + this.extensionbulan(this.$props.bulanhingga), '_blank'); } else { this.$swal( 'Amaran!', @@ -277,7 +261,7 @@ export default { if (this.selectedNorujukan.length > 0) { let urldirect = window.route('wtd.cetak'); let noruj = JSON.stringify(this.selectedNorujukan); - window.open(urldirect + '?cawangan=' + this.cawangan + '&&norujukan=' + noruj + '&&jenis=pdf' + '&&mula=' + this.extensionbulan(this.$props.bulanmula) + '&&hingga=' + this.extensionbulan(this.$props.bulanhingga), '_blank'); + window.open(urldirect + '?cawangan=' + cawangan + '&&norujukan=' + noruj + '&&jenis=pdf' + '&&mula=' + this.extensionbulan(this.$props.bulanmula) + '&&hingga=' + this.extensionbulan(this.$props.bulanhingga), '_blank'); } else { this.$swal( 'Amaran!', diff --git a/resources/js/WTD/wtd.vue b/resources/js/WTD/wtd.vue index b723fa0..b57c800 100644 --- a/resources/js/WTD/wtd.vue +++ b/resources/js/WTD/wtd.vue @@ -60,7 +60,7 @@ export default { }, methods: { async generatebakilelong () { - let cawangan = 'KB2'; + let cawangan = this.$kodcaw; this.loadbakilelong = 'process'; diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index cb0fcb8..1fa7046 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -159,7 +159,7 @@ - {{-- +
  • @@ -168,7 +168,7 @@ WTD
  • -
    --}} +