fix(penilai): perbaikkan keterangan freeze dan ubah name kjjp ke kjpp, handle key foto memo
This commit is contained in:
@@ -295,9 +295,11 @@
|
||||
</table>
|
||||
</main>
|
||||
<div class="page-break"></div>
|
||||
@if (isset($memo['foto']))
|
||||
|
||||
<table width="100%" border="0" style="align-content: center; text-align: center; margin-bottom: 20px">
|
||||
@foreach ($memo['foto'] as $item)
|
||||
@php
|
||||
@php
|
||||
$cleanedPath = str_replace('/storage/', '', $item);
|
||||
$imagePath = storage_path('app/public/' . $cleanedPath);
|
||||
@endphp
|
||||
@@ -307,7 +309,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
@endif
|
||||
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan' || data.status == 'revisi-laporan' || data.status === 'done' || data.status === 'revisi-paparan') {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan' || data.status == 'revisi-laporan' || data.status === 'done' || data.status === 'revisi-paparan' || data.status === 'reject-freeze' || data.status === 'freeze' || data.status === 'request-freeze') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
@@ -298,7 +298,7 @@ Swal.fire({
|
||||
url: `/surveyor/storeFreeze/${permohonanId}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
keterangan: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
},
|
||||
},
|
||||
alasan: {
|
||||
keterangan: {
|
||||
title: 'Alasan',
|
||||
},
|
||||
request: {
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
{{ $authorization->alasan ?? ''}}
|
||||
{{ $authorization->keterangan ?? ''}}
|
||||
<table class="table table-border">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -87,7 +87,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alasan</td>
|
||||
<td>{{ $authorization->alasan }}</td>
|
||||
<td>{{ $authorization->keterangan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tanggal Permohonan</td>
|
||||
@@ -163,21 +163,21 @@
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','senior-officer']) && $authorization->approve_so==null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'SO')" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','EO Appraisal']) && $authorization->approve_so && $authorization->approve_eo==null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'EO')" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd==null && in_array($permohonan->nilai_plafond_id,[1,4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
@if(Auth::user()->hasAnyRole(['administrator','DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd==null && in_array($permohonan->nilai_plafond_id,[1, 4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'DD')" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@@ -188,52 +188,149 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
function otorisatorData(dataId) {
|
||||
const dataHeader = @json($header);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/otorisator/${dataId}/SLA`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil diotorisasi. Menunggu Approval EO dan atau DD', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<script>
|
||||
const handleRejection = (dataId,dataHeader='') => {
|
||||
Swal.fire({
|
||||
title: 'Masukkan alasan penolakan:',
|
||||
input: 'textarea',
|
||||
inputPlaceholder: 'Tuliskan alasan...',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#f39c12',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Kirim',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: (alasan) => {
|
||||
if (!alasan) {
|
||||
Swal.showValidationMessage('Alasan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
return alasan;
|
||||
}
|
||||
}).then((rejectResult) => {
|
||||
if (rejectResult.isConfirmed) {
|
||||
handleAjaxRequest(
|
||||
`/otorisator/revisi-laporan/${dataId}`, {
|
||||
keterangan: rejectResult.value,
|
||||
dataHeader: dataHeader
|
||||
},
|
||||
'Data berhasil ditolak.',
|
||||
'Terjadi kesalahan saat melakukan penolakan.'
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const showSwalConfirmation = (
|
||||
title, text, html, confirmText, denyText, cancelText, preConfirm, icon = 'question'
|
||||
) => {
|
||||
return Swal.fire({
|
||||
title: title,
|
||||
text: text,
|
||||
html: html,
|
||||
icon: icon,
|
||||
focusConfirm: false,
|
||||
preConfirm: preConfirm,
|
||||
showCancelButton: true,
|
||||
showDenyButton: !!denyText,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
denyButtonColor: '#f39c12',
|
||||
confirmButtonText: confirmText,
|
||||
denyButtonText: denyText,
|
||||
cancelButtonText: cancelText,
|
||||
});
|
||||
};
|
||||
|
||||
const handleAjaxRequest = (url, data, successMessage, errorMessage) => {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: () => {
|
||||
Swal.fire('Berhasil!', successMessage, 'success').then(() => {
|
||||
const dataHeader = @json($header);
|
||||
const redirectUrl = `/otorisator/sla`;
|
||||
window.location.href = redirectUrl;
|
||||
});
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', errorMessage, 'error');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function otorisatorData(dataId, role = '') {
|
||||
const dataHeader = @json($header);
|
||||
const isPaparanSO = dataHeader === 'SLA' && role === 'SO';
|
||||
|
||||
const swalHtml = isPaparanSO ? `
|
||||
<div class="text-left space-y-4">
|
||||
<p class="text-gray-700 text-center">Untuk melakukan otorisasi ${dataHeader}!</p>
|
||||
<div>
|
||||
<label for="swal-keterangan" class="block text-sm font-medium text-gray-700 mb-1">Keterangan</label>
|
||||
<input id="swal-keterangan" class="input" placeholder="Masukkan Keterangan">
|
||||
</div>
|
||||
<div>
|
||||
<label for="swal-tanggal-paparan" class="block text-sm font-medium text-gray-700 mb-1">Tanggal Paparan</label>
|
||||
<input id="swal-tanggal-paparan" class="input" type="date" placeholder="Tanggal paparan">
|
||||
</div>
|
||||
</div>` : '';
|
||||
|
||||
showSwalConfirmation(
|
||||
'Apakah Anda yakin?',
|
||||
`Untuk melakukan otorisasi ${dataHeader}!`,
|
||||
swalHtml,
|
||||
'Ya, Lanjutkan!',
|
||||
'Tolak',
|
||||
'Batal',
|
||||
() => {
|
||||
if (isPaparanSO) {
|
||||
const message = document.getElementById('swal-keterangan')?.value;
|
||||
const tanggalPaparan = document.getElementById('swal-tanggal-paparan').value;
|
||||
|
||||
if (!message || !tanggalPaparan) {
|
||||
Swal.showValidationMessage('Keterangan dan Tanggal Paparan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
message,
|
||||
tanggalPaparan
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
message: 'Ya, lanjutkan.'
|
||||
};
|
||||
}
|
||||
},
|
||||
'question'
|
||||
).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const requestData = isPaparanSO ? {
|
||||
keterangan: result.value.message,
|
||||
tanggalPaparan: result.value.tanggalPaparan
|
||||
} : {
|
||||
keterangan: result.value.message
|
||||
};
|
||||
|
||||
handleAjaxRequest(
|
||||
`/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
requestData,
|
||||
'Data berhasil diotorisasi.',
|
||||
'Terjadi kesalahan saat melakukan otorisasi.'
|
||||
);
|
||||
} else if (result.isDenied) {
|
||||
handleRejection(dataId,dataHeader);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex items-baseline justify-between flex-wrap lg:flex-nowrap">
|
||||
@foreach (['penilai', 'cabang', 'debitur', 'kjjp'] as $type)
|
||||
@foreach (['penilai', 'cabang', 'debitur', 'kjpp'] as $type)
|
||||
@include('lpj::component.signature-pad', ['type' => $type])
|
||||
@endforeach
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
console.log(datas);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const signaturePads = {};
|
||||
const types = ['penilai', 'cabang', 'debitur', 'kjjp'];
|
||||
const types = ['penilai', 'cabang', 'debitur', 'kjpp'];
|
||||
|
||||
// Initialize all signature pads
|
||||
types.forEach(type => initSignaturePad(type));
|
||||
|
||||
@@ -574,10 +574,10 @@
|
||||
@endif
|
||||
|
||||
<!-- K.J.P.P -->
|
||||
@if (isset($forminspeksi['signature']['kjjp']))
|
||||
@if (isset($forminspeksi['signature']['kjpp']))
|
||||
<td style="width: 100px;">
|
||||
<img style="width: 100px;"
|
||||
src="{{ $forminspeksi['signature']['kjjp']['image'] }}" alt="KJPP">
|
||||
src="{{ $forminspeksi['signature']['kjpp']['image'] }}" alt="KJPP">
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@@ -605,9 +605,9 @@
|
||||
<span>{{ ucwords(strtolower('DEBITUR/PERWAKILAN')) }}</span>
|
||||
</td>
|
||||
@endif
|
||||
@if (isset($forminspeksi['signature']['kjjp']['name']))
|
||||
@if (isset($forminspeksi['signature']['kjpp']['name']))
|
||||
<td style=" text-align: center">
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['kjjp']['name'])) }}</span>
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['kjpp']['name'])) }}</span>
|
||||
<br />
|
||||
<span>{{ strtoupper('K.J.P.P') }}</span>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user