update tampilan team activity
This commit is contained in:
committed by
Daeng Deni Mardaeni
parent
20842fa3e0
commit
265e878955
@@ -222,7 +222,7 @@ class PenilaianController extends Controller
|
||||
});
|
||||
})->unique('id');
|
||||
|
||||
$existingTeamIds = $teamPenilai->pluck('id')->toArray();
|
||||
$existingTeamIds = $userTeam->pluck('id')->toArray();
|
||||
|
||||
$updateTeamPenilai = Teams::with(['regions', 'teamsUsers', 'teamsUsers.user'])
|
||||
->whereNotIn('id', $existingTeamIds)
|
||||
@@ -232,23 +232,14 @@ class PenilaianController extends Controller
|
||||
foreach ($userTeam as $item) {
|
||||
$regionName = $item->regions;
|
||||
}
|
||||
// $regionName = $userTeam->first()?->regions->name;
|
||||
|
||||
|
||||
|
||||
$penilaian = Penilaian::where('nomor_registrasi', $permohonan->nomor_registrasi)->first();
|
||||
|
||||
|
||||
$penilaianTeam = collect();
|
||||
if ($penilaian && $penilaian->id) {
|
||||
$penilaianTeam = PenilaianTeam::where('penilaian_id', $penilaian->id)->get();
|
||||
}
|
||||
|
||||
// return response()->json([
|
||||
// 'penilaianTeam' => $penilaianTeam
|
||||
// ]);
|
||||
|
||||
|
||||
return view('lpj::penilaian.form', compact('permohonan', 'teamPenilai', 'jenisPenilaian', 'penilaian', 'regionName', 'updateTeamPenilai', 'penilaianTeam'));
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@ use Modules\Lpj\Models\SpekKategoritBangunan;
|
||||
use Modules\Lpj\Models\SaranaPelengkap;
|
||||
use Modules\Lpj\Models\ArahMataAngin;
|
||||
use Modules\Lpj\Models\Analisa;
|
||||
use Modules\Lpj\Models\PerkerasanJalan;
|
||||
use Modules\Lpj\Models\AnalisaFakta;
|
||||
use Modules\Lpj\Models\AnalisaLingkungan;
|
||||
use Modules\Lpj\Models\AnalisaTanahBagunan;
|
||||
@@ -591,6 +592,7 @@ class SurveyorController extends Controller
|
||||
$golMasySekitar = GolonganMasySekitar::all();
|
||||
$tingkatKeramaian = TingkatKeramaian::all();
|
||||
$laluLintasLokasi = LaluLintasLokasi::all();
|
||||
$perkerasanJalan = PerkerasanJalan::all();
|
||||
|
||||
|
||||
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
|
||||
@@ -598,6 +600,7 @@ class SurveyorController extends Controller
|
||||
->where('jenis_jaminan_id', $jaminanId)
|
||||
->first();
|
||||
|
||||
// return response()->json($permohonan);
|
||||
|
||||
|
||||
return view('lpj::surveyor.components.inspeksi', compact(
|
||||
@@ -622,7 +625,8 @@ class SurveyorController extends Controller
|
||||
'viewUnit',
|
||||
'golMasySekitar',
|
||||
'tingkatKeramaian',
|
||||
'laluLintasLokasi'
|
||||
'laluLintasLokasi',
|
||||
'perkerasanJalan'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -714,27 +718,27 @@ class SurveyorController extends Controller
|
||||
try {
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClass = $this->getModelClass($type);
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
if ($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data = array_merge($validate, ['status' => true]);
|
||||
$modelClass::create($data);
|
||||
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->with('success', 'created successfully');
|
||||
|
||||
if ($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data = array_merge($validate, ['status' => true]);
|
||||
$modelClass::create($data);
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->with('success', 'created successfully');
|
||||
|
||||
} catch (Exeception $e) {
|
||||
|
||||
return response()->json(array('error' => $e->getMessage()), 400);
|
||||
@@ -842,6 +846,7 @@ class SurveyorController extends Controller
|
||||
'Golongan Masyarakat Sekitar' => GolonganMasySekitar::class,
|
||||
'Lantai Unit' => Lantai::class,
|
||||
'View Unit' => ViewUnit::class,
|
||||
'Perkerasan jalan' => PerkerasanJalan::class
|
||||
];
|
||||
|
||||
|
||||
@@ -961,7 +966,8 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function validateSubmit(){
|
||||
public function validateSubmit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1039,6 +1045,7 @@ class SurveyorController extends Controller
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan'],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit'],
|
||||
'view-unit' => ['View Unit', 'view-unit'],
|
||||
'perkerasan-jalan' => ['Perkerasan jalan', 'perkerasan-jalan']
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ class PerkerasanJalan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'perkerasan_jalan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.break-words {
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@@ -46,7 +51,6 @@
|
||||
@php
|
||||
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
|
||||
return $item->team->penilaianTeam
|
||||
->filter(function ($penilaianTeam) use ($item) {
|
||||
return $penilaianTeam->user_id == $item->user->id;
|
||||
@@ -64,8 +68,9 @@
|
||||
style="margin-start: 10px">
|
||||
<table class="table table-auto align-middle text-gray-700 font-medium text-sm">
|
||||
<tr>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">{{ $item->user->name }}</span>
|
||||
<th class="min-w-[150px]" style="width: 600px">
|
||||
<span
|
||||
class="text-base text-gray-900 font-normal break-words">{{ $item->user->name }} Lorem, ipsum dolor sit amet consectetur</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
@@ -86,13 +91,14 @@
|
||||
class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden"></i>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</button>
|
||||
<div class="accordion-content hidden" id="accordion_{{ $index }}content_{{ $index }}">
|
||||
<div class="mx-8 pb-4" style="margin-bottom: 20px">
|
||||
<div class="card card-grid min-w-full" data-datatable="false"
|
||||
id="activity-table-{{ $index }}"
|
||||
data-api-url="{{ route('activity.progres.datatables', ['id' => $item->user->id ]) }}">
|
||||
data-api-url="{{ route('activity.progres.datatables', ['id' => $item->user->id]) }}">
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table
|
||||
@@ -176,7 +182,8 @@
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) => `${data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
render: (item, data) =>
|
||||
`${data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
|
||||
@@ -210,11 +210,6 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- @php
|
||||
var_dump($penilaianTeam);
|
||||
@endphp --}}
|
||||
|
||||
<div
|
||||
class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 {{ $penilaianTeam->isEmpty() ? '' : 'hidden' }}">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -264,8 +259,7 @@
|
||||
|
||||
@if (
|
||||
$penilaianTeam->isNotEmpty() &&
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'surveyor' && is_null($item->user_id))
|
||||
)
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'surveyor' && is_null($item->user_id)))
|
||||
<div id="surveyorId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
@@ -305,7 +299,7 @@
|
||||
@endforeach
|
||||
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
<option value="pilih_dari_region">Pilih Surveyor Dari Region
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
@@ -344,10 +338,8 @@
|
||||
|
||||
|
||||
@if (
|
||||
$penilaianTeam->isNotEmpty() &&
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'penilai' && is_null($item->user_id))
|
||||
)
|
||||
|
||||
$penilaianTeam->isNotEmpty() &&
|
||||
$penilaianTeam->contains(fn($item) => $item->role == 'penilai' && is_null($item->user_id)))
|
||||
<div id="penilaiId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang di tunjuk
|
||||
@@ -371,7 +363,7 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
@elseif($penilaianTeam->isEmpty())
|
||||
<div id="penilaiId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang di tunjuk
|
||||
@@ -385,7 +377,7 @@
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@if ($penilaianTeam->isEmpty())
|
||||
<option value="pilih_dari_region">pilih dari region berdeda
|
||||
<option value="pilih_dari_region">Pilih Penilai Dari Region
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
@@ -437,6 +429,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
@@ -566,12 +559,6 @@
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const revisiForm = document.getElementById('revisiForm');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
@@ -613,4 +600,9 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user