perbaikan nomor laporan, dan penambahan button revisi laporan di so
This commit is contained in:
@@ -381,7 +381,7 @@ class PenilaianController extends Controller
|
||||
|
||||
$header = $headers[$type] ?? 'Pelaporan';
|
||||
|
||||
if($header==='SLA') {
|
||||
if ($header === 'SLA') {
|
||||
return view('lpj::penilaian.otorisator.index-sla', compact('header'));
|
||||
}
|
||||
return view('lpj::penilaian.otorisator.index', compact('header'));
|
||||
@@ -397,22 +397,22 @@ class PenilaianController extends Controller
|
||||
];
|
||||
|
||||
$header = $headers[$type] ?? 'Pelaporan';
|
||||
$authorization=null;
|
||||
if($header === 'SLA') {
|
||||
$authorization = null;
|
||||
if ($header === 'SLA') {
|
||||
$authorization = Authorization::with(['user'])->find($id);
|
||||
$permohonan = Permohonan::find($authorization->permohonan_id);
|
||||
} else {
|
||||
$permohonan = Permohonan::find($id);
|
||||
}
|
||||
if($header === 'SLA') {
|
||||
return view('lpj::penilaian.otorisator.sla', compact('permohonan', 'header','authorization'));
|
||||
if ($header === 'SLA') {
|
||||
return view('lpj::penilaian.otorisator.sla', compact('permohonan', 'header', 'authorization'));
|
||||
}
|
||||
return view('lpj::penilaian.otorisator.show', compact('permohonan', 'header','authorization'));
|
||||
return view('lpj::penilaian.otorisator.show', compact('permohonan', 'header', 'authorization'));
|
||||
}
|
||||
|
||||
public function otorisatorUpdate(Request $request, $id, $context)
|
||||
{
|
||||
if($context==='SLA'){
|
||||
if ($context === 'SLA') {
|
||||
$authorization = Authorization::with(['user'])->find($id);
|
||||
if (!$authorization) {
|
||||
return response()->json([
|
||||
@@ -482,7 +482,7 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal' || Auth::user()->roles[0]->name === 'administrator') {
|
||||
$status = '2';
|
||||
if(!in_array($permohonan->nulai_plafond_id,[1,4])){
|
||||
if (!in_array($permohonan->nulai_plafond_id, [1,4])) {
|
||||
$status = '1';
|
||||
$permohonan->update([
|
||||
'status' => $authorization->request
|
||||
@@ -664,7 +664,7 @@ class PenilaianController extends Controller
|
||||
return redirect()->back()->with('error', 'Laporan belum dibuat');
|
||||
}
|
||||
|
||||
return view('lpj::'. $viewLaporan, compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces','resumeData', 'rap','memo'));
|
||||
return view('lpj::'. $viewLaporan, compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces', 'resumeData', 'rap', 'memo'));
|
||||
}
|
||||
|
||||
private function getViewLaporan($tipe)
|
||||
@@ -731,8 +731,21 @@ class PenilaianController extends Controller
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function revisiLaporan($id, Request $request)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
'keterangan' => $request->message,
|
||||
'submitted_at' => now()
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil Revisi Laporan penilai',
|
||||
], 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user