fix(penilai): perbaikkan data double di table penilai -> hapus field inspeksi id dan perbaikkan format tanggal
This commit is contained in:
@@ -19,11 +19,16 @@ use Modules\Location\Models\Village;
|
||||
function formatTanggalIndonesia($date, $time = false)
|
||||
{
|
||||
Carbon::setLocale('id');
|
||||
$waktu = Carbon::parse($date);
|
||||
if (!$time) {
|
||||
return $waktu->translatedFormat('d F Y');
|
||||
try {
|
||||
$waktu = Carbon::parse($date);
|
||||
if (!$time) {
|
||||
return $waktu->translatedFormat('d F Y');
|
||||
}
|
||||
return $waktu->translatedFormat('d F Y') . ' pukul ' . $waktu->format('H.i') . ' WIB';
|
||||
} catch (\Throwable $e) {
|
||||
return $date;
|
||||
}
|
||||
return $waktu->translatedFormat('d F Y') . ' pukul ' . $waktu->format('H.i') . ' WIB';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$documentId = $request->query('documentId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
$provinces = Province::all();
|
||||
@@ -96,7 +95,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $id,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'sederhana',
|
||||
@@ -152,7 +150,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$documentId = $request->query('documentId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
@@ -164,7 +161,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $id,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'standar',
|
||||
@@ -219,7 +215,6 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -230,7 +225,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'resume',
|
||||
@@ -269,7 +263,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $req['permohonanId'],
|
||||
'dokument_id' => $req['documentId'],
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'memo',
|
||||
@@ -348,7 +341,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->dokument_id,
|
||||
'inspeksi_id' => $request->inspeksi_id,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -377,7 +369,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -398,7 +389,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$provinces = Province::all();
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -409,7 +399,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'rap',
|
||||
@@ -478,7 +467,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$provinces = Province::all();
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -489,7 +477,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'call-report',
|
||||
@@ -721,7 +708,6 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'kertas_kerja' => 'required|file|mimes:pdf',
|
||||
]);
|
||||
|
||||
@@ -734,7 +720,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'kertas_kerja' => $filePath,
|
||||
@@ -761,11 +746,9 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
$statusLpj = Penilai::where('permohonan_id', $permohonanId)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksiId)
|
||||
->first();
|
||||
|
||||
return response()->json(['status' => $statusLpj ? $statusLpj->type : null]);
|
||||
@@ -778,8 +761,7 @@ class PenilaiController extends Controller
|
||||
Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->document_id,
|
||||
'inspeksi_id' => $request->inspeksi_id,
|
||||
'dokument_id' => $request->document_i
|
||||
],
|
||||
[
|
||||
'type' => $request->type,
|
||||
@@ -887,7 +869,7 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
|
||||
'resume' => 'required|array',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
@@ -901,7 +883,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
|
||||
],
|
||||
[
|
||||
'resume' => json_encode($validatedData['resume']),
|
||||
@@ -970,7 +952,6 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'memo' => 'required',
|
||||
]);
|
||||
|
||||
@@ -980,7 +961,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
|
||||
],
|
||||
[
|
||||
'memo' => json_encode($memoData),
|
||||
@@ -1075,7 +1056,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'lpj' => json_encode($data),
|
||||
@@ -1129,7 +1110,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'rap' => json_encode($data),
|
||||
@@ -1160,7 +1141,6 @@ class PenilaiController extends Controller
|
||||
$validated = $request->validate([
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
'data' => 'required',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
@@ -1175,7 +1155,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validated['permohonan_id'],
|
||||
'dokument_id' => $validated['dokument_id'],
|
||||
'inspeksi_id' => $validated['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'call_report' => json_encode($validated['data']),
|
||||
@@ -1389,7 +1368,6 @@ class PenilaiController extends Controller
|
||||
'permohonanId' => $request->query('permohonanId'),
|
||||
'documentId' => $request->query('documentId'),
|
||||
'jaminanId' => $request->query('jaminanId'),
|
||||
'inspeksiId' => $request->query('inspeksiId')
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1397,12 +1375,10 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
// Ambil data berdasarkan ID
|
||||
$statusLpj = Penilai::where('permohonan_id', $permohonanId)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksiId)
|
||||
->first();
|
||||
|
||||
// Jika data tidak ditemukan, kembalikan status null
|
||||
|
||||
@@ -786,7 +786,6 @@ class PenilaianController extends Controller
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $id)->where('dokument_id', $documentId)->first();
|
||||
$lpj = Penilai::where('permohonan_id', $id)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksi->id)
|
||||
->first();
|
||||
$penilai = $lpj;
|
||||
|
||||
@@ -879,7 +878,7 @@ class PenilaianController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'lpj' => json_encode($data),
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('penilai', function (Blueprint $table) {
|
||||
$table->dropForeign(['inspeksi_id']);
|
||||
$table->dropColumn('inspeksi_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('penilai', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('inspeksi_id')->nullable();
|
||||
$table->foreign('inspeksi_id')->references('id')->on('inspeksi')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -16,7 +16,7 @@
|
||||
@endphp
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <sup>m2</sup></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
Lampiran Foto dan Dokument
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
@@ -520,7 +520,7 @@
|
||||
<i class="ki-filled ki-printer"></i>Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-primary"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}',{{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -589,7 +589,6 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
@@ -609,7 +608,7 @@
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&inspeksi_id=${inspeksiId}&dokument_id=${documentId}`;
|
||||
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&dokument_id=${documentId}`;
|
||||
|
||||
|
||||
const jsonData = formatJson(formElement);
|
||||
@@ -619,7 +618,7 @@
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
|
||||
data: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
@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') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ request('documentId') }}&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"
|
||||
@@ -60,7 +60,7 @@
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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')]) }}"
|
||||
@@ -330,7 +330,7 @@
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -440,13 +440,11 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = urlParams.get('permohonanId');
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
// Create a new FormData object to send both JSON and files
|
||||
const sendFormData = new FormData();
|
||||
sendFormData.append('permohonan_id', permohonanId);
|
||||
sendFormData.append('document_id', documentId);
|
||||
sendFormData.append('inspeksi_id', inspeksiId);
|
||||
sendFormData.append('memo', JSON.stringify(jsonData));
|
||||
|
||||
// Append all files from Dropzone
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
@@ -730,6 +731,10 @@
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
$labelNilai['bangunan'] = 'Luas Unit';
|
||||
unset($labelNilai['tanah']);
|
||||
}
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
$dokument = null;
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
$dokument = $dokumen;
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
@@ -269,10 +270,10 @@
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
|
||||
// if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
// $labelNilai['bangunan'] = 'Luas Unit';
|
||||
// unset($labelNilai['tanah']);
|
||||
// }
|
||||
if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
$labelNilai['bangunan'] = 'Luas Unit';
|
||||
unset($labelNilai['tanah']);
|
||||
}
|
||||
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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"
|
||||
@@ -85,7 +85,7 @@
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -228,9 +228,9 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeRap') }}?permohonanId=${permohonanId}&inspeksiId=${inspeksiId}&documentId=${documentId}`;
|
||||
`{{ route('penilai.storeRap') }}?permohonanId=${permohonanId}&documentId=${documentId}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
|
||||
@@ -431,7 +431,7 @@
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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')]) }}"
|
||||
@@ -439,7 +439,7 @@
|
||||
<i class="ki-filled ki-printer"></i>Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -551,7 +551,6 @@
|
||||
const urlParams = new URLSearchParams(window.location.search); // Mengambil query parameters dari URL
|
||||
const permohonanId = urlParams.get('permohonanId');
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
@@ -580,7 +579,6 @@
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
resume: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
|
||||
@@ -211,10 +211,6 @@
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
@@ -224,7 +220,7 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full card-footer mt-2 ">
|
||||
<div class="flex gap-5">
|
||||
<a class="btn btn-primary"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
|
||||
@@ -233,7 +229,7 @@
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-primary"
|
||||
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $inspeksiId }}, {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $dokumen->jenis_jaminan_id }})">
|
||||
Paparan
|
||||
</a>
|
||||
|
||||
@@ -248,7 +244,7 @@
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-message-programming">
|
||||
</i>
|
||||
@@ -264,7 +260,7 @@
|
||||
{{-- existing di --}}
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge">
|
||||
</i>
|
||||
@@ -278,7 +274,7 @@
|
||||
@if ($permohonan->status_bayar === 'belum_bayar')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -294,7 +290,7 @@
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2"></i>
|
||||
</span>
|
||||
@@ -304,7 +300,7 @@
|
||||
@endif
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -372,13 +368,13 @@
|
||||
</a>
|
||||
|
||||
<a class="btn btn-outline btn-info "
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
Lihat Laporan
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i>
|
||||
Cetak Laporan
|
||||
</a>
|
||||
@@ -420,7 +416,7 @@
|
||||
<div class="modal-body grid gap-5">
|
||||
@php
|
||||
$jenisJaminanId = null;
|
||||
$inspeksiId = null;
|
||||
|
||||
$documentId = null;
|
||||
$firstDocument = $permohonan->documents->first(); // Ambil dokumen pertama
|
||||
|
||||
@@ -428,9 +424,7 @@
|
||||
$documentId = $firstDocument->id;
|
||||
|
||||
// Ambil ID inspeksi pertama (jika ada)
|
||||
if ($firstDocument->inspeksi->isNotEmpty()) {
|
||||
$inspeksiId = $firstDocument->inspeksi->first()->id;
|
||||
}
|
||||
|
||||
|
||||
// Ambil jenis jaminan jika ada
|
||||
if ($firstDocument->jenisjaminan) {
|
||||
@@ -438,7 +432,7 @@
|
||||
}
|
||||
} else {
|
||||
$documentId = 'Tidak ada dokumen';
|
||||
$inspeksiId = 'Tidak ada inspeksi';
|
||||
|
||||
$jenisJaminanId = 'Tidak ada jenis jaminan';
|
||||
}
|
||||
|
||||
@@ -449,7 +443,7 @@
|
||||
<div class="flex justify-center items-center gap-2">
|
||||
<input type="file" id="kertas_kerja" class="file-input">
|
||||
<button type="button" class="btn btn-outline btn-success"
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $inspeksiId }}', '{{ $jenisJaminanId }}')">Upload
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $jenisJaminanId }}')">Upload
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -472,7 +466,7 @@
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
<script>
|
||||
function seletSederhanaStandart(permohonanId, documentId, inspeksiId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
function seletSederhanaStandart(permohonanId, documentId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
if (statusBayar === 'belum_bayar') {
|
||||
Swal.fire({
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
@@ -481,12 +475,12 @@
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
resume(permohonanId, documentId, inspeksiId, jaminanId)
|
||||
resume(permohonanId, documentId, jaminanId)
|
||||
});
|
||||
|
||||
} else {
|
||||
fetch(
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
@@ -495,11 +489,11 @@
|
||||
if (data.status === 'standar') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
} else if (data.status === 'sederhana') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
} else {
|
||||
if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') {
|
||||
@@ -510,7 +504,7 @@
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana', jaminanId);
|
||||
saveStatusLpj(permohonanId, documentId, 'sederhana', jaminanId);
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
@@ -525,10 +519,10 @@
|
||||
denyButtonColor: '#d33',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standar',
|
||||
saveStatusLpj(permohonanId, documentId, 'standar',
|
||||
jaminanId);
|
||||
} else if (result.isDenied) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana',
|
||||
saveStatusLpj(permohonanId, documentId, 'sederhana',
|
||||
jaminanId);
|
||||
}
|
||||
});
|
||||
@@ -541,7 +535,7 @@
|
||||
|
||||
}
|
||||
|
||||
function saveStatusLpj(permohonanId, documentId, inspeksiId, type, jaminanId) {
|
||||
function saveStatusLpj(permohonanId, documentId, type, jaminanId) {
|
||||
fetch(`{{ url('/penilai/save-status-lpj') }}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -551,7 +545,6 @@
|
||||
body: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
type: type,
|
||||
}),
|
||||
}).then(response => response.json())
|
||||
@@ -559,17 +552,17 @@
|
||||
if (data.success) {
|
||||
if (type === 'standar') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
} else if (type === 'sederhana') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function uploadKertasKerja(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function uploadKertasKerja(permohonanId, documentId, jaminanId) {
|
||||
const kertasKerjaInput = document.getElementById('kertas_kerja');
|
||||
if (!kertasKerjaInput.files.length) {
|
||||
Swal.fire({
|
||||
@@ -585,7 +578,6 @@
|
||||
const formData = new FormData();
|
||||
formData.append('permohonan_id', permohonanId);
|
||||
formData.append('document_id', documentId);
|
||||
formData.append('inspeksi_id', inspeksiId);
|
||||
formData.append('jenis_jaminan_id', jaminanId);
|
||||
formData.append('kertas_kerja', kertasKerja);
|
||||
|
||||
@@ -629,26 +621,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
function resume(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function resume(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.resume') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.resume') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
function memo(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function memo(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.memo') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.memo') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
function rap(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function rap(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
|
||||
function paparan(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function paparan(permohonanId, documentId, jaminanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Kamu yakin ingin melakukan paparan',
|
||||
icon: 'warning',
|
||||
@@ -659,15 +651,15 @@
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href =
|
||||
`/penilai/${permohonanId}/edit?document_id=${documentId}&inspeksi_id=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`/penilai/${permohonanId}/edit?document_id=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function callReport(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function callReport(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.call-report') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.call-report') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,12 +58,6 @@
|
||||
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
|
||||
|
||||
</div>
|
||||
@@ -153,13 +147,11 @@
|
||||
<div>
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $value->id;
|
||||
}
|
||||
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
@@ -167,7 +159,7 @@
|
||||
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $permohonan->approval_so == null)
|
||||
@@ -211,7 +203,7 @@
|
||||
|
||||
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat resume
|
||||
</a>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user