Merge branch 'staging' into feature/senior-officer

This commit is contained in:
majid
2024-12-12 21:26:37 +07:00
7 changed files with 119 additions and 23 deletions

View File

@@ -250,7 +250,7 @@
Pengalaman (Jenis Aset)
</label>
<div class="flex flex-wrap items-baseline w-full gap-1">
@if (isset($kjpp->jenis_aset_id))
@if (isset($kjpp->jenis_aset_id) && !empty(json_decode($kjpp->jenis_aset_id, true)))
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
@php
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
@@ -263,8 +263,8 @@
@endif
@endforeach
@else
<span class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">
No asset type selected.
<span class="flex flex-row space-x-4 text-gray-600 font-medium text-sm dark-mode:text-gray-600">
-
</span>
@endif
</div>

View File

@@ -186,9 +186,9 @@
let actionHtml = `<div class="flex flex-nowrap justify-center gap-1.5">`;
if (data && data.penilaian && data.penilaian.waktu_penilaian !== null && data.status !==
'done') {
'done' && data.penilaian.authorized_status==null) {
actionHtml += `
<a class="btn btn-sm btn-outline btn-primary" href="surveyor/storeAproved/${data.penilaian.id}">
<a class="btn btn-sm btn-outline btn-primary" href="javascript:void(0)" onclick="surveyorApproveKunjungan(${data.penilaian.id},'${data.nomor_registrasi}')" title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}">
<i class="ki-filled ki-calendar-edit"></i>
</a>
`;
@@ -225,5 +225,58 @@
});
</script>
<script type="text/javascript">
function surveyorApproveKunjungan(id, noReg) {
Swal.fire({
title: ' ',
text: "Yakin akan Menyetujui Jadwal Kunjungan "+noReg+"?",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes'
}).then((result) => {
if (result.isConfirmed) {
//define variable
// $id ==> penilaian.id
let token = "{{ csrf_token() }}";
let useURL = "{{ URL::to('/surveyor/storeAproved') }}"+"/"+id;
var input_data = new Object();
input_data._token = token;
input_data.id = id;
input_data.noReg =noReg;
$.ajax({
url: useURL,
type: "PUT",
cache: false,
data: input_data,
dataType: "json",
success: function(response) {
console.log(response);
if('success' == response.status)
{
swal.fire('Sukses Menyetujui!', response.message, 'success').then(() => {
location.reload(true);
});
}
else
{
Swal.fire('Error!', response.message, 'error');
}
},
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
// console.log(errors);
console.log(response);
}
});
}
})
}
</script>
@endpush