perbaikan nomor laporan, dan penambahan button revisi laporan di so

This commit is contained in:
majid
2025-01-09 17:01:35 +07:00
parent 9c5c91ae9c
commit e84bce7034
12 changed files with 290 additions and 134 deletions

View File

@@ -16,9 +16,6 @@
<span id="saveButtonText">Save</span>
</button>
@if (Auth::user()->hasAnyRole(['senior-officer']))
<a href="_blank" class="btn btn-warning">
Revisi
</a>
<a class="btn btn-primary"
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
<i class="ki-filled ki-printer"></i> Print

View File

@@ -38,10 +38,10 @@
<label class="form-label max-w-56">Nomor Memo</label>
<div class="flex flex-wrap items-base line w-full">
<input type="text" name="nomor_memo" class="input w-full" placeholder="Masukkan..."
value="{{ $memo->nomor_memo ?? "" }}">
value="{{ $noLpmemo ?? "" }}" @readonly(true)>
</div>
</div>
{{-- 250109828129/ --}}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tanggal</label>
@@ -264,23 +264,20 @@
</div>
</div>
@include('lpj::penilai.components.foto-lampiran')
{{-- @include('lpj::penilai.components.foto-lampiran') --}}
<div class="flex card-footer justify-end gap-5">
<a class="btn btn-success" onclick="saveMemo()">
SAVE
</a>
@if (Auth::user()->hasAnyRole(['senior-officer']))
<a href="_blank" class="btn btn-warning">
Revisi
</a>
<a class="btn btn-primary"
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
<i class="ki-filled ki-printer"></i> Print
</a>
@endif
</div>
</form>
</div>
@endsection

View File

@@ -140,7 +140,7 @@
<tr>
<td style="width: 20%; padding: 2px;">No</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">{{ $memo['nomor_memo'] ?? '' }}</td>
<td style="width: 79%; padding: 2px;">{{ $nomorLaporan ?? '-' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;">Tanggal</td>
@@ -178,33 +178,33 @@
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
</tr>
@if (@isset($dokumen))
@foreach ($dokumen->detail as $details)
<tr>
<td style="width: 20%; padding: 2px;">{{ $details->jenisLegalitasJaminan->name ?? '' }}</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->dokumen_nomor
? [$detail->dokumen_nomor]
: []);
@endphp
@foreach ($dokumen_jaminan as $index => $dokumen)
<div>
@if (!empty($dokumen_nomor))
<span>
{{ $dokumen_nomor[$index] }}</span>
@endif
</div>
<br>
@endforeach
@endif
</td>
</tr>
@endforeach
@if (@isset($dokumen))
@foreach ($dokumen->detail as $details)
<tr>
<td style="width: 20%; padding: 2px;">{{ $details->jenisLegalitasJaminan->name ?? '' }}</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->dokumen_nomor
? [$detail->dokumen_nomor]
: []);
@endphp
@foreach ($dokumen_jaminan as $index => $dokumen)
<div>
@if (!empty($dokumen_nomor))
<span>
{{ $dokumen_nomor[$index] }}</span>
@endif
</div>
<br>
@endforeach
@endif
</td>
</tr>
@endforeach
@endif
@@ -214,13 +214,13 @@
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Tanggal Terbit Sertifikat</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 20%; padding: 2px;">Tanggal Terbit Sertifikat</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;"></td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Surat Ukur No</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 20%; padding: 2px;">Surat Ukur No</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;"></td>
</tr>
<tr>
@@ -249,28 +249,28 @@
<td style="width: 79%; padding: 2px;"> {{ $memo['lokasi']['address'] ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Kelurahan</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 79%; padding: 2px;" >{{ $alamat['village_code'] ?? '' }}</td>
<td style="width: 20%; padding: 2px;">Kelurahan</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">{{ $alamat['village_code'] ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Kecamatan</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 79%; padding: 2px;" >{{ $alamat['district_code'] ?? '' }}</td>
<td style="width: 20%; padding: 2px;">Kecamatan</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">{{ $alamat['district_code'] ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Kota</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 79%; padding: 2px;" > {{ $alamat['city_code'] ?? '' }}</td>
<td style="width: 20%; padding: 2px;">Kota</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;"> {{ $alamat['city_code'] ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;" >Propinsi</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 79%; padding: 2px;" >{{ $alamat['province_code'] ?? '' }}</td>
<td style="width: 20%; padding: 2px;">Propinsi</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">{{ $alamat['province_code'] ?? '' }}</td>
</tr>
<tr>
<td style="width: 20%; padding: 2px;">Titik Kordinat</td>
<td style="width: 1%; padding: 2px;" >:</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">{{ $alamat['province_code'] ?? '' }}</td>
</tr>
</table>
@@ -285,10 +285,10 @@
<tr>
@isset($memo['hasil_survey'])
@foreach ($memo['hasil_survey'] as $key => $item)
<tr>
<td>{{ $key + 1 }} . {{ $item }}</td>
</tr>
@endforeach
<tr>
<td>{{ $key + 1 }} . {{ $item }}</td>
</tr>
@endforeach
@endisset
</tr>
</table>
@@ -301,10 +301,10 @@
<tr>
@isset($memo['kesimpulan_saran'])
@foreach ($memo['kesimpulan_saran'] as $key => $item)
<tr>
<td>{{ $key + 1 }} . {{ $item }}</td>
</tr>
@endforeach
<tr>
<td>{{ $key + 1 }} . {{ $item }}</td>
</tr>
@endforeach
@endisset
</tr>
</table>
@@ -314,7 +314,7 @@
<td>Demikian Kami Sampaikan, aatas perhatiannya kami ucapkan terimakasih</td>
</tr>
<tr>
<table style="width: 100%; text-align: center;" >
<table style="width: 100%; text-align: center;">
<tr>
<td style="height: 50px"></td>
@@ -322,6 +322,33 @@
<td style="height: 50px"></td>
<td style="height: 50px"></td>
</tr>
@php
$senior_officer = null;
if ($permohonan->debiture && $permohonan->debiture->documents) {
foreach ($permohonan->debiture->documents as $dokumen) {
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
$teams = $permohonan->region->teams;
if ($teams) {
foreach ($teams as $team) {
$team_users = $team->teamsUsers;
// print_r($team_users);
if ($team_users) {
foreach ($team_users as $team_user) {
$user = $team_user->user;
if ($user && $user->hasRole('senior-officer')) {
$senior_officer = $user;
break 3;
}
}
}
}
}
}
}
use Modules\Usermanagement\Models\User;
@endphp
<tr>
<td>{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
Appraisal
@@ -332,7 +359,7 @@
<td> {{ $senior_officer->name ?? '' }}</br>
EO Appraisal
</td>
<td> {{ $senior_officer->name ?? '' }}</br>
<td> {{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
Deputy Director
</td>
</tr>
@@ -360,7 +387,6 @@
<script>
const data = @json($memo);
console.log(data);
</script>
</body>

View File

@@ -260,7 +260,7 @@
<h4 style="text-align: center; text-transform: uppercase; font-size: 14px;">LAPORAN PENILAIAN ATAS
{{ $data }}</h4>
<p style="text-align: center; font-size:12px;">NO:
{{ $permohonan->debiture->branch->code ?? '' }}/{{ $nomorLaporan }}/LPJ/{{ $permohonan->nomor_registrasi }}/{{ onRomawi(date('m')) }}/{{ date('Y') }}
{{ $nomorLaporan }}
</p>
</div>

View File

@@ -24,9 +24,6 @@
</div>
</button>
@if (Auth::user()->hasAnyRole(['senior-officer']))
<a href="_blank" class="btn btn-warning">
Revisi
</a>
<a class="btn btn-primary"
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
<i class="ki-filled ki-printer"></i> Print

View File

@@ -338,9 +338,6 @@
<div class="flex card-footer justify-end gap-5">
<button type="button" class="btn btn-success" onclick="saveResume()">Save</button>
@if (Auth::user()->hasAnyRole(['senior-officer']))
<a href="_blank" class="btn btn-warning">
Revisi
</a>
<a class="btn btn-primary"
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
<i class="ki-filled ki-printer"></i> Print

View File

@@ -184,6 +184,7 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
<p class="flex w-full text-gray-600 font-medium text-sm">
{{ getNomorLaporan($permohonan->id, $dokumen->id) ?? '-' }}
</p>
</div>
</div>

View File

@@ -132,6 +132,9 @@
<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(Auth::user()->hasAnyRole(['administrator','EO Appraisal']) && $permohonan->approval_so && $permohonan->approval_eo==null)
@@ -200,5 +203,53 @@
}
});
}
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