feat(penilaian): tambahkan fitur tanggal paparan dan otorisasi
- Menambahkan kolom tanggal paparan pada tampilan laporan. - Memperbarui model Permohonan untuk menambahkan relasi otorisasi. - Memperbaiki logika otorisasi pada tampilan paparan. - Memperbaiki penanganan tombol untuk melihat data paparan.
This commit is contained in:
@@ -539,6 +539,10 @@ class PenilaianController extends Controller
|
|||||||
'approve_so_at' => now(),
|
'approve_so_at' => now(),
|
||||||
'keterangan_so' => $request->message,
|
'keterangan_so' => $request->message,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$permohonan->update([
|
||||||
|
'tanggal_paparan' => $request->tanggalPaparan
|
||||||
|
]);
|
||||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal') {
|
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal') {
|
||||||
$status = '2';
|
$status = '2';
|
||||||
if (!in_array($permohonan->nilai_plafond_id, [1, 4])) {
|
if (!in_array($permohonan->nilai_plafond_id, [1, 4])) {
|
||||||
@@ -564,12 +568,11 @@ class PenilaianController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$permohonan->update([
|
$permohonan->update([
|
||||||
'status' => 'paparan',
|
'status' => 'paparan'
|
||||||
'tanggal_paparan' => $request->tanggalPaparan
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'Konteks otorisasi tidak valid.',
|
'message' => 'Konteks otorisasi tidak valid.',
|
||||||
@@ -679,7 +682,10 @@ class PenilaianController extends Controller
|
|||||||
},
|
},
|
||||||
'approveSo',
|
'approveSo',
|
||||||
'approveEo',
|
'approveEo',
|
||||||
'approveDd'
|
'approveDd',
|
||||||
|
'authorization.approveSo',
|
||||||
|
'authorization.approveEo',
|
||||||
|
'authorization.approveDd'
|
||||||
])->get();
|
])->get();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -217,4 +217,8 @@
|
|||||||
public function approveSo(){
|
public function approveSo(){
|
||||||
return $this->belongsTo(User::class, 'approval_so', 'id');
|
return $this->belongsTo(User::class, 'approval_so', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function authorization(){
|
||||||
|
return $this->belongsTo(Authorization::class, 'id', 'permohonan_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,7 @@
|
|||||||
let resumeButton = '';
|
let resumeButton = '';
|
||||||
|
|
||||||
if(data.penilai.resume) {
|
if(data.penilai.resume) {
|
||||||
const resumeButton = `
|
resumeButton = `
|
||||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0" class="btn btn-sm btn-success">
|
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0" class="btn btn-sm btn-success">
|
||||||
Resume
|
Resume
|
||||||
</a>`;
|
</a>`;
|
||||||
|
|||||||
@@ -159,13 +159,13 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
@elseif($dataHeader == 'paparan')
|
@elseif($dataHeader == 'paparan')
|
||||||
<a class="btn btn-success"
|
@if($permohonan->penilai->file_paparan)
|
||||||
href="{{ route('penilai.paparan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
<span class="btn btn-success"
|
||||||
Lihat Data Paparan
|
onclick="viewPDF('{{ Storage::url($permohonan->penilai->file_paparan) }}')"><i
|
||||||
</a>
|
class="ki-filled ki-eye mr-2"></i>Lihat Data Paparan</span>
|
||||||
|
@endif
|
||||||
@if(Auth::user()->hasAnyRole(['administrator','senior-officer']) && $authorization->approve_so==null)
|
@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>
|
<i class="ki-filled ki-double-check"></i>
|
||||||
Otorisator {{ $header ?? '' }}
|
Otorisator {{ $header ?? '' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -173,8 +173,7 @@
|
|||||||
|
|
||||||
@if(Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
@if(Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||||
$authorization->approve_so &&
|
$authorization->approve_so &&
|
||||||
$authorization->approve_dd == null &&
|
$authorization->approve_dd == null)
|
||||||
in_array($permohonan->nilai_plafond_id, [1, 4]))
|
|
||||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button" class="btn btn-primary">
|
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button" class="btn btn-primary">
|
||||||
<i class="ki-filled ki-double-check"></i>
|
<i class="ki-filled ki-double-check"></i>
|
||||||
Otorisator {{ $header ?? '' }}
|
Otorisator {{ $header ?? '' }}
|
||||||
@@ -191,7 +190,7 @@
|
|||||||
function otorisatorData(dataId, role='') {
|
function otorisatorData(dataId, role='') {
|
||||||
const dataHeader = @json($header);
|
const dataHeader = @json($header);
|
||||||
if(dataHeader == 'Paparan'){
|
if(dataHeader == 'Paparan'){
|
||||||
if(role == 'DD'){
|
if(role == 'SO'){
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Apakah Anda yakin?',
|
title: 'Apakah Anda yakin?',
|
||||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
||||||
@@ -252,8 +251,8 @@
|
|||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Apakah Anda yakin?',
|
title: 'Apakah Yakin?',
|
||||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
text: `Pastikan bahwa paparan sudah dilakukan!`,
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
input: 'textarea',
|
input: 'textarea',
|
||||||
inputLabel: 'Keterangan',
|
inputLabel: 'Keterangan',
|
||||||
@@ -282,7 +281,7 @@
|
|||||||
},
|
},
|
||||||
success: (response) => {
|
success: (response) => {
|
||||||
Swal.fire('Berhasil!',
|
Swal.fire('Berhasil!',
|
||||||
'Data berhasil diotorisasi. Menunggu Approval dan Tanggal Paparan dari DD',
|
'Data berhasil diotorisasi',
|
||||||
'success').then(() => {
|
'success').then(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -74,6 +74,18 @@
|
|||||||
<span class="sort"> <span class="sort-label">Nilai Plafond </span>
|
<span class="sort"> <span class="sort-label">Nilai Plafond </span>
|
||||||
<span class="sort-icon"> </span> </span>
|
<span class="sort-icon"> </span> </span>
|
||||||
</th>
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="tanggal_paparan">
|
||||||
|
<span class="sort"> <span class="sort-label"> Tanggal Paparan </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="approval_so">
|
||||||
|
<span class="sort"> <span class="sort-label"> Approval SO </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="approval_dd">
|
||||||
|
<span class="sort"> <span class="sort-label"> Approval DD </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
|
||||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||||
@@ -220,6 +232,34 @@
|
|||||||
return `${data.nilai_plafond.name}`;
|
return `${data.nilai_plafond.name}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
tanggal_paparan:{
|
||||||
|
title: 'Tanggal Paparan',
|
||||||
|
render: (item, data) => {
|
||||||
|
if(data.tanggal_paparan) {
|
||||||
|
return `${window.formatTanggalIndonesia(data.tanggal_paparan)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "-";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
approval_so: {
|
||||||
|
title: 'Approval SO',
|
||||||
|
render: (item, data) => {
|
||||||
|
if(data.authorization.approve_so) {
|
||||||
|
return `${data.authorization.approve_so.name} | ${window.formatTanggalIndonesia(data.authorization.approve_so_at)}`;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
approval_dd: {
|
||||||
|
title: 'Approval DD',
|
||||||
|
render: (item, data) => {
|
||||||
|
if(data.authorization.approve_dd) {
|
||||||
|
return `${data.authorization.approve_dd.name} | ${window.formatTanggalIndonesia(data.authorization.approve_dd_at)}`;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
},
|
||||||
actions: {
|
actions: {
|
||||||
title: 'Status',
|
title: 'Status',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user