Initial Commit
This commit is contained in:
103
resources/views/activity/activitydetail.blade.php
Normal file
103
resources/views/activity/activitydetail.blade.php
Normal file
@@ -0,0 +1,103 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.border-l-primary {
|
||||
border-left-color: #0d6efd !important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="advanced_settings_appearance">
|
||||
<h3 class="card-title uppercase">
|
||||
Activity Permohonan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('activity.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujuan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($permohonan->status === 'done')
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'ALAT BERAT'];
|
||||
@endphp
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Hasil Laporan Penilaian
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<a class="btn btn-info" href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id ]) }}" class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success" onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@include('lpj::component.lampiran-dokumen')
|
||||
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
@include('lpj::component.history-permohonan')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
57
resources/views/activity/components/status.blade.php
Normal file
57
resources/views/activity/components/status.blade.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<div class="pl-2.5 mb-7 text-md grow">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-sm text-gray-800">
|
||||
{{ $status->name . ' ' . $status->description }}
|
||||
</div>
|
||||
<span class="text-xs text-gray-600">
|
||||
@if (strtolower($status->name) == 'order')
|
||||
{{ $permohonan->created_at }}
|
||||
@elseif (strtolower($status->name) == strtolower($permohonan->status))
|
||||
{{ $permohonan->updated_at }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$isCurrentStatus = strtolower($status->name) == strtolower($permohonan->status);
|
||||
$hasKeterangan = isset($permohonan->keterangan);
|
||||
@endphp
|
||||
|
||||
{{-- Tampilkan keterangan jika status 'register' --}}
|
||||
@if (strtolower($status->name) == 'register' && $hasKeterangan && $isCurrentStatus)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body">
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Tampilkan dokumen dan keterangan jika status 'revisi' --}}
|
||||
@if (strtolower($status->name) == 'revisi' && $hasKeterangan)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('activity.download', $permohonan->id) }}" class="badge badge-sm badge-outline">
|
||||
{{ basename($permohonan->dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (strtolower($status->name) == 'assign' && $isCurrentStatus)
|
||||
<div class="card border border-agi-100 shadow-none">
|
||||
<div class="card-body grid grid-cols-3 gap-5">
|
||||
|
||||
<div>
|
||||
<h3 class="text-md font-medium text-gray-900">Catatan:</h3>
|
||||
<span class="text-2sm text-gray-700">{{ $permohonan->penilaian->keterangan }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
338
resources/views/activity/index.blade.php
Normal file
338
resources/views/activity/index.blade.php
Normal file
@@ -0,0 +1,338 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
margin-top: 0;
|
||||
/* Hilangkan jarak antara tombol dan dropdown */
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
||||
.dropdowns-content:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Activity
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button
|
||||
class="dropdowns-toggle btn btn-sm btn-light inline-flex justify-between w-full items-center">
|
||||
Pilih Status
|
||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||
</i>
|
||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||
</i>
|
||||
</button>
|
||||
<div
|
||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<!-- Checkbox untuk All Status -->
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input id="select-all" type="checkbox"
|
||||
class="form-checkbox h-4 w-4 text-blue-600">
|
||||
<span class="ml-2">All Status</span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Dinamis Status dari Backend -->
|
||||
@foreach ($status_permohonan as $item)
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
||||
value="{{ strtolower($item->name) }}">
|
||||
<span class="ml-2">{{ $item->name }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('activity.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('activity.datatables') }}">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"><span class="sort-label">Tanggal Permohonan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"><span class="sort-label">Cabang Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"><span class="sort-label">Debitur</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Tujuan Penilaian</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"><span class="sort-label">Status</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"></span>
|
||||
<div class="pagination" data-datatable-pagination="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const statusFilter = document.getElementById('status-filter'); // Dropdown filter element
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
} // Default order by 'nomor_registrasi' ascending
|
||||
],
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan'
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user && data.user.name ? `${data.user.name}` : '-';
|
||||
},
|
||||
},
|
||||
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.branch && data.branch.name ? `${data.branch.name}` : '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ?
|
||||
`${data.tujuan_penilaian.name}` : '-';
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = '';
|
||||
switch (data.status.toLowerCase()) {
|
||||
case 'revisi':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-warning';
|
||||
break;
|
||||
case 'order':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-info';
|
||||
break;
|
||||
case 'register':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-success';
|
||||
break;
|
||||
case 'survey':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-primary';
|
||||
break;
|
||||
case 'assign':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-dark';
|
||||
break;
|
||||
default:
|
||||
badgeClass = 'badge badge-pill badge-outline';
|
||||
}
|
||||
|
||||
return `<span class="badge ${badgeClass}">${data.status}</span>`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const status = data.status; // Anggap status berada di dalam objek data
|
||||
const dokumenjaminan = data.dokumenjaminan || [];
|
||||
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="activity/${data.id}/show" title="Lihat Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
${
|
||||
['survey', 'done', 'proses-laporan', 'laporan', 'paparan'].includes(status) ?
|
||||
dokumenjaminan.map(dokumen => {
|
||||
return `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}" title="Print Inspeksi Permohonan">
|
||||
<i class="ki-outline ki-printer"></i>
|
||||
</a>
|
||||
`;
|
||||
}).join('') : ''
|
||||
}
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', applyStatusFilter);
|
||||
});
|
||||
|
||||
// Event listener untuk "Select All"
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
applyStatusFilter();
|
||||
});
|
||||
|
||||
function applyStatusFilter() {
|
||||
const selectedStatuses = Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
|
||||
|
||||
if (selectedStatuses.length === 0) {
|
||||
dataTable.search('');
|
||||
console.log(selectedStatuses);
|
||||
|
||||
} else {
|
||||
|
||||
dataTable.search(selectedStatuses.join(','), true);
|
||||
console.log(selectedStatuses);
|
||||
|
||||
}
|
||||
|
||||
const allChecked = Array.from(statusCheckboxes).every(cb => cb.checked);
|
||||
selectAllCheckbox.checked = allChecked;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
512
resources/views/activity/progres_activity/index.blade.php
Normal file
512
resources/views/activity/progres_activity/index.blade.php
Normal file
@@ -0,0 +1,512 @@
|
||||
@extends('layouts.main')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity.progres') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.break-words {
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Team Activity</h3>
|
||||
</div>
|
||||
<div data-accordion="true">
|
||||
@php
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
return $item->team->regions->penilaiTeam
|
||||
->filter(function ($penilaiTeam) {
|
||||
$permohonan = optional($penilaiTeam->penilaian)->permohonan;
|
||||
return $permohonan !== null;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
@endphp
|
||||
|
||||
@foreach ($sortedTeamsActivity as $index => $item)
|
||||
@php
|
||||
$totalTask = countPermohonanForUser($item->user->id);
|
||||
@endphp
|
||||
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
|
||||
id="accordion_{{ $index }}">
|
||||
<button class="accordion-toggle py-4 group mx-8"
|
||||
data-accordion-toggle="#accordion_{{ $index }}content_{{ $index }}"
|
||||
style="margin-start: 10px">
|
||||
<table class="table table-auto align-middle text-gray-700 font-medium text-sm">
|
||||
<tr>
|
||||
<th class="min-w-[150px]" style="width: 600px">
|
||||
<span
|
||||
class="text-base text-gray-900 font-medium break-words">{{ $item->user->name }}</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
|
||||
@if ($totalTask >= 0 && $totalTask < 5)
|
||||
<span class="badge badge-outline badge-success rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@elseif ($totalTask >= 5 && $totalTask < 10)
|
||||
<span class="badge badge-outline badge-warning rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@else
|
||||
<span class="badge badge-outline badge-danger rounded-full">Total Task
|
||||
{{ $totalTask }}</span>
|
||||
@endif
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<i
|
||||
class="ki-outline ki-plus text-gray-600 text-2sm font-medium accordion-active:hidden block"></i>
|
||||
<i
|
||||
class="ki-outline ki-minus text-gray-600 text-2sm font-medium 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 border border-agi-100 card-grid min-w-full" data-datatable="false"
|
||||
id="activity-table-{{ $index }}"
|
||||
data-api-url="{{ route('activity.progres.datatables', ['id' => $item->user->id]) }}">
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table
|
||||
class="table table-auto align-middle text-gray-700 font-medium text-sm mb-4"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="min-w-[100px]">Nama Debitur</th>
|
||||
<th class="min-w-[100px]">Tujuan Penilaian</th>
|
||||
<th class="min-w-[100px]">Status Bayar</th>
|
||||
<th class="min-w-[100px]">Jenis Asset</th>
|
||||
<th class="min-w-[100px]">Penugasan</th>
|
||||
<th class="min-w-[100px]">Jenis Report</th>
|
||||
<th class="min-w-[100px]">Tgl Register</th>
|
||||
<th class="min-w-[100px]">Tgl Assign</th>
|
||||
<th class="min-w-[100px]">Tgl Kunjungan</th>
|
||||
<th class="min-w-[100px]">Progress</th>
|
||||
<th class="min-w-[100px]">SLA Laporan</th>
|
||||
<th class="min-w-[100px]">SLA Paparan</th>
|
||||
<th class="min-w-[100px]">Approve</th>
|
||||
<th class="min-w-[50px] text-center">Keterangan</th>
|
||||
<th class="min-w-[50px] text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true"
|
||||
name="perpage"></select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"></span>
|
||||
<div class="pagination" data-datatable-pagination="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const accordions = document.querySelectorAll('[data-accordion-item]');
|
||||
|
||||
accordions.forEach((accordion, index) => {
|
||||
accordion.querySelector('.accordion-toggle').addEventListener('click', () => {
|
||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||
'data-api-url');
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
columns: {
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture?.name}`
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.tujuan_penilaian?.name || ''}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
const status = data.permohonan.status_bayar.replace(
|
||||
/_/g,
|
||||
' ');
|
||||
const statusClass = data.permohonan.status_bayar ===
|
||||
'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="badge badge-sm badge-default font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) =>
|
||||
`${data.permohonan.debiture?.documents?.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
penugasan: {
|
||||
title: 'Penugasan',
|
||||
render: (item, data) => {
|
||||
|
||||
const roles = data.user_penilai?.map(d => d.role).join(
|
||||
'<br>') || '-';
|
||||
return roles;
|
||||
},
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
render: (item, data) => {
|
||||
return data.permohonan.penilai?.type_penilai || '-';
|
||||
},
|
||||
},
|
||||
register: {
|
||||
title: 'Register',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.permohonan.created_at) || ''}`,
|
||||
|
||||
},
|
||||
assign: {
|
||||
title: 'Assign',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.created_at)}`,
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tgl Kunjungan',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.waktu_penilaian) || ''}`,
|
||||
},
|
||||
progress: {
|
||||
title: 'Progress',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center ">${data.permohonan.status}</span>`;
|
||||
}
|
||||
},
|
||||
// tanggal kunjungan h+2 jika plafon di
|
||||
due_date: {
|
||||
title: 'Due Date',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return ``;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
},
|
||||
},
|
||||
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.paparan)}`;
|
||||
}
|
||||
},
|
||||
approve: {
|
||||
title: 'Approve',
|
||||
render: (item, data) => {
|
||||
// Gabungkan nama dengan <br> untuk pemisah baris baru
|
||||
let dataHtml = `
|
||||
${data.permohonan?.approve_so?.name || ''}
|
||||
<br>
|
||||
${data.permohonan?.approve_eo?.name || ''}
|
||||
<br>
|
||||
${data.permohonan?.approve_dd?.name || ''}
|
||||
`;
|
||||
return dataHtml;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
keterangan: {
|
||||
title: 'Keterangan',
|
||||
render: (item, data) => `${data.keterangan || ''}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const roles = data.user_penilai.map(d => d.role)
|
||||
let htmlData = ''
|
||||
|
||||
htmlData = `<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id}, '${roles}')" title="Ganti Team">
|
||||
<i class="ki-filled ki-user-edit"></i>
|
||||
</a>`
|
||||
|
||||
return htmlData;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize DataTable only for the active accordion
|
||||
if (!accordion.querySelector('.dataTable')) {
|
||||
const element = accordion.querySelector('.card-grid');
|
||||
new KTDataTable(element, dataTableOptions);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function formatDateFromISO(isoDateString) {
|
||||
const date = new Date(isoDateString);
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const year = String(date.getFullYear()).slice(-2);
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
|
||||
function calculateDateSLA($jenis, $date) {
|
||||
let date = new Date($date);
|
||||
return $jenis, $date;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId, roles) {
|
||||
|
||||
|
||||
const selectCategory = () => {
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
html: `
|
||||
<select id="categorySelect" class="input">
|
||||
<option value="" selected disabled>Pilih kategori Pengganti</option>
|
||||
<option value="team">Pilih dari Team</option>
|
||||
<option value="region">Pilih dari Wilayah</option>
|
||||
</select>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
const selectedCategory = document.getElementById('categorySelect').value;
|
||||
if (!selectedCategory) {
|
||||
Swal.showValidationMessage('Anda harus memilih kategori!');
|
||||
}
|
||||
return selectedCategory;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptionsHtml = '';
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
} else if (selectedCategory === 'region') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Wilayah</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: `Pilih ${selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'}`,
|
||||
html: subOptionsHtml,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
preConfirm: () => {
|
||||
const subOptionsPenugasan = document.getElementById('subOptionsPenugasan')?.value;
|
||||
const subSelected = document.getElementById('subOptionsSelect').value;
|
||||
if (!subSelected) {
|
||||
Swal.showValidationMessage('Anda harus memilih opsi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
penugasan: subOptionsPenugasan || null,
|
||||
selectedOption: subSelected || null,
|
||||
};
|
||||
}
|
||||
}).then((subResult) => {
|
||||
|
||||
console.log(subResult);
|
||||
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' : 'region_id';
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value.selectedOption,
|
||||
penugasan: subResult.value.penugasan,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message, 'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!', 'Terjadi kesalahan saat memproses permintaan.', 'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
selectCategory();
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
15
resources/views/activity/senior_officer/index.blade.php
Normal file
15
resources/views/activity/senior_officer/index.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row"></div>
|
||||
<div class="col-md-12">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user