From ac137d43f9660e51e35ed3a67e5ca8f339fe8c97 Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Sat, 14 Jan 2023 01:45:02 +0800 Subject: [PATCH] fix dashboard year tahun and fix bug skit tunai dan console.log delete --- .../Controllers/AliranTunaiController.php | 23 +++--- resources/js/Bajet/Senaraibajet.vue | 1 - resources/js/Dashboard/index.vue | 71 +++++++++++++++++++ resources/js/Kelulusan/TableKelulusan.vue | 2 - resources/js/app.js | 19 ++++- resources/js/components/Analisa/Harian.vue | 4 -- resources/js/components/Analisa/Tahunan.vue | 10 +-- .../js/components/Chart/BilanganChart.vue | 6 +- .../js/components/Chart/KeuntunganChart.vue | 3 +- .../js/components/Chart/PembiayaanChart.vue | 3 +- .../js/components/Chart/PenyelesaianChart.vue | 3 +- resources/js/components/Tunai.vue | 1 - resources/js/components/util/Bankmodal.vue | 2 - resources/js/components/util/Modal.vue | 4 +- resources/js/components/util/Notify.vue | 2 - resources/js/components/util/PBmodal.vue | 2 - resources/js/pages/Blacklist.vue | 1 - resources/js/pages/Detailspelanggan.vue | 26 ++++--- resources/js/pages/NotisLelong.vue | 2 - resources/js/pages/NotisLelongFasa2.vue | 2 - resources/js/routes.js | 3 +- resources/views/home.blade.php | 40 +---------- resources/views/layouts/app.blade.php | 2 +- resources/views/layouts/sidebar.blade.php | 6 +- 24 files changed, 138 insertions(+), 100 deletions(-) create mode 100644 resources/js/Dashboard/index.vue diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php index 2270e81..fdf05cc 100644 --- a/app/Http/Controllers/AliranTunaiController.php +++ b/app/Http/Controllers/AliranTunaiController.php @@ -22,8 +22,11 @@ class AliranTunaiController extends Controller $current = Carbon::now(); $current = new Carbon(); - $alirantunai = Http::get($request->hostname . '/admin/GetTunaiByTarikh/' . $request->kodcaw,['kodlaluan' => $request->teller, 'tarikh' => $request->tarikh])->json(); // - // dd($alirantunai); + $alirantunaisebelum = Http::get($request->hostname . '/admin/GetTunaiByTarikhSebelum/' . $request->kodcaw,['kodlaluan' => $request->teller, 'tarikh' => $request->tarikh])->json(); + $alirantunai = Http::get($request->hostname . '/admin/GetTunaiByTarikh/' . $request->kodcaw,['kodlaluan' => $request->teller, 'tarikh' => $request->tarikh])->json(); + + $sebelumbakiakhir = (sizeof($alirantunaisebelum) > 0) ? $alirantunaisebelum['baki'] : 0; + $keluar = $alirantunai['keluar']; $baki = $alirantunai['baki']; $masuk = $alirantunai['masuk']; @@ -135,9 +138,9 @@ class AliranTunaiController extends Controller if(strtoupper($request->teller) === 'LELONG'){ $penebusanbarcodescanned = floatval($lelongan); - $bakisemasa = floatval($bakiawal) + floatval($lelongan) - floatval($totalserahan); + $bakisemasa = floatval($sebelumbakiakhir) + floatval($lelongan) - floatval($totalserahan); }else{ - $bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki); + $bakisemasa = floatval($sebelumbakiakhir) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki); } $errorpendahuluan = false; $errorserahan = false; $errorpenebusan = false; $errorgadaian = false; $errorbaki = false; @@ -161,7 +164,7 @@ class AliranTunaiController extends Controller { return response('sama'); }else{ - $arraykemaskini = ['pendahuluan' => round($totalpendahuluan,2),'serahan' => round($totalserahan,2), 'penebusan' => round($penebusanbarcodescanned,2), 'gadaian' => round($totalgadaibarcodescanned,2), 'bakisemasa' => round($bakisemasa,2),'bakiawal' => round($bakiawal,2)]; + $arraykemaskini = ['pendahuluan' => round($totalpendahuluan,2),'serahan' => round($totalserahan,2), 'penebusan' => round($penebusanbarcodescanned,2), 'gadaian' => round($totalgadaibarcodescanned,2), 'bakisemasa' => round($bakisemasa,2),'bakiawal' => round($sebelumbakiakhir,2)]; return response()->json($arraykemaskini); } } @@ -170,16 +173,8 @@ class AliranTunaiController extends Controller { $auth_user = Auth::user(); - $alirantunai = Http::get($request->hostname . '/admin/GetTunaiByTarikh/' . $request->kodcaw,['kodlaluan' => $request->teller, 'tarikh' => $request->tarikh])->json(); - - $keluar = $alirantunai['keluar']; - $baki = $alirantunai['baki']; - $masuk = $alirantunai['masuk']; - $bakiawal = $alirantunai['bakiawal']; - $pendahuluan = $alirantunai['tambah']; - $serahan = $alirantunai['kurang']; - $updateTunai = Http::post( $request->hostname.'/admin/updateTunaiGTByTarikh/'.$request->kodcaw, [ + 'bakiawal' => $request->bakiawal, 'kodlaluan' => $request->teller, 'tarikh' => $request->tarikh, 'keluar'=> $request->gadaian, diff --git a/resources/js/Bajet/Senaraibajet.vue b/resources/js/Bajet/Senaraibajet.vue index f475a64..4051d02 100644 --- a/resources/js/Bajet/Senaraibajet.vue +++ b/resources/js/Bajet/Senaraibajet.vue @@ -99,7 +99,6 @@ export default { }).then( response => { this.arrayBajet = response.data this.showLoader = false; - console.log(this.arrayBajet) }); } diff --git a/resources/js/Dashboard/index.vue b/resources/js/Dashboard/index.vue new file mode 100644 index 0000000..5b0e0a0 --- /dev/null +++ b/resources/js/Dashboard/index.vue @@ -0,0 +1,71 @@ + + +> \ No newline at end of file diff --git a/resources/js/Kelulusan/TableKelulusan.vue b/resources/js/Kelulusan/TableKelulusan.vue index cb63ced..d5491ea 100644 --- a/resources/js/Kelulusan/TableKelulusan.vue +++ b/resources/js/Kelulusan/TableKelulusan.vue @@ -95,7 +95,6 @@ export default { page: pageNumber } }).then(response => { - console.log(response.data) this.showkelulusan = response.data this.paginate = response.data this.currentPage = pageNumber @@ -104,7 +103,6 @@ export default { }, ApproveFunc: async function (noruj, kcaw, tel, sir) { let boolkatalaluan = 0; - console.log(noruj, kcaw, tel, sir) const { value: katalaluan } = await this.$swal({ diff --git a/resources/js/app.js b/resources/js/app.js index 08a88cb..02ab9f0 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -133,11 +133,13 @@ Vue.prototype.$userroles = document.querySelector("meta[name='user_roles']").get let initial = 'KB2'; let initialhostname = 'http://api.arrahn/'; +let initialtahun = new Date().getFullYear(); const store = new Vuex.Store({ state: { $kodcaw: 'KB2', - $hostname: 'http://api.arrahn/' + $hostname: 'http://api.arrahn/', + $tahun: new Date().getFullYear() }, plugins: [createPersistedState()], mutations: { @@ -147,9 +149,14 @@ const store = new Vuex.Store({ update$hostname: function(state, newHostname) { state.$hostname = newHostname; }, + update$tahun: function(state, newTahun) { + state.$tahun = newTahun; + }, reset (state) { state.$kodcaw = initial; state.$hostname = initialhostname; + state.$tahun = initialtahun; + } } @@ -166,6 +173,11 @@ Vue.mixin({ get: function () { return store.state.$hostname }, + }, + $tahun: { + get: function () { + return store.state.$tahun + }, } }, methods:{ @@ -176,6 +188,9 @@ Vue.mixin({ sethostname: function(newHostname) { return store.commit('update$hostname', newHostname); }, + settahun: function(newTahun) { + return store.commit('update$tahun', newTahun); + }, setLogout: function(){ return store.commit('reset'); } @@ -184,6 +199,8 @@ Vue.mixin({ //Chart +Vue.component('dashboard-component', require('./Dashboard/index.vue').default) + Vue.component('pemb-chart', require('./components/Chart/PembiayaanChart.vue').default) Vue.component('peny-chart', require('./components/Chart/PenyelesaianChart.vue').default) Vue.component('keun-chart', require('./components/Chart/KeuntunganChart.vue').default) diff --git a/resources/js/components/Analisa/Harian.vue b/resources/js/components/Analisa/Harian.vue index 300770a..6d5ec5a 100644 --- a/resources/js/components/Analisa/Harian.vue +++ b/resources/js/components/Analisa/Harian.vue @@ -266,7 +266,6 @@ export default { kodcaw: this.$kodcaw } }).then(response => { - console.log(this.$api1) this.keuntunganharian = formatter.format(response.data[0].upahToday), this.bajetkeuntungan = formatter.format(response.data[0].bajetharian.toFixed(2)), this.percentkeuntungan = response.data[0].percentDiff, @@ -286,7 +285,6 @@ export default { channel.bind('trigger-gadai', ({ cawangan }) => { - console.log(`${cawangan}`); if (this.$kodcaw === cawangan) this.getDataPembiayaan() @@ -297,7 +295,6 @@ export default { channel.bind('trigger-tebus', ({ cawangan }) => { - console.log(`${cawangan}`); if (this.$kodcaw === cawangan) this.getDataPenebusan() @@ -308,7 +305,6 @@ export default { channel.bind('trigger-keuntungan', ({ cawangan }) => { - console.log(`${cawangan}`); if (this.$kodcaw === cawangan) this.getDataKeuntungan() diff --git a/resources/js/components/Analisa/Tahunan.vue b/resources/js/components/Analisa/Tahunan.vue index aab3538..2ffa055 100644 --- a/resources/js/components/Analisa/Tahunan.vue +++ b/resources/js/components/Analisa/Tahunan.vue @@ -82,13 +82,13 @@ export default { this.getDataPembiayaan() this.getDataPenebusan() this.getDataKeuntungan() - console.log('tahunan' + this.$hostname); }, methods: { getDataPembiayaan() { this.axios.get(this.$hostname + '/admin/pembiayaanTahunan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { this.pembiayaanterkumpul = formatter.format(response.data[0].total); @@ -104,7 +104,8 @@ export default { getDataPenebusan(){ this.axios.get(this.$hostname + '/admin/penebusanTahunan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { this.penebusanterkumpul = formatter.format(response.data[0].total); @@ -120,7 +121,8 @@ export default { getDataKeuntungan(){ this.axios.get(this.$hostname + '/admin/keuntunganTahunan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { this.keuntunganterkumpul = formatter.format(response.data[0].total); diff --git a/resources/js/components/Chart/BilanganChart.vue b/resources/js/components/Chart/BilanganChart.vue index 88b9858..e6a88f7 100644 --- a/resources/js/components/Chart/BilanganChart.vue +++ b/resources/js/components/Chart/BilanganChart.vue @@ -136,12 +136,14 @@ export default { this.axios.all([ axios.get(this.$hostname + `/admin/bilangan/gadai`, { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }), axios.get(this.$hostname + `/admin/bilangan/tebus`, { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }) ]) diff --git a/resources/js/components/Chart/KeuntunganChart.vue b/resources/js/components/Chart/KeuntunganChart.vue index 2feee7b..8fa405c 100644 --- a/resources/js/components/Chart/KeuntunganChart.vue +++ b/resources/js/components/Chart/KeuntunganChart.vue @@ -103,7 +103,8 @@ export default { getDatakeuntungan () { this.axios.get(this.$hostname + '/admin/keuntunganBulanan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { diff --git a/resources/js/components/Chart/PembiayaanChart.vue b/resources/js/components/Chart/PembiayaanChart.vue index 567224b..a2523ea 100644 --- a/resources/js/components/Chart/PembiayaanChart.vue +++ b/resources/js/components/Chart/PembiayaanChart.vue @@ -104,7 +104,8 @@ export default { getDataPembiayaan () { this.axios.get(this.$hostname + '/admin/pembiayaanBulanan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { diff --git a/resources/js/components/Chart/PenyelesaianChart.vue b/resources/js/components/Chart/PenyelesaianChart.vue index 0ec40ae..9c83b5a 100644 --- a/resources/js/components/Chart/PenyelesaianChart.vue +++ b/resources/js/components/Chart/PenyelesaianChart.vue @@ -101,7 +101,8 @@ export default { getDataPenebusan(){ this.axios.get(this.$hostname + '/admin/penebusanBulanan', { params: { - kodcaw: this.$kodcaw + kodcaw: this.$kodcaw, + year: this.$tahun } }).then(response => { diff --git a/resources/js/components/Tunai.vue b/resources/js/components/Tunai.vue index ed962f0..962ce63 100644 --- a/resources/js/components/Tunai.vue +++ b/resources/js/components/Tunai.vue @@ -212,7 +212,6 @@ export default { methods: { getItems(){ // $teller = Http::get( config('api.url') .'/api/get/tellerwork/'. $auth_user['cawangan'])->json(); - console.log('kodcaw',this.$kodcaw) return this.axios.get(this.$hostname + '/api/get/tellerwork/' + this.$kodcaw); }, diff --git a/resources/js/components/util/Bankmodal.vue b/resources/js/components/util/Bankmodal.vue index 6e64b52..fd5cfda 100644 --- a/resources/js/components/util/Bankmodal.vue +++ b/resources/js/components/util/Bankmodal.vue @@ -119,11 +119,9 @@ export default { FuncHantar: function () { if (this.submitStatus == 'PENDING') { - console.log(this.submitStatus); event.target.disabled = true; return; } else { - console.log(this.submitStatus); event.target.disabled = false; } diff --git a/resources/js/components/util/Modal.vue b/resources/js/components/util/Modal.vue index 5ef677e..2cedb9f 100644 --- a/resources/js/components/util/Modal.vue +++ b/resources/js/components/util/Modal.vue @@ -163,9 +163,6 @@ export default { pageNumber: 1 } }, - created(){ - console.log(this.kodcaw) - }, methods: { toggleModal: function(){ this.showModal = !this.showModal; @@ -178,6 +175,7 @@ export default { kodcaw: this.kodcaw, teller: this.kodlaluan, tarikh: this.tarikh, + bakiawal: this.bakiawal.replace(/[^0-9.-]+/g,""), gadaian: this.gadaian.replace(/[^0-9.-]+/g,""), penebusan: this.penebusan.replace(/[^0-9.-]+/g,""), bakiakhir: this.bakiakhir.replace(/[^0-9.-]+/g,"") diff --git a/resources/js/components/util/Notify.vue b/resources/js/components/util/Notify.vue index f786977..f342028 100644 --- a/resources/js/components/util/Notify.vue +++ b/resources/js/components/util/Notify.vue @@ -175,7 +175,6 @@ export default { channel.bind('operasi-event', ({ cawangan,khazanah }) => { var el = this.$refs.notification; var count = Number(localStorage.getItem("data-count")) || 0; - console.log(count) localStorage.setItem('data-count',count + 1); el.setAttribute('data-count', count+1); el.classList.remove('notify'); @@ -204,7 +203,6 @@ export default { Clicked:function(data){ var el = this.$refs.notification; var count = Number(localStorage.getItem("data-count")) || 0; - console.log(count) localStorage.setItem('data-count',count + 1); el.setAttribute('data-count', count+1); el.classList.remove('notify'); diff --git a/resources/js/components/util/PBmodal.vue b/resources/js/components/util/PBmodal.vue index d34c06a..411fa35 100644 --- a/resources/js/components/util/PBmodal.vue +++ b/resources/js/components/util/PBmodal.vue @@ -148,11 +148,9 @@ export default { if(this.submitStatus == 'PENDING') { - console.log(this.submitStatus); event.target.disabled = true; return; }else{ - console.log(this.submitStatus); event.target.disabled = false; } diff --git a/resources/js/pages/Blacklist.vue b/resources/js/pages/Blacklist.vue index 41a4abe..195d3b7 100644 --- a/resources/js/pages/Blacklist.vue +++ b/resources/js/pages/Blacklist.vue @@ -131,7 +131,6 @@ export default { } }).then(response => { - console.log(response.data) this.showblacklist = response.data this.paginate = response.data }); diff --git a/resources/js/pages/Detailspelanggan.vue b/resources/js/pages/Detailspelanggan.vue index 2d55b90..46c6f33 100644 --- a/resources/js/pages/Detailspelanggan.vue +++ b/resources/js/pages/Detailspelanggan.vue @@ -147,27 +147,31 @@
- +
- +
- +
-
+
+ +
+ +
-
+
@@ -297,7 +301,7 @@ -
+
@@ -414,7 +418,7 @@ -
+
@@ -620,7 +624,8 @@ export default { sudahtebuspaginate: {}, belumtebuspaginate: {}, lelongpaginate: {}, - search: '' + search: '', + loading:false } }, setup: (props, context) => { @@ -637,7 +642,8 @@ export default { }, watch: { selected: function (val, oldVal) { - this.showsag = false; + this.showsag = true; + this.loading = true; this.getDataSenaraiSAG(this.currentPage); } }, @@ -708,7 +714,6 @@ export default { } }, submit() { - console.log('submit!') this.$v.$touch() if (this.$v.$invalid) { this.$toast.error('Sila isi butiran yang disediakan dengan betul!') @@ -789,6 +794,7 @@ export default { this.lelongpaginate = response.data; } + this.loading = false; this.showsag = true; }); }, diff --git a/resources/js/pages/NotisLelong.vue b/resources/js/pages/NotisLelong.vue index 911eead..d241d97 100644 --- a/resources/js/pages/NotisLelong.vue +++ b/resources/js/pages/NotisLelong.vue @@ -50,12 +50,10 @@ export default { }); }, async PostData(){ - console.log(this.content); let response = await this.axios.put(this.$hostname + '/admin/notislelong/update/' + this.$kodcaw, { content: this.content }); - console.log(response); return response } } diff --git a/resources/js/pages/NotisLelongFasa2.vue b/resources/js/pages/NotisLelongFasa2.vue index 52ac444..241fb48 100644 --- a/resources/js/pages/NotisLelongFasa2.vue +++ b/resources/js/pages/NotisLelongFasa2.vue @@ -20,7 +20,6 @@ export default { }, created() { this.axios.get(this.$hostname + '/api/details/notislelong/' + this.$kodcaw).then(response => { - console.log(response.data) this.content = response.data[0].para3; }); }, @@ -55,7 +54,6 @@ export default { { content: this.content }); - console.log(response); return response } } diff --git a/resources/js/routes.js b/resources/js/routes.js index 6730283..8eac61d 100644 --- a/resources/js/routes.js +++ b/resources/js/routes.js @@ -26,6 +26,7 @@ import Prestasi from './Akaun/Prestasi' import SerahGadai from './Akaun/SerahGadai' import SerahTebus from './Akaun/SerahTebus' import Online from './Akaun/Online' +import Dashboard from './Dashboard/index' @@ -60,7 +61,7 @@ Vue.use(VueRouter) export default new VueRouter({ routes:[ { path: '/online', component: OnlineHome }, - + { path:'/home', component: Dashboard}, { path: '/akaunhome', component: Home }, { path: '/akaunhome/lejeram', component: Lejeram }, { path: '/akaunhome/imbangduga', component: Imbangduga }, diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 874ba8d..967e4dc 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -11,45 +11,7 @@ {{-- @if(Auth::user()->roles == 'operasi')KEMASKINI BAJET@endif --}} - - - -
-
-
-
-

Pembiayaan Bulanan

-
-
-
cawangan }}>
-
-
-
-
-

Penebusan Bulanan

-
-
-
cawangan }}>
-
- -
-
-
-

Keuntungan Bulanan

-
-
-
cawangan }}>
-
-
- - cawangan }}> - - - - cawangan }}> - - - + @include('layouts.footer') diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index bffd61c..9ec98cb 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -165,7 +165,7 @@ @endif - + {{-- --}} @csrf diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 6f49897..daad811 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -319,7 +319,7 @@ -
  • +
  • @@ -348,7 +348,7 @@
    -
    + {{--
  • - + --}}