penambahanan otorisari paparan
This commit is contained in:
@@ -14,62 +14,63 @@
|
||||
@include('lpj::component.detail-jaminan', ['backLink' => 'otorisator.' . $dataHeader . '.index'])
|
||||
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Team
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
|
||||
@endphp
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $surveyor->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ checkRegionUserName($surveyor->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penilai->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($penilai->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Team
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
|
||||
@endphp
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $surveyor->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($surveyor->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penilai->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($penilai->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
|
||||
@if($permohonan->approval_so)
|
||||
@if ($permohonan->approval_so)
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
@@ -80,25 +81,28 @@
|
||||
<div class="card-body">
|
||||
<table class="table table-border">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Diperiksa Oleh</td>
|
||||
<td>{{ getUser($permohonan->approval_so)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_so_at ? formatTanggalIndonesia($permohonan->approval_so_at,1) : 'N/A' }}</td>
|
||||
</tr>
|
||||
@if($permohonan->approval_eo!=null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (EO)</td>
|
||||
<td>{{ getUser($permohonan->approval_eo)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_eo_at ? formatTanggalIndonesia($permohonan->approval_eo_at,1) : 'N/A' }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if(in_array($permohonan->nilai_plafond_id,[1,4]) && $permohonan->approval_dd!=null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (DD)</td>
|
||||
<td>{{ getUser($permohonan->approval_dd)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_dd_at ? formatTanggalIndonesia($permohonan->approval_dd_at,1) : 'N/A' }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>Diperiksa Oleh</td>
|
||||
<td>{{ getUser($permohonan->approval_so)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_so_at ? formatTanggalIndonesia($permohonan->approval_so_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (EO)</td>
|
||||
<td>{{ getUser($permohonan->approval_eo)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_eo_at ? formatTanggalIndonesia($permohonan->approval_eo_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if (in_array($permohonan->nilai_plafond_id, [1, 4]) && $permohonan->approval_dd != null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (DD)</td>
|
||||
<td>{{ getUser($permohonan->approval_dd)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $permohonan->approval_dd_at ? formatTanggalIndonesia($permohonan->approval_dd_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -106,150 +110,174 @@
|
||||
@endif
|
||||
<div>
|
||||
<div>
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->debiture->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $value->id;
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->debiture->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $value->id;
|
||||
}
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
@endphp
|
||||
@endphp
|
||||
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{true}}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@endif
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','senior-officer']) && $permohonan->approval_so==null)
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
<button class="btn btn-warning" onclick="revisiLaporan({{ $permohonan->id }})">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i> Revisi
|
||||
</button>
|
||||
@endif
|
||||
@if ($dataHeader == 'paparan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('penilai.paparan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat Data Paparan
|
||||
</a>
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','EO Appraisal']) && $permohonan->approval_so && $permohonan->approval_eo==null)
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $permohonan->approval_so == null)
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@if ($dataHeader != 'paparan')
|
||||
<button class="btn btn-warning" onclick="revisiLaporan({{ $permohonan->id }})">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i> Revisi
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','DD Appraisal']) && $permohonan->approval_eo && $permohonan->approval_dd==null && in_array($permohonan->nilai_plafond_id,[1,4]))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) &&
|
||||
$permohonan->approval_so &&
|
||||
$permohonan->approval_eo == null)
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||
$permohonan->approval_eo &&
|
||||
$permohonan->approval_dd == null &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 4]))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@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}/${dataHeader}`,
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@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}/${dataHeader}`,
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function revisiLaporan(dataId) {
|
||||
const dataHeader = @json($header);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi ${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 || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/revisi/${dataId}/`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil Revisi Laporan', 'success').then(() => {
|
||||
window.location.href = '{{route('otorisator.pelaporan.index')}}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
function revisiLaporan(dataId) {
|
||||
const dataHeader = @json($header);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi ${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 || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/revisi/${dataId}/`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil Revisi Laporan', 'success').then(
|
||||
() => {
|
||||
window.location.href =
|
||||
'{{ route('otorisator.pelaporan.index') }}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user