loading waiting for approval when refresh
This commit is contained in:
committed by
Hafifie PKB
parent
a641b38cc5
commit
8a3598fa24
@@ -65,12 +65,16 @@ class CustomersController extends Controller
|
|||||||
|
|
||||||
$customer_page = ($cawangan_info['version'] == 'v1') ? 'customers.v1.info' : 'customers.v2.info';
|
$customer_page = ($cawangan_info['version'] == 'v1') ? 'customers.v1.info' : 'customers.v2.info';
|
||||||
|
|
||||||
|
$getApprovalError = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/admin/ansuran/getApproval',[
|
||||||
|
'kodcaw' => $auth_user['cawangan'],
|
||||||
|
'teller' => $auth_user['name'],
|
||||||
|
])->json();
|
||||||
|
|
||||||
if($request->tebus_auto_tawarruq_berjaya === 'true'){
|
if($request->tebus_auto_tawarruq_berjaya === 'true'){
|
||||||
$request->session()->flash('activate_tab', 'SAG_baru');
|
$request->session()->flash('activate_tab', 'SAG_baru');
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi','pekerjaan'));
|
return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi','pekerjaan','ugama','getApprovalError'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search(Request $request){
|
public function search(Request $request){
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
@section('content')
|
@section('content')
|
||||||
@include('modal.historytebus')
|
@include('modal.historytebus')
|
||||||
@include('modal.wakil')
|
@include('modal.wakil')
|
||||||
|
@include('errors.alert', ['errorapproval' => $getApprovalError ?? null])
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-12 col-lg-12">
|
<div class="col-md-12 col-lg-12">
|
||||||
@@ -264,7 +265,7 @@
|
|||||||
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
|
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
|
||||||
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
||||||
<button class="btn btn-primary" onclick="histfunc()">Rekod Pembiayaan</button>
|
<button class="btn btn-primary" onclick="histfunc()">Rekod Pembiayaan</button>
|
||||||
{{-- <button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button> --}}
|
<button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -2905,6 +2906,7 @@
|
|||||||
title: 'Telah Disahkan',
|
title: 'Telah Disahkan',
|
||||||
text: `Komen : ${data.komen}`
|
text: `Komen : ${data.komen}`
|
||||||
}).then(function(){
|
}).then(function(){
|
||||||
|
console.log("delete ansuran",tarikh,kodcaw,norujukan,tg_id);
|
||||||
deleteFuncAnsuran(tarikh,kodcaw,norujukan,tg_id);
|
deleteFuncAnsuran(tarikh,kodcaw,norujukan,tg_id);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
@if($errorapproval)
|
||||||
|
<script>
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||||
|
icon: 'info',
|
||||||
|
width: 600,
|
||||||
|
padding: '3em',
|
||||||
|
background: '#fffff',
|
||||||
|
showCancelButton: false,
|
||||||
|
showConfirmButton: false,
|
||||||
|
allowOutsideClick: false,
|
||||||
|
allowEscapeKey: false,
|
||||||
|
allowEnterKey: false
|
||||||
|
})
|
||||||
|
|
||||||
|
getPusherResponse();
|
||||||
|
|
||||||
|
async function getPusherResponse(){
|
||||||
|
let api_url = "<?php echo $api_url ?>";
|
||||||
|
const jsonData = {
|
||||||
|
norujukan: "{{ $errorapproval['norujukan'] }}",
|
||||||
|
kodcaw: "{{ Auth::user()->cawangan }}",
|
||||||
|
};
|
||||||
|
|
||||||
|
const queryString = new URLSearchParams(jsonData).toString();
|
||||||
|
|
||||||
|
let ansuranlatest = await fetch(api_url + '/admin/ansuran/getLatest?' + queryString)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(response => {return response});
|
||||||
|
|
||||||
|
console.log("Ansuran Latest:", ansuranlatest);
|
||||||
|
|
||||||
|
console.log("{{ $errorapproval['norujukan'] }}","{{ $errorapproval['siri'] }}",ansuranlatest['created_at'],ansuranlatest['id']);
|
||||||
|
try{
|
||||||
|
let pusherresponse = await PusherResponse("{{ $errorapproval['norujukan'] }}","{{ $errorapproval['siri'] }}",ansuranlatest['created_at'],ansuranlatest['id']);
|
||||||
|
|
||||||
|
}catch(error){
|
||||||
|
console.error("Error:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
Reference in New Issue
Block a user