fix: perbaikkan update surveyor dan penilai

This commit is contained in:
majid
2025-05-20 14:10:52 +07:00
parent 08b71604ec
commit ade4ffcad4
4 changed files with 35 additions and 14 deletions

View File

@@ -82,7 +82,7 @@ class PenilaiController extends Controller
public function sederhana(Request $request, $id)
{
$documentId = $request->query('documentId');
$documentId = $request->query('dokument');
$jaminanId = $request->query('jaminanId');
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
$basicData = $this->surveyorController->getCommonData();
@@ -148,10 +148,15 @@ class PenilaiController extends Controller
public function standar(Request $request, $id)
{
$documentId = $request->query('documentId');
$documentId = $request->query('dokument');
$jaminanId = $request->query('jaminanId');
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
if ($permohonan->status == 'proses-laporan') {
return redirect()->back()->with('error', 'Masih dalam proses laporan');
}
$basicData = $this->surveyorController->getCommonData();
$noLpSederhana = $this->generateNoLaporan($permohonan, $documentId, 'lpj');
@@ -218,6 +223,11 @@ class PenilaiController extends Controller
$jaminanId = $request->query('jaminanId');
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
if ($permohonan->status == 'proses-laporan') {
return redirect()->back()->with('error', 'Masih dalam proses laporan');
}
$nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'resume');
$inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$noLpresume = $this->generateNoLaporan($permohonan, $documentId, 'resume');
@@ -253,6 +263,9 @@ class PenilaiController extends Controller
$data = $this->getDataPermohonanWithPenilaiAndInspeksi($req['permohonanId'], $req['documentId'], $req['jaminanId']);
$permohonan = $data['permohonan'];
if ($permohonan->status == 'proses-laporan') {
return redirect()->back()->with('error', 'Masih dalam proses laporan');
}
$nomorLaporan = $this->generateNoLaporan($permohonan, $req['documentId'], 'memo');
$inspeksi = Inspeksi::where('permohonan_id', $req['permohonanId'])->where('dokument_id', $req['documentId'])->first();
@@ -388,10 +401,15 @@ class PenilaiController extends Controller
{
$permohonanId = $request->query('permohonanId');
$documentId = $request->query('documentId');
$documentId = $request->query('dokument');
$jaminanId = $request->query('jaminanId');
$provinces = Province::all();
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
if ($permohonan->status == 'proses-laporan') {
return redirect()->back()->with('error', 'Masih dalam proses laporan');
}
$nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'rap');
$basicData = $this->surveyorController->getCommonData();
$inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
@@ -470,6 +488,9 @@ class PenilaiController extends Controller
$jaminanId = $request->query('jaminanId');
$provinces = Province::all();
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
if ($permohonan->status == 'proses-laporan') {
return redirect()->back()->with('error', 'Masih dalam proses laporan');
}
$nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'call-report');
$basicData = $this->surveyorController->getCommonData();
$inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();

View File

@@ -36,7 +36,7 @@
Informasi dan pembanding
</h3>
<div class="card-tools">
<a href="{{ route('penilai.showDataPembanding', ['id' => $permohonan->id]) }}?dokument={{ request()->documentId }}&jenis_jaminan={{ request()->jaminanId }}"
<a href="{{ route('penilai.showDataPembanding', ['id' => $permohonan->id]) }}?dokument={{ request()->dokument }}&jenis_jaminan={{ request()->jaminanId }}"
class="btn btn-primary" data-bs-toggle="modal">
Edit Data Pembanding
</a>
@@ -553,7 +553,7 @@
const urlParams = new URLSearchParams(window.location.search);
const permohonanId = {{ $permohonan->id }};
const documentId = urlParams.get('documentId');
const documentId = urlParams.get('dokument');
const inspeksiId = urlParams.get('inspeksiId');
const requestUrl =

View File

@@ -23,7 +23,7 @@
@include('lpj::assetsku.includenya')
<form id="form-lpj" method="post" class="w-full grid gap-5">
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
<input type="hidden" name="dokument_id" value="{{ request('documentId') }}">
<input type="hidden" name="dokument_id" value="{{ request('dokument') }}">
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi }}">
<input type="hidden" id="lpj-data" value="{{ json_encode($lpjData ?? []) }}" />
@include('lpj::component.form-penilai')
@@ -52,15 +52,15 @@
@endif
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
<a class="btn btn-info"
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ request('documentId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ request('dokument') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
Lampiran Foto dan Dokumen
</a>
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}" class="btn btn-light"
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('dokument'), 'jenis_jaminan_id' => request('jaminanId')]) }}" class="btn btn-light"
>
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
</a>
<a class="btn btn-success"
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('dokument') }}', {{ request('jaminanId') }}, 0)">
<i class="ki-filled ki-printer"></i> Cetak Laporan
</a>
@endif

View File

@@ -493,11 +493,11 @@
if (data.status === 'standar') {
showLoadingSwal('Tunggu ...');
window.location.href =
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
`{{ route('penilai.standar', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`;
} else if (data.status === 'sederhana') {
showLoadingSwal('Tunggu ...');
window.location.href =
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
`{{ route('penilai.sederhana', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`;
}
} else {
if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') {
@@ -556,10 +556,10 @@
if (data.success) {
if (type === 'standar') {
window.location.href =
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
`{{ route('penilai.standar', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`;
} else if (type === 'sederhana') {
window.location.href =
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
`{{ route('penilai.sederhana', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`;
}
}
});
@@ -640,7 +640,7 @@
function rap(permohonanId, documentId, jaminanId) {
showLoadingSwal('Tunggu ...');
window.location.href =
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&dokument=${documentId}&jaminanId=${jaminanId}`;
}